diff --git a/lib/ft4/ft4d.f90 b/lib/ft4/ft4d.f90 index 7cb1cac01..fa7c8045a 100644 --- a/lib/ft4/ft4d.f90 +++ b/lib/ft4/ft4d.f90 @@ -11,7 +11,7 @@ program ft4d character*4 cqstr real*8 fMHz integer ihdr(11) - integer*2 iwave(180000) !15*12000 + integer*2 iwave(240000) !20*12000 fs=12000.0/NDOWN !Sample rate dt=1/fs !Sample interval after downsample (s) diff --git a/lib/ft4/getcandidates4.f90 b/lib/ft4/getcandidates4.f90 index 9ce4d8e70..23da3d394 100644 --- a/lib/ft4/getcandidates4.f90 +++ b/lib/ft4/getcandidates4.f90 @@ -27,7 +27,7 @@ subroutine getcandidates4(id,fa,fb,syncmin,nfqso,maxcand,savg,candidate, & ! Compute symbol spectra, stepping by NSTEP steps. savg=0. tstep=NSTEP/12000.0 - df=12000.0/NFFT1 !5.86 Hz + df=12000.0/NFFT1 fac=1.0/300.0 do j=1,NHSYM ia=(j-1)*NSTEP + 1 @@ -55,22 +55,31 @@ subroutine getcandidates4(id,fa,fb,syncmin,nfqso,maxcand,savg,candidate, & indx=0 call indexx(savsm(n300:n2500),np,indx) xn=savsm(nfa+indx(nint(0.3*np))) - savsm=savsm/xn - ncand=0 + if(xn.le.1.e-8) return + savsm=savsm/xn +! call ft4_baseline(savg,nfa,nfb,sbase) +! savsm=savsm/sbase + 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. - fpeak=(i+del)*df+f_offset - speak=savsm(i) - 0.25*(savsm(i-1)-savsm(i+1))*del - ncand=ncand+1 - candidate(1,ncand)=fpeak - candidate(2,ncand)=-99.99 - candidate(3,ncand)=speak - if(ncand.eq.maxcand) exit - endif + if(savsm(i).ge.savsm(i-1) .and. savsm(i).ge.savsm(i+1) .and. & + savsm(i).ge.syncmin) then + den=savsm(i-1)-2*savsm(i)+savsm(i+1) + del=0. + if(den.ne.0.0) del=0.5*(savsm(i-1)-savsm(i+1))/den + 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) then + ncand=maxcand + exit + endif + candidate(1,ncand)=fpeak + candidate(2,ncand)=-99.99 + candidate(3,ncand)=speak + if(ncand.eq.maxcand) exit + endif enddo return