mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-22 20:28:42 -05:00
7d8a896e6a
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7159 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
17 lines
338 B
Fortran
17 lines
338 B
Fortran
subroutine degrade_snr(d2,npts,db,bw)
|
|
|
|
integer*2 d2(npts)
|
|
real dat(60*12000)
|
|
|
|
dat(1:npts)=d2
|
|
p0=dot_product(dat(1:npts),dat(1:npts))/npts
|
|
if(bw.gt.0.0) p0=p0*6000.0/bw
|
|
s=sqrt(p0*(10.0**(0.1*db) - 1.0))
|
|
fac=sqrt(p0/(p0+s*s))
|
|
do i=1,npts
|
|
d2(i)=nint(fac*(dat(i) + s*gran()))
|
|
enddo
|
|
|
|
return
|
|
end subroutine degrade_snr
|