From 06f7ca7c7559224ea71d02cf281b3fc33d463900 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Tue, 16 Mar 2021 11:39:59 -0400 Subject: [PATCH] Look for average decodes even when we get a single-sequence decode at nfqso. --- lib/q65_decode.f90 | 13 ++++--------- lib/qra/q65/q65.f90 | 6 +++--- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/lib/q65_decode.f90 b/lib/q65_decode.f90 index 8f891e18e..eb0130da0 100644 --- a/lib/q65_decode.f90 +++ b/lib/q65_decode.f90 @@ -186,8 +186,9 @@ contains enddo ! ipass if(iand(ndepth,16).eq.0 .or. navg(iseq).lt.2) go to 100 + ! There was no single-transmission decode. Try for an average 'q3n' decode. - call timer('list_avg',0) +50 call timer('list_avg',0) ! Call top-level routine in q65 module: establish sync and try for a q3 ! decode, this time using the cumulative 's1a' symbol spectra. iavg=1 @@ -257,13 +258,6 @@ contains tdecode,mycall(1:6),c6,c4,trim(decoded) close(22) endif -! else -! Report snr1, even if no decode. -! nsnr=db(snr1) - 35.0 -! if(nsnr.lt.-35) nsnr=-35 -! idec=-1 -! call this%callback(nutc,snr1,nsnr,xdt,f0,decoded, & -! idec,0,ntrperiod) endif navg0=1000*navg(0) + navg(1) if(single_decode .or. lagain) go to 900 @@ -342,7 +336,8 @@ contains close(22) endif endif - enddo + enddo ! icand + if(iavg.eq.0 .and.navg(iseq).ge.2) go to 50 900 return end subroutine decode diff --git a/lib/qra/q65/q65.f90 b/lib/qra/q65/q65.f90 index c39b41768..5ed6d5deb 100644 --- a/lib/qra/q65/q65.f90 +++ b/lib/qra/q65/q65.f90 @@ -119,7 +119,7 @@ subroutine q65_dec0(iavg,nutc,iwave,ntrperiod,nfqso,ntol,ndepth,lclearave, & lclearave=.false. endif ccf1=0. - ccf2_avg=0. + if(iavg.eq.0) ccf2_avg=0. dtstep=nsps/(NSTEP*12000.0) !Step size in seconds lag1=-1.0/dtstep lag2=1.0/dtstep + 0.9999 @@ -471,7 +471,7 @@ subroutine q65_ccf_22(s1,iz,jz,nfqso,ipk,jpk,f0,xdt,ccf2) maxcand=20 do j=1,20 i=indx(jzz-j+1)+i1-1 - if(ccf2(i).lt.3.4) exit !Candidate limit + if(ccf2(i).lt.3.3) exit !Candidate limit f=i*df if(f.ge.(nfqso-ftol) .and. f.le.(nfqso+ftol)) cycle i3=max(1,i-67*mode_q65) @@ -581,7 +581,7 @@ subroutine q65_write_red(iz,xdt,ccf2_avg,ccf2) rewind 17 write(17,1000) xdt,minval(ccf2_avg),maxval(ccf2_avg) - do i=max(1,nint(nfa/df)),nint(nfb/df) + do i=max(1,nint(nfa/df)),min(iz,int(nfb/df)) freq=i*df y1=ccf2_avg(i) if(y1.gt.10.0) y1=10.0 + 2.0*log10(y1/10.0)