Protect against negative ccfred() value in sync4.

This commit is contained in:
Joe Taylor 2018-11-12 12:28:17 -05:00
parent 9cfb6613aa
commit 72d3e6f6b0

View File

@ -140,8 +140,9 @@ subroutine sync4(dat,jz,ntol,nfqso,mode,mode4,minwidth,dtx,dfx,snrx, &
endif endif
enddo enddo
rms=0.1 rms=0.1
snrx=-26.0
if(ns.gt.0) rms=sqrt(sq/ns) if(ns.gt.0) rms=sqrt(sq/ns)
snrx=10.0*log10(ccfred(ipk1a)/rms) - 41.2 if(ccfred(ipk1a).gt.0.0) snrx=10.0*log10(ccfred(ipk1a)/rms) - 41.2
if(snrx.gt.50.0) snrx=50.0 if(snrx.gt.50.0) snrx=50.0
900 return 900 return