From 6b540aaad06230fb0d0a9c30d26a3d6d06aacf75 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Tue, 1 Dec 2020 11:23:35 -0500 Subject: [PATCH] Correct offset in (i,j) indices for selecting s3 from s1. --- lib/q65_sync.f90 | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/lib/q65_sync.f90 b/lib/q65_sync.f90 index cbdcbe4dc..f1b056cb5 100644 --- a/lib/q65_sync.f90 +++ b/lib/q65_sync.f90 @@ -79,7 +79,6 @@ subroutine q65_sync(iwave,nmax,mode_q65,codewords,ncw,nsps,nfqso,ntol, & i0=nint(nfqso/df) !Target QSO frequency call pctile(s1(i0-64:i0+192,1:jz),129*jz,40,base) -! s1=s1/base - 1.0 s1=s1/base ! Apply fast AGC @@ -107,6 +106,7 @@ subroutine q65_sync(iwave,nmax,mode_q65,codewords,ncw,nsps,nfqso,ntol, & ipk=0 jpk=0 ccf_best=0. + imsg_best=-1 do imsg=1,ncw i=1 k=0 @@ -140,12 +140,16 @@ subroutine q65_sync(iwave,nmax,mode_q65,codewords,ncw,nsps,nfqso,ntol, & jpk=ijpk(2)-53-1 f0=nfqso + ipk*df xdt=jpk*dtstep + imsg_best=imsg endif enddo ! imsg - ia=i0+ipk-63 + write(71,3071) imsg_best,ipk,jpk,xdt,f0,ccf_best +3071 format(3i5,3f10.2) + + ia=i0+ipk-64 ib=ia+LL-1 - j=j0+jpk-5 + j=j0+jpk-7 n=0 do k=1,85 j=j+8 @@ -155,6 +159,13 @@ subroutine q65_sync(iwave,nmax,mode_q65,codewords,ncw,nsps,nfqso,ntol, & n=n+1 if(j.ge.1 .and. j.le.jz) s3(-64:LL-65,n)=s1(ia:ib,j) enddo + + write(73,3001) codewords(1:10,3) +3001 format(3x,10i7) + do i=-5,68 + write(73,3073) i,(s3(i,j),j=1,10) +3073 format(i3,10f7.1) + enddo nsubmode=0 if(mode_q65.eq.2) nsubmode=1 @@ -167,6 +178,8 @@ subroutine q65_sync(iwave,nmax,mode_q65,codewords,ncw,nsps,nfqso,ntol, & b90=1.72**ibw call q65_intrinsics_ff(s3,nsubmode,b90/baud,nFadingModel,s3prob) call q65_dec_fullaplist(s3,s3prob,codewords,ncw,esnodb,dat4,plog,irc) + write(72,3072) ibw,dat4,plog,irc +3072 format(i2,2x,13i3,f8.1,i5) if(irc.ge.0) then snr2=esnodb - db(2500.0/baud) id1=1