Protect against bad inferred candidate frequencies f0 in FT4 mode.

This commit is contained in:
Joe Taylor 2019-03-28 13:07:37 -04:00
parent e4ebddcf13
commit 54cd97f918
2 changed files with 4 additions and 2 deletions

View File

@ -182,6 +182,7 @@ subroutine ft4_decode(cdatetime0,tbuf,nfa,nfb,nQSOProgress,ncontest,nfqso, &
ndecodes=0
do icand=1,ncand
f0=candidate(1,icand)
if(f0.le.max(fa,10.0) .or. f0.ge.min(fb,4990.0)) cycle
snr=candidate(3,icand)-1.0
if( f0.le.10.0 .or. f0.ge.4990.0 ) cycle
call clockit('ft4_down',0)

View File

@ -61,14 +61,15 @@ subroutine getcandidates4(id,fa,fb,syncmin,nfqso,maxcand,savg,candidate, &
f_offset = -1.5*12000/512
do i=nfa+1,nfb-1
if(savsm(i).ge.savsm(i-1) .and. savsm(i).ge.savsm(i+1) .and. savsm(i).ge.syncmin) then
del=0.5*(savsm(i-1)-savsm(i+1))/(savsm(i-1)-2*savsm(i)+savsm(i+1))
! del=0.5*(savsm(i-1)-savsm(i+1))/(savsm(i-1)-2*savsm(i)+savsm(i+1))
del=0.
fpeak=(i+del)*df+f_offset
speak=savsm(i) - 0.25*(savsm(i-1)-savsm(i+1))*del
ncand=ncand+1
if(ncand.gt.maxcand) exit
candidate(1,ncand)=fpeak
candidate(2,ncand)=-99.99
candidate(3,ncand)=speak
if(ncand.eq.maxcand) exit
endif
enddo