Merge remote-tracking branch 'refs/remotes/origin/superfox' into superfox

This commit is contained in:
Steven Franke 2024-02-19 13:30:47 -06:00
commit 2346145fba
2 changed files with 25 additions and 9 deletions

View File

@ -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

View File

@ -222,14 +222,20 @@ program q65sim
fac=sqrt(1.0/avep)
cspread=fac*cspread !Normalize to constant avg power
cdat=cspread*cdat !Apply Rayleigh fading
! do i=0,nfft-1
! p=real(cspread(i))**2 + aimag(cspread(i))**2
! write(14,3010) i,p,cspread(i)
!3010 format(i8,3f12.6)
! enddo
endif
! psig=0.
! pnoise=0.
! do i=1,npts
! if(i.gt.12000 .and. i.lt.624000) then
! psig=psig + aimag(cdat(i))**2
! pnoise=pnoise + xnoise(i)*xnoise(i)
! endif
! enddo
! pnoise=pnoise*bandwidth_ratio
! snr_2500=db(psig/pnoise) !Calibration confirmation!
! print*,'SNR_2500:',snr_2500
dat=aimag(cdat) + xnoise !Add generated AWGN noise
fac=32767.0
if(snrdb.ge.90.0) iwave(1:npts)=nint(fac*dat(1:npts))