diff options
| author | Christoph Berg <myon@debian.org> | 2024-07-20 08:39:32 +0000 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2024-07-20 08:39:32 +0000 |
| commit | fbaeaa72f63f22bf0b53d634f6809cbdfbb46c9f (patch) | |
| tree | 34bf121b8a6f02b43542bd554d59ba6191cd1359 /lib/ft8/ft8sim.f90 | |
| parent | 93f7198f9c2864ef9630cc0cc9e46d6cc1933aa9 (diff) | |
New upstream version 2.7.0~rc6+dfsgupstream/2.7.0_rc6+dfsg
Diffstat (limited to 'lib/ft8/ft8sim.f90')
| -rwxr-xr-x | lib/ft8/ft8sim.f90 | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/ft8/ft8sim.f90 b/lib/ft8/ft8sim.f90 index a12b6d60..693542be 100755 --- a/lib/ft8/ft8sim.f90 +++ b/lib/ft8/ft8sim.f90 @@ -101,14 +101,24 @@ program ft8sim_gfsk wave=imag(c)
peak=maxval(abs(wave))
nslots=1
-
+
+ psig=0.
+ pnoise=0.
if(snrdb.lt.90) then
do i=1,NMAX !Add gaussian noise at specified SNR
xnoise=gran()
+ if(i.ge.6001 .and. i.le.157692) then
+ psig=psig + wave(i)*wave(i) !Signal power
+ pnoise=pnoise + xnoise*xnoise !Noise power in signal interval
+ endif
wave(i)=wave(i) + xnoise
enddo
endif
+! Noise power in signal interval and 2500 Hz bandwidth:
+ pnoise=bandwidth_ratio*pnoise
+ snr_2500=db(psig/pnoise) !SNR in 2500 Hz bandwidth
+
gain=100.0
if(snrdb.lt.90.0) then
wave=gain*wave
@@ -125,7 +135,7 @@ program ft8sim_gfsk open(10,file=fname,status='unknown',access='stream')
write(10) h,iwave !Save to *.wav file
close(10)
- write(*,1110) ifile,xdt,f0,snrdb,fname
-1110 format(i4,f7.2,f8.2,f7.1,2x,a17)
+ write(*,1110) ifile,xdt,f0,snrdb,fname,snr_2500
+1110 format(i4,f7.2,f8.2,f7.1,2x,a17,f8.2)
enddo
999 end program ft8sim_gfsk
|
