mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-05-23 18:02:29 -04:00
Replace hardwired Nyquist frequency with variable (fsample/2). Add a clipping warning.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@8390 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
2e71491b8a
commit
df6fe7a600
@ -190,7 +190,7 @@ program jt65sim
|
|||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
bandwidth_ratio=2500.0/6000.0
|
bandwidth_ratio=2500.0/(fsample/2.0)
|
||||||
sig=sqrt(2*bandwidth_ratio)*10.0**(0.05*xsnr)
|
sig=sqrt(2*bandwidth_ratio)*10.0**(0.05*xsnr)
|
||||||
if(xsnr.gt.90.0) sig=1.0
|
if(xsnr.gt.90.0) sig=1.0
|
||||||
write(*,1020) ifile,isig,f0,csubmode,xsnr,xdt,fspread,msg
|
write(*,1020) ifile,isig,f0,csubmode,xsnr,xdt,fspread,msg
|
||||||
@ -285,7 +285,11 @@ program jt65sim
|
|||||||
dat=aimag(cdat) + xnoise !Add the generated noise
|
dat=aimag(cdat) + xnoise !Add the generated noise
|
||||||
fac=32767.0/nsigs
|
fac=32767.0/nsigs
|
||||||
if(snrdb.ge.90.0) iwave(1:npts)=nint(fac*dat(1:npts))
|
if(snrdb.ge.90.0) iwave(1:npts)=nint(fac*dat(1:npts))
|
||||||
if(snrdb.lt.90.0) iwave(1:npts)=nint(rms*dat(1:npts))
|
|
||||||
|
if(snrdb.lt.90.0) then
|
||||||
|
if(any(dat.gt.32767.0/rms)) print*,"Warning - data will be clipped."
|
||||||
|
iwave(1:npts)=nint(rms*dat(1:npts))
|
||||||
|
endif
|
||||||
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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user