diff --git a/lib/ft4/ft4_downsample.f90 b/lib/ft4/ft4_downsample.f90 index ed55fb9a0..f908c6c44 100644 --- a/lib/ft4/ft4_downsample.f90 +++ b/lib/ft4/ft4_downsample.f90 @@ -40,8 +40,8 @@ subroutine ft4_downsample(dd,newdata,f0,c) c1=0. if(i0.ge.0 .and. i0.le.NMAX/2) c1(0)=cx(i0) do i=1,NFFT2/2 - if(i0+i.le.NMAX/2) c1(i)=cx(i0+i) - if(i0-i.ge.0) c1(NFFT2-i)=cx(i0-i) + if(i0+i.ge.0 .and. i0+i.le.NMAX/2) c1(i)=cx(i0+i) + if(i0-i.ge.0 .and. i0-i.le.NMAX/2) c1(NFFT2-i)=cx(i0-i) enddo c1=c1*window/NFFT2 call four2a(c1,NFFT2,1,1,1) !c2c FFT back to time domain diff --git a/lib/ft4/getcandidates4.f90 b/lib/ft4/getcandidates4.f90 index f7cef02ef..951129915 100644 --- a/lib/ft4/getcandidates4.f90 +++ b/lib/ft4/getcandidates4.f90 @@ -47,7 +47,7 @@ subroutine getcandidates4(dd,fa,fb,syncmin,nfqso,maxcand,savg,candidate, & nfa=fa/df if(nfa.lt.nint(200.0/df)) nfa=nint(200.0/df) nfb=fb/df - if(nfb.gt.nint(5000.0/df)) nfb=nint(5000.0/df) + if(nfb.gt.nint(4910.0/df)) nfb=nint(4910.0/df) ncand=0 call ft4_baseline(savg,nfa,nfb,sbase) if(any(sbase(nfa:nfb).le.0)) return @@ -60,13 +60,9 @@ subroutine getcandidates4(dd,fa,fb,syncmin,nfqso,maxcand,savg,candidate, & del=0. if(den.ne.0.0) del=0.5*(savsm(i-1)-savsm(i+1))/den fpeak=(i+del)*df+f_offset - if(fpeak.lt.0.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 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