WSJT-X/lib/superfox/sfox_gen.f90

42 lines
1.0 KiB
Fortran
Raw Normal View History

2024-02-26 12:32:25 -05:00
subroutine sfox_gen(idat,f0,fsample,isync,itone,cdat)
use sfox_mod
complex cdat(NMAX) !Generated complex waveform
complex w,wstep
2024-02-15 08:53:44 -05:00
integer idat(NN)
integer isync(44)
integer itone(171)
twopi=8.0*atan(1.0)
! Create the itone sequence: data symbols and interspersed sync symbols
j=1
k=0
do i=1,NDS
if(j.le.NS .and. i.eq.isync(j)) then
if(j.lt.NS) j=j+1 !Index for next sync symbol
itone(i)=0 !Insert sync symbol at tone 0
else
k=k+1
itone(i)=idat(k) + 1 !Symbol value 0 is transmitted at tone 1, etc.
endif
enddo
df=fsample/NSPS
w=1.0
j=0
i0=NQ/2
! Generate the waveform
2024-02-26 12:32:25 -05:00
do k=1,NDS !Loop over all symbols
dphi=(f0 + (itone(k)-i0)*df)*(twopi/fsample)
wstep=cmplx(cos(dphi),sin(dphi))
2024-02-26 12:32:25 -05:00
do i=1,NSPS !NSPS samples per symbol
j=j+1
w=w*wstep
cdat(j)=w
enddo
enddo
return
2024-02-10 19:51:36 -05:00
end subroutine sfox_gen