From cbb42e9cdd4f992e8efe8ed8f8f9fb87a5ce3921 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Mon, 26 Feb 2024 13:14:33 -0500 Subject: [PATCH] Q65-style sync basically working. Have not yet proceeded to decode step. --- lib/superfox/sfox_sync.f90 | 28 ++++++++++++++++++---------- lib/superfox/sfoxtest.f90 | 2 +- 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/lib/superfox/sfox_sync.f90 b/lib/superfox/sfox_sync.f90 index 3a7799ecf..646f94aa6 100644 --- a/lib/superfox/sfox_sync.f90 +++ b/lib/superfox/sfox_sync.f90 @@ -4,7 +4,7 @@ subroutine sfox_sync(iwave,fsample,isync,f,t) parameter (NSTEP=8) integer*2 iwave(0:NMAX-1) integer isync(44) - integer ipeak(1) + integer ipeak(2) complex, allocatable :: c(:) !Work array real x(171) real, allocatable :: s(:,:) !Symbol spectra, stepped by NSTEP @@ -24,7 +24,7 @@ subroutine sfox_sync(iwave,fsample,isync,f,t) ia=nint((fsync-ftol)/df) ib=nint((fsync+ftol)/df) lagmax=1.0/dtstep - lag1=0 + lag1=-lagmax lag2=lagmax x=0. @@ -93,16 +93,24 @@ subroutine sfox_sync(iwave,fsample,isync,f,t) lagbest=lagpk endif enddo ! i - f=ibest*df + bw/2 - t=lagbest*dtstep -! write(*,4100) ibest,lagbest,f,t -!4100 format(2i6,f10.1,f10.3) + + ipeak=maxloc(ccf) + ipk=ipeak(1)-1+ia + jpk=ipeak(2)-1+lag1 + + call peakup(ccf(ipk-1,jpk),ccf(ipk,jpk),ccf(ipk+1,jpk),dxi) + call peakup(ccf(ipk,jpk-1),ccf(ipk,jpk),ccf(ipk,jpk+1),dxj) + + f=ibest*df + bw/2 + dxi*df + t=lagbest*dtstep + dxj*dtstep +! write(*,4100) ibest,lagbest,f,dxi*df,t,dxj*dtstep +!4100 format(2i6,2f10.1,2f10.3) ! print*,'aaa',ibest,lagbest - do lag=lag1,lag2 - write(51,3051) lag*dtstep,ccf(ibest,lag) -3051 format(2f12.4) - enddo +! do lag=lag1,lag2 +! write(51,3051) lag*dtstep,ccf(ibest,lag) +!3051 format(2f12.4) +! enddo return end subroutine sfox_sync diff --git a/lib/superfox/sfoxtest.f90 b/lib/superfox/sfoxtest.f90 index 052f1177c..15725f34f 100644 --- a/lib/superfox/sfoxtest.f90 +++ b/lib/superfox/sfoxtest.f90 @@ -169,7 +169,7 @@ program sfoxtest f1=f0 if(f0.eq.0.0) then f1=1500.0 + 20.0*(ran1(idum)-0.5) -! xdt=0.3*ran1(idum) + xdt=ran1(idum)-0.5 endif call timer('gen ',0) ! Generate cdat, the SuperFox waveform