diff options
| author | Christoph Berg <myon@debian.org> | 2025-09-16 12:37:12 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2025-09-16 12:57:29 +0200 |
| commit | 5a4967c577ad245a2117b7b2f71c13b1212fe285 (patch) | |
| tree | 4d09343cfe757239895a0dd9b399242d2a07d7c2 /lib/wsprd/wspr_wav.f90 | |
| parent | 23c903a09fb1d73fd20b50323cd80cfb3aba8799 (diff) | |
Merge 2.7 changes, I had uploaded -1 from the wrong branch.debian/3.0.0_rc1+repack-2
Diffstat (limited to 'lib/wsprd/wspr_wav.f90')
| -rwxr-xr-x | lib/wsprd/wspr_wav.f90 | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/lib/wsprd/wspr_wav.f90 b/lib/wsprd/wspr_wav.f90 index 900ebda4..bad72b55 100755 --- a/lib/wsprd/wspr_wav.f90 +++ b/lib/wsprd/wspr_wav.f90 @@ -1,49 +1,49 @@ -subroutine wspr_wav(baud,xdt,h,f0,itone,snrdb,iwave) - -! Generate iwave() from itone(). - - include 'wspr_params.f90' - integer itone(NN) - integer*2 iwave(NMAX) - real*8 twopi,dt,dphi0,dphi1,dphi,phi - real dat(NMAX) - - twopi=8.d0*atan(1.d0) - dt=1.d0/12000.d0 - baud=375.0/256.0 - - dat=0. - if(snrdb.lt.90) then - do i=1,NMAX - dat(i)=gran() !Generate gaussian noise - enddo - bandwidth_ratio=2500.0/6000.0 - sig=sqrt(2*bandwidth_ratio)*10.0**(0.05*snrdb) - else - sig=1.0 - endif - - phi=0.d0 - k=nint(xdt/dt) - do j=1,NN - dphi=twopi*(f0+h*(itone(j)-1.5)*baud)*dt - do i=1,NSPS0 - k=k+1 - phi=mod(phi+dphi,twopi) - if(k.gt.0 .and. k.le.NMAX) dat(k)=dat(k) + sig*sin(phi) - enddo - enddo - - rms=100.0 - if(snrdb.lt.90.0) then - dat=rms*dat; - if(maxval(abs(dat)).gt.32767.0) print*,"Warning - data will be clipped." - else - datpk=maxval(abs(dat)) - fac=32767.0/datpk - dat=fac*dat - endif - iwave=nint(dat) - - return -end subroutine wspr_wav +subroutine wspr_wav(baud,xdt,h,f0,itone,snrdb,iwave)
+
+! Generate iwave() from itone().
+
+ include 'wspr_params.f90'
+ integer itone(NN)
+ integer*2 iwave(NMAX)
+ real*8 twopi,dt,dphi0,dphi1,dphi,phi
+ real dat(NMAX)
+
+ twopi=8.d0*atan(1.d0)
+ dt=1.d0/12000.d0
+ baud=375.0/256.0
+
+ dat=0.
+ if(snrdb.lt.90) then
+ do i=1,NMAX
+ dat(i)=gran() !Generate gaussian noise
+ enddo
+ bandwidth_ratio=2500.0/6000.0
+ sig=sqrt(2*bandwidth_ratio)*10.0**(0.05*snrdb)
+ else
+ sig=1.0
+ endif
+
+ phi=0.d0
+ k=nint(xdt/dt)
+ do j=1,NN
+ dphi=twopi*(f0+h*(itone(j)-1.5)*baud)*dt
+ do i=1,NSPS0
+ k=k+1
+ phi=mod(phi+dphi,twopi)
+ if(k.gt.0 .and. k.le.NMAX) dat(k)=dat(k) + sig*sin(phi)
+ enddo
+ enddo
+
+ rms=100.0
+ if(snrdb.lt.90.0) then
+ dat=rms*dat;
+ if(maxval(abs(dat)).gt.32767.0) print*,"Warning - data will be clipped."
+ else
+ datpk=maxval(abs(dat))
+ fac=32767.0/datpk
+ dat=fac*dat
+ endif
+ iwave=nint(dat)
+
+ return
+end subroutine wspr_wav
|
