From e92cf06267edb7ef0956856e6216120baf5e5a7d Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 23 Jun 2021 08:02:23 -0400 Subject: [PATCH 1/3] Fix wideband_sync to work also with single-polarization data. --- map65/libm65/wideband_sync.f90 | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/map65/libm65/wideband_sync.f90 b/map65/libm65/wideband_sync.f90 index 352d985fc..65b5074ce 100644 --- a/map65/libm65/wideband_sync.f90 +++ b/map65/libm65/wideband_sync.f90 @@ -59,7 +59,6 @@ call wb_sync(ss,savg,xpol,jz,nfa,nfb) n=indx(iz+1-i) + ia - 1 f0=0.001*(n-1)*df3 snr1=sync(n)%ccfmax -! print*,'=A',f0,snr1 if(snr1.lt.SNR1_THRESHOLD) exit flip=sync(n)%iflip if(flip.ne.0.0 .and. nts_jt65.eq.0) cycle @@ -177,9 +176,10 @@ subroutine wb_sync(ss,savg,xpol,jz,nfa,nfb) ccf4=0. do j=1,22 !Test for Q65 sync k=isync(j) + lag - ccf4=ccf4 + ss(1:npol,k,i+1) + ss(1:npol,k+1,i+1) + ss(1:npol,k+2,i+1) + ccf4(1:npol)=ccf4(1:npol) + ss(1:npol,k,i+1) + & + ss(1:npol,k+1,i+1) + ss(1:npol,k+2,i+1) enddo - ccf4=ccf4 - savg(1:npol,i+1)*3*22/float(jz) + ccf4(1:npol)=ccf4(1:npol) - savg(1:npol,i+1)*3*22/float(jz) ccf=maxval(ccf4) ip=maxloc(ccf4) ipol=ip(1) @@ -195,9 +195,9 @@ subroutine wb_sync(ss,savg,xpol,jz,nfa,nfb) ccf4=0. do j=1,63 !Test for JT65 sync, std msg k=jsync0(j) + lag - ccf4=ccf4 + ss(1:npol,k,i+1) + ss(1:npol,k+1,i+1) + ccf4(1:npol)=ccf4(1:npol) + ss(1:npol,k,i+1) + ss(1:npol,k+1,i+1) enddo - ccf4=ccf4 - savg(1:npol,i+1)*2*63/float(jz) + ccf4(1:npol)=ccf4(1:npol) - savg(1:npol,i+1)*2*63/float(jz) ccf=maxval(ccf4) ip=maxloc(ccf4) ipol=ip(1) @@ -213,9 +213,9 @@ subroutine wb_sync(ss,savg,xpol,jz,nfa,nfb) ccf4=0. do j=1,63 !Test for JT65 sync, OOO msg k=jsync1(j) + lag - ccf4=ccf4 + ss(1:npol,k,i+1) + ss(1:npol,k+1,i+1) + ccf4(1:npol)=ccf4(1:npol) + ss(1:npol,k,i+1) + ss(1:npol,k+1,i+1) enddo - ccf4=ccf4 - savg(1:npol,i+1)*2*63/float(jz) + ccf4(1:npol)=ccf4(1:npol) - savg(1:npol,i+1)*2*63/float(jz) ccf=maxval(ccf4) ip=maxloc(ccf4) ipol=ip(1) @@ -241,11 +241,11 @@ subroutine wb_sync(ss,savg,xpol,jz,nfa,nfb) sync(i)%iflip=flip sync(i)%birdie=.false. if(ccfmax/(savg(ipolbest,i)/savg_med(ipolbest)).lt.3.0) sync(i)%birdie=.true. - if(sync(i)%iflip.eq.0 .and. sync(i)%ccfmax .gt. 20.0) then - write(50,3050) i,lagbest,sync(i)%ccfmax,sync(i)%xdt,sync(i)%ipol, & - sync(i)%birdie,ccf4best -3050 format(2i5,f10.3,f8.2,i5,1x,L3,4f7.1) - endif +! if(sync(i)%iflip.eq.0 .and. sync(i)%ccfmax .gt. 20.0) then +! write(50,3050) i,lagbest,sync(i)%ccfmax,sync(i)%xdt,sync(i)%ipol, & +! sync(i)%birdie,ccf4best +!3050 format(2i5,f10.3,f8.2,i5,1x,L3,4f7.1) +! endif enddo ! i (frequency bin) From 652e989356eba4787a97728775df07ecffbed116 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 23 Jun 2021 13:58:08 -0400 Subject: [PATCH 2/3] For now, increase max DT to 5.5 s in Q65 EME mode. --- lib/q65_decode.f90 | 4 +++- lib/qra/q65/q65.f90 | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/q65_decode.f90 b/lib/q65_decode.f90 index 1dfaf2e00..5d5dcf710 100644 --- a/lib/q65_decode.f90 +++ b/lib/q65_decode.f90 @@ -149,10 +149,12 @@ contains iavg=0 call timer('q65_dec0',0) ! Call top-level routine in q65 module: establish sync and try for a -! q3 of q0 decode. +! q3 or q0 decode. call q65_dec0(iavg,nutc,iwave,ntrperiod,nfqso,ntol,ndepth,lclearave, & emedelay,xdt,f0,snr1,width,dat4,snr2,idec) call timer('q65_dec0',1) +! write(*,3001) '=a',sum(abs(float(iwave))),nfqso,ntol,ndepth,xdt,f0,idec +!3001 format(a2,f15.0,3i5,f7.2,f7.1,i5) if(idec.ge.0) then dtdec=xdt !We have a q3 or q0 decode at nfqso diff --git a/lib/qra/q65/q65.f90 b/lib/qra/q65/q65.f90 index eee12b2a5..ac2438a81 100644 --- a/lib/qra/q65/q65.f90 +++ b/lib/qra/q65/q65.f90 @@ -124,7 +124,7 @@ subroutine q65_dec0(iavg,nutc,iwave,ntrperiod,nfqso,ntol,ndepth,lclearave, & dtstep=nsps/(NSTEP*12000.0) !Step size in seconds lag1=-1.0/dtstep lag2=1.0/dtstep + 0.9999 - if(nsps.ge.3600 .and. emedelay.gt.0) lag2=5.0/dtstep + 0.9999 !Include EME + if(nsps.ge.3600 .and. emedelay.gt.0) lag2=5.5/dtstep + 0.9999 !Include EME j0=0.5/dtstep if(nsps.ge.7200) j0=1.0/dtstep !Nominal start-signal index From bbd7fa059afe69d0193d15a71b629d993337a661 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Thu, 24 Jun 2021 10:36:34 -0400 Subject: [PATCH 3/3] Correct a flaw in setting values of ia, ib in q65_ccf_22.f90. --- lib/qra/q65/q65.f90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/qra/q65/q65.f90 b/lib/qra/q65/q65.f90 index ac2438a81..4a5508cdc 100644 --- a/lib/qra/q65/q65.f90 +++ b/lib/qra/q65/q65.f90 @@ -439,8 +439,8 @@ subroutine q65_ccf_22(s1,iz,jz,nfqso,ntol,ndepth,ntrperiod,iavg,ipk,jpk, & ib=min(nfb,4900)/df if(nqd.ne.1 .or. iavg.ne.0) max_drift=0 if(max_drift.ne.0) then - ia=max(100,nint((nfqso-ntol)/df)) - ib=min(4900,nint((nfqso+ntol)/df)) + ia=max(nint(100/df),nint((nfqso-ntol)/df)) + ib=min(nint(4900/df),nint((nfqso+ntol)/df)) endif do i=ia,ib