From d57b84be2768e9eadc9e40b0d8f6d13e72a022d6 Mon Sep 17 00:00:00 2001 From: Steven Franke Date: Sun, 8 Mar 2020 12:03:52 -0500 Subject: [PATCH] More changes to increase ft8 decoder yield. --- lib/ft8/subtractft8.f90 | 11 ++++++++--- lib/ft8/sync8.f90 | 10 ++++------ lib/ft8_decode.f90 | 6 +++--- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/lib/ft8/subtractft8.f90 b/lib/ft8/subtractft8.f90 index 1a374cc27..7c3b59082 100644 --- a/lib/ft8/subtractft8.f90 +++ b/lib/ft8/subtractft8.f90 @@ -8,10 +8,11 @@ subroutine subtractft8(dd0,itone,f0,dt,lrefinedt) ! Subtract : dd(t) = dd(t) - 2*REAL{cref*cfilt} parameter (NMAX=15*12000,NFRAME=1920*79) - parameter (NFFT=NMAX,NFILT=2800) + parameter (NFFT=NMAX,NFILT=4000) real dd(NMAX),dd0(NMAX) real window(-NFILT/2:NFILT/2) real x(NFFT+2) + real endcorrection(NFILT/2+1) complex cx(0:NFFT/2) complex cref,camp,cfilt,cw,z integer itone(79) @@ -19,7 +20,7 @@ subroutine subtractft8(dd0,itone,f0,dt,lrefinedt) data first/.true./ common/heap8/cref(NFRAME),camp(NMAX),cfilt(NMAX),cw(NMAX) equivalence (x,cx) - save first,/heap8/ + save first,/heap8/,endcorrection if(first) then ! Create and normalize the filter pi=4.0*atan(1.0) @@ -35,6 +36,9 @@ subroutine subtractft8(dd0,itone,f0,dt,lrefinedt) call four2a(cw,nfft,1,-1,1) cw=cw*fac first=.false. + do j=1,NFILT/2+1 + endcorrection(j)=1.0/(1.0-sum(window(j-1:NFILT/2))/sumw) + enddo endif ! Generate complex reference waveform cref @@ -72,7 +76,8 @@ contains call four2a(cfilt,nfft,1,-1,1) cfilt(1:nfft)=cfilt(1:nfft)*cw(1:nfft) call four2a(cfilt,nfft,1,1,1) - + cfilt(1:NFILT/2+1)=cfilt(1:NFILT/2+1)*endcorrection + cfilt(nframe:nframe-NFILT/2:-1)=cfilt(nframe:nframe-NFILT/2:-1)*endcorrection x=0. do i=1,nframe j=nstart+i-1 diff --git a/lib/ft8/sync8.f90 b/lib/ft8/sync8.f90 index 0aa787629..997b1990d 100644 --- a/lib/ft8/sync8.f90 +++ b/lib/ft8/sync8.f90 @@ -37,7 +37,6 @@ subroutine sync8(dd,nfa,nfb,syncmin,nfqso,maxcand,s,candidate, & enddo savg=savg + s(1:NH1,j) !Average spectrum enddo -! call baseline(savg,nfa,nfb,sbase) call get_spectrum_baseline(dd,nfa,nfb,sbase) ia=max(1,nint(nfa/df)) @@ -129,14 +128,13 @@ subroutine sync8(dd,nfa,nfb,syncmin,nfqso,maxcand,s,candidate, & s=fac*s ! Sort by sync -! call indexx(candidate0(3,1:ncand),ncand,indx) + call indexx(candidate0(3,1:ncand),ncand,indx) ! Sort by frequency - call indexx(candidate0(1,1:ncand),ncand,indx) +! call indexx(candidate0(1,1:ncand),ncand,indx) k=1 -! do i=ncand,1,-1 - do i=1,ncand + do i=ncand,1,-1 +! do i=1,ncand j=indx(i) -! if( candidate0(3,j) .ge. syncmin .and. candidate0(2,j).ge.-1.5 ) then if( candidate0(3,j) .ge. syncmin ) then candidate(2:3,k)=candidate0(2:3,j) candidate(1,k)=abs(candidate0(1,j)) diff --git a/lib/ft8_decode.f90 b/lib/ft8_decode.f90 index 5fecc9bb6..dfdcc2060 100644 --- a/lib/ft8_decode.f90 +++ b/lib/ft8_decode.f90 @@ -115,8 +115,8 @@ contains if(ndepth.eq.1) npass=1 if(ndepth.ge.2) npass=3 do ipass=1,npass - newdat=.true. ! Is this a problem? I hijacked newdat. - syncmin=1.5 + newdat=.true. + syncmin=1.3 if(ipass.eq.1) then lsubtract=.true. if(ndepth.eq.1) lsubtract=.false. @@ -126,7 +126,7 @@ contains lsubtract=.true. elseif(ipass.eq.3) then if((ndecodes-n2).eq.0) cycle - lsubtract=.false. + lsubtract=.true. endif call timer('sync8 ',0) maxc=MAXCAND