Implement a valid scheme for computing S/N in JT4 mode.

(cherry picked from commit f8bb7f4477)
This commit is contained in:
Joe Taylor 2018-06-18 13:41:26 -04:00 committed by Bill Somerville
parent de4696768d
commit f962caace4
2 changed files with 16 additions and 6 deletions

View File

@ -165,7 +165,6 @@ contains
nfreqz=dfx + 1270.46 - 1.5*4.375*mode4
call timer('sync4 ',1)
snrx=db(sync) - 26.
nsnr=nint(snrx)
if(sync.lt.syncmin) then
if (associated (this%decode_callback)) then

View File

@ -23,8 +23,7 @@ subroutine sync4(dat,jz,ntol,NFreeze,MouseDF,mode,mode4,minwidth, &
data nch/1,2,4,9,18,36,72/
save
! write(*,3001) 'A',ntol,nfreeze,mousedf,mode,mode4,minwidth
!3001 format(a1,6i6)
! Do FFTs of twice symbol length, stepped by half symbols. Note that
! we have already downsampled the data by factor of 2.
@ -96,7 +95,7 @@ subroutine sync4(dat,jz,ntol,NFreeze,MouseDF,mode,mode4,minwidth, &
sync=abs(ccfblue(lagpk0))
! Find best sync value
if(sync.gt.syncbest) then
if(sync.gt.syncbest*1.03) then
ipk=i
lagpk=lagpk0
ichpk=ich
@ -106,8 +105,8 @@ subroutine sync4(dat,jz,ntol,NFreeze,MouseDF,mode,mode4,minwidth, &
enddo
if(savered) red=ccfred
enddo
ccfred=red
! width=df*nch(ichpk)
dfx=(ipk-i0 + 3*mode4)*df
@ -171,7 +170,19 @@ subroutine sync4(dat,jz,ntol,NFreeze,MouseDF,mode,mode4,minwidth, &
do i=ipk1a,jmax
if(ccfred1(i).le.ccf10) exit
enddo
width=(i-i1)*df
nw=i-il
width=nw*df
sq=0.
ns=0
do j=jmin,jmax
if(abs(j-ipk1a).lt.nw) then
sq=sq + ccfred1(j)*ccfred1(j)
ns=ns+1
endif
enddo
rms=sqrt(sq/ns)
snrx=10.0*log10(ccfred1(ipk1a)) - 26.0
return
end subroutine sync4