2024-02-22 13:41:09 -05:00
|
|
|
subroutine sfox_gen(idat,f0,fsample,cdat)
|
2024-01-31 12:58:27 -05:00
|
|
|
|
2024-02-08 10:45:43 -05:00
|
|
|
use sfox_mod
|
2024-01-31 12:58:27 -05:00
|
|
|
complex cdat(NMAX) !Generated complex waveform
|
|
|
|
complex w,wstep
|
2024-02-15 08:53:44 -05:00
|
|
|
integer idat(NN)
|
2024-01-31 12:58:27 -05:00
|
|
|
|
|
|
|
twopi=8.0*atan(1.0)
|
|
|
|
tsync=NS*NSPS/fsample
|
|
|
|
df=fsample/NSPS
|
2024-02-10 13:35:06 -05:00
|
|
|
w=1.0
|
2024-01-31 12:58:27 -05:00
|
|
|
j=0
|
|
|
|
k=0
|
2024-02-10 13:35:06 -05:00
|
|
|
i0=NQ/2
|
2024-01-31 12:58:27 -05:00
|
|
|
! First group of data symbols:
|
|
|
|
do n=1,ND1
|
|
|
|
k=k+1
|
2024-02-10 13:35:06 -05:00
|
|
|
dphi=(f0 + (idat(k)-i0)*df)*(twopi/fsample)
|
2024-01-31 12:58:27 -05:00
|
|
|
wstep=cmplx(cos(dphi),sin(dphi))
|
|
|
|
do i=1,NSPS
|
|
|
|
j=j+1
|
|
|
|
w=w*wstep
|
|
|
|
cdat(j)=w
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
|
2024-02-22 13:41:09 -05:00
|
|
|
! Insert sync symbols
|
|
|
|
do n=1,NS
|
|
|
|
dphi=(f0 + (isync(n)-i0)*df)*(twopi/fsample)
|
|
|
|
wstep=cmplx(cos(dphi),sin(dphi))
|
|
|
|
do i=1,NSPS
|
|
|
|
j=j+1
|
|
|
|
w=w*wstep
|
|
|
|
cdat(j)=w
|
|
|
|
enddo
|
|
|
|
enddo
|
2024-01-31 12:58:27 -05:00
|
|
|
|
2024-02-22 13:41:09 -05:00
|
|
|
|
2024-01-31 12:58:27 -05:00
|
|
|
! Final group of data symbols:
|
|
|
|
do n=1,ND2
|
|
|
|
k=k+1
|
2024-02-10 13:35:06 -05:00
|
|
|
dphi=(f0 + (idat(k)-i0)*df)*(twopi/fsample)
|
2024-01-31 12:58:27 -05:00
|
|
|
wstep=cmplx(cos(dphi),sin(dphi))
|
|
|
|
do i=1,NSPS
|
|
|
|
j=j+1
|
|
|
|
w=w*wstep
|
|
|
|
cdat(j)=w
|
|
|
|
enddo
|
|
|
|
enddo
|
|
|
|
|
|
|
|
return
|
2024-02-10 19:51:36 -05:00
|
|
|
end subroutine sfox_gen
|