When SNR>90 dB is specified, simulated signal is noiseless. If Doppler spread is nonzero, then signal will have random peak amplitude. In this case normalize the signal so that peak amplitude=32767.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@8391 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Steven Franke 2018-01-02 00:13:21 +00:00
parent df6fe7a600
commit b7543dce08

View File

@ -283,13 +283,15 @@ program jt65sim
endif endif
dat=aimag(cdat) + xnoise !Add the generated noise dat=aimag(cdat) + xnoise !Add the generated noise
fac=32767.0/nsigs
if(snrdb.ge.90.0) iwave(1:npts)=nint(fac*dat(1:npts))
if(snrdb.lt.90.0) then if(snrdb.lt.90.0) then
if(any(dat.gt.32767.0/rms)) print*,"Warning - data will be clipped." dat=rms*dat(1:npts)
iwave(1:npts)=nint(rms*dat(1:npts)) else
datpk=maxval(abs(dat))
fac=32766.9/datpk
dat=fac*dat(1:npts)
endif endif
if(any(dat.gt.32767.0)) print*,"Warning - data will be clipped."
iwave(1:npts)=real(dat(1:npts))
write(10) h,iwave(1:npts) !Save the .wav file write(10) h,iwave(1:npts) !Save the .wav file
close(10) close(10)
enddo enddo