Fix a bug in wspr4 signal generation.

This commit is contained in:
Steven Franke 2020-04-15 07:58:31 -05:00
parent 00abc81a00
commit 7d52234371
1 changed files with 3 additions and 2 deletions

View File

@ -7,12 +7,13 @@ subroutine gen_wspr4wave(itone,nsym,nsps,fsample,f0,cwave,wave,icmplx,nwave)
integer itone(nsym)
logical first
data first/.true./
save pulse,first,twopi,dt,hmod
save pulse,first,twopi,dt,hmod,tsym
if(first) then
allocate( pulse(3*nsps*fsample) )
twopi=8.0*atan(1.0)
dt=1.0/fsample
tsym=nsps/fsample
hmod=1.0
! Compute the smoothed frequency-deviation pulse
do i=1,3*nsps
@ -35,7 +36,7 @@ subroutine gen_wspr4wave(itone,nsym,nsps,fsample,f0,cwave,wave,icmplx,nwave)
! Calculate and insert the audio waveform
phi=0.0
dphi = dphi + twopi*f0*dt !Shift frequency up by f0
dphi = dphi + twopi*(f0-1.5/tsym)*dt !Shift frequency up by f0
wave=0.
if(icmplx.eq.1) cwave=0.
k=0