From a83649a7683f05deda9db66728c2e6240c35bc89 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 10 Feb 2023 10:37:27 -0500 Subject: [PATCH] Working to improve Q65 decode performnce. --- lib/q65_decode.f90 | 10 ++++++---- lib/qra/q65/q65.f90 | 8 +++++++- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/lib/q65_decode.f90 b/lib/q65_decode.f90 index 8114565b1..88c54e620 100644 --- a/lib/q65_decode.f90 +++ b/lib/q65_decode.f90 @@ -228,10 +228,10 @@ contains read(c78,1060) apsymbols endif - call timer('q65loops',0) + call timer('q65loop1',0) call q65_loops(c00,npts/2,nsps/2,nsubmode,ndepth,jpk0, & xdt,f0,iaptype,xdt1,f1,snr2,dat4,idec) - call timer('q65loops',1) + call timer('q65loop1',1) ! write(*,3001) '=b',nfqso,ntol,ndepth,xdt,f0,idec if(idec.ge.0) then dtdec=xdt1 @@ -366,6 +366,8 @@ contains if(lapcqonly) npasses=1 iaptype=0 do ipass=0,npasses !Loop over AP passes +! write(*,3001) nutc,icand,ipass,f0,xdt,snr1 +!3001 format('a',i5.4,2i3,3f7.1) apmask=0 !Try first with no AP information apsymbols=0 if(ipass.ge.1) then @@ -378,10 +380,10 @@ contains read(c78,1060) apsymbols endif - call timer('q65loops',0) + call timer('q65loop2',0) call q65_loops(c00,npts/2,nsps/2,nsubmode,ndepth,jpk0, & xdt,f0,iaptype,xdt1,f1,snr2,dat4,idec) - call timer('q65loops',1) + call timer('q65loop2',1) ! write(*,3001) '=e',nfqso,ntol,ndepth,xdt,f0,idec if(idec.ge.0) then dtdec=xdt1 diff --git a/lib/qra/q65/q65.f90 b/lib/qra/q65/q65.f90 index 5f1909e59..a62193df8 100644 --- a/lib/qra/q65/q65.f90 +++ b/lib/qra/q65/q65.f90 @@ -567,6 +567,10 @@ subroutine q65_ccf_22(s1,iz,jz,nfqso,ntol,iavg,ipk,jpk, & ! Save parameters for best candidates jzz=ib-ia+1 call indexx(ccf2(ia:ib),jzz,indx) + + call pctile(ccf2(ia:ib),jzz,50,ave) + call pctile(ccf2(ia:ib),jzz,84,base) + rms=base-ave ncand=0 maxcand=20 do j=1,20 @@ -578,8 +582,10 @@ subroutine q65_ccf_22(s1,iz,jz,nfqso,ntol,iavg,ipk,jpk, & i4=min(iz,i+mode_q65) biggest=maxval(ccf2(i3:i4)) if(ccf2(i).ne.biggest) cycle + snr=(ccf2(i)-ave)/rms + if(snr.lt.6.0) exit ncand=ncand+1 - candidates(ncand,1)=ccf2(i) + candidates(ncand,1)=snr candidates(ncand,2)=xdt2(i) candidates(ncand,3)=f if(ncand.ge.maxcand) exit