FT4: candidates within 20 Hz of nfqso are presented to the decoder first.

This commit is contained in:
Steve Franke 2019-06-24 11:09:55 -05:00
parent 91aa591a71
commit e7889ba11b

View File

@ -8,7 +8,7 @@ subroutine getcandidates4(dd,fa,fb,syncmin,nfqso,maxcand,savg,candidate, &
real x(NFFT1) real x(NFFT1)
real window(NFFT1) real window(NFFT1)
complex cx(0:NH1) complex cx(0:NH1)
real candidate(2,maxcand) real candidate(2,maxcand),candidatet(2,maxcand)
real dd(NMAX) real dd(NMAX)
integer ipk(1) integer ipk(1)
equivalence (x,cx) equivalence (x,cx)
@ -48,11 +48,12 @@ subroutine getcandidates4(dd,fa,fb,syncmin,nfqso,maxcand,savg,candidate, &
if(nfa.lt.nint(200.0/df)) nfa=nint(200.0/df) if(nfa.lt.nint(200.0/df)) nfa=nint(200.0/df)
nfb=fb/df nfb=fb/df
if(nfb.gt.nint(4910.0/df)) nfb=nint(4910.0/df) if(nfb.gt.nint(4910.0/df)) nfb=nint(4910.0/df)
ncand=0
call ft4_baseline(savg,nfa,nfb,sbase) call ft4_baseline(savg,nfa,nfb,sbase)
if(any(sbase(nfa:nfb).le.0)) return if(any(sbase(nfa:nfb).le.0)) return
savsm(nfa:nfb)=savsm(nfa:nfb)/sbase(nfa:nfb) savsm(nfa:nfb)=savsm(nfa:nfb)/sbase(nfa:nfb)
f_offset = -1.5*12000.0/NSPS f_offset = -1.5*12000.0/NSPS
ncand=0
candidatet=0
do i=nfa+1,nfb-1 do i=nfa+1,nfb-1
if(savsm(i).ge.savsm(i-1) .and. savsm(i).ge.savsm(i+1) .and. & if(savsm(i).ge.savsm(i-1) .and. savsm(i).ge.savsm(i+1) .and. &
savsm(i).ge.syncmin) then savsm(i).ge.syncmin) then
@ -63,11 +64,23 @@ subroutine getcandidates4(dd,fa,fb,syncmin,nfqso,maxcand,savg,candidate, &
if(fpeak.lt.200.0 .or. fpeak.gt.4910.0) cycle if(fpeak.lt.200.0 .or. fpeak.gt.4910.0) cycle
speak=savsm(i) - 0.25*(savsm(i-1)-savsm(i+1))*del speak=savsm(i) - 0.25*(savsm(i-1)-savsm(i+1))*del
ncand=ncand+1 ncand=ncand+1
candidate(1,ncand)=fpeak candidatet(1,ncand)=fpeak
candidate(2,ncand)=speak candidatet(2,ncand)=speak
if(ncand.eq.maxcand) exit if(ncand.eq.maxcand) exit
endif endif
enddo enddo
candidate=0
nq=count(abs(candidatet(1,1:ncand)-nfqso).le.20.0)
n1=1
n2=nq+1
do i=1,ncand
if(abs(candidatet(1,i)-nfqso).le.20.0) then
candidate(1:2,n1)=candidatet(1:2,i)
n1=n1+1
else
candidate(1:2,n2)=candidatet(1:2,i)
n2=n2+1
endif
enddo
return return
end subroutine getcandidates4 end subroutine getcandidates4