mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-07-29 20:22:28 -04:00
Compute signal power, noise power, and SNR_2500 explicitly in ft8sim.f90.
This commit is contained in:
parent
ec0c31d849
commit
fb19d27602
@ -101,14 +101,24 @@ program ft8sim_gfsk
|
|||||||
wave=imag(c)
|
wave=imag(c)
|
||||||
peak=maxval(abs(wave))
|
peak=maxval(abs(wave))
|
||||||
nslots=1
|
nslots=1
|
||||||
|
|
||||||
|
psig=0.
|
||||||
|
pnoise=0.
|
||||||
if(snrdb.lt.90) then
|
if(snrdb.lt.90) then
|
||||||
do i=1,NMAX !Add gaussian noise at specified SNR
|
do i=1,NMAX !Add gaussian noise at specified SNR
|
||||||
xnoise=gran()
|
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
|
wave(i)=wave(i) + xnoise
|
||||||
enddo
|
enddo
|
||||||
endif
|
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
|
gain=100.0
|
||||||
if(snrdb.lt.90.0) then
|
if(snrdb.lt.90.0) then
|
||||||
wave=gain*wave
|
wave=gain*wave
|
||||||
@ -125,7 +135,7 @@ program ft8sim_gfsk
|
|||||||
open(10,file=fname,status='unknown',access='stream')
|
open(10,file=fname,status='unknown',access='stream')
|
||||||
write(10) h,iwave !Save to *.wav file
|
write(10) h,iwave !Save to *.wav file
|
||||||
close(10)
|
close(10)
|
||||||
write(*,1110) ifile,xdt,f0,snrdb,fname
|
write(*,1110) ifile,xdt,f0,snrdb,fname,snr_2500
|
||||||
1110 format(i4,f7.2,f8.2,f7.1,2x,a17)
|
1110 format(i4,f7.2,f8.2,f7.1,2x,a17,f8.2)
|
||||||
enddo
|
enddo
|
||||||
999 end program ft8sim_gfsk
|
999 end program ft8sim_gfsk
|
||||||
|
Loading…
x
Reference in New Issue
Block a user