Improve AFC action for JT65, especially submodes B and C.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@8599 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2018-04-02 17:24:18 +00:00
parent 62eabce723
commit 6d70acef57
2 changed files with 12 additions and 9 deletions

View File

@ -1,4 +1,4 @@
subroutine afc65b(cx,npts,fsample,nflip,a,ccfbest,dtbest)
subroutine afc65b(cx,npts,fsample,nflip,mode65,a,ccfbest,dtbest)
! Find delta f, f1, f2 ==> a(1:3)
@ -9,15 +9,15 @@ subroutine afc65b(cx,npts,fsample,nflip,a,ccfbest,dtbest)
a(2)=0.
a(3)=0.
a(4)=0.
deltaa(1)=2.0
deltaa(2)=2.0
deltaa(1)=2.0*mode65
deltaa(2)=2.0*mode65
deltaa(3)=1.0
nterms=2 !Maybe 2 is enough?
! Start the iteration
chisqr=0.
chisqr0=1.e6
do iter=1,3 !One iteration is enough?
do iter=1,100 !How many iters is enough?
do j=1,nterms
chisq1=fchisq65(cx,npts,fsample,nflip,a,ccfmax,dtmax)
fn=0.
@ -45,13 +45,16 @@ subroutine afc65b(cx,npts,fsample,nflip,a,ccfbest,dtbest)
delta=delta*(1./(1.+(chisq1-chisq2)/(chisq3-chisq2))+0.5)
a(j)=a(j)-delta
deltaa(j)=deltaa(j)*fn/3.
! write(*,4000) iter,j,a(1:2),-chisq2
!4000 format(2i2,4f9.4)
enddo
chisqr=fchisq65(cx,npts,fsample,nflip,a,ccfmax,dtmax)
if(chisqr/chisqr0.gt.0.9999) go to 30
fdiff=chisqr/chisqr0-1.0
! write(*,4000) 0,0,a(1:2),-chisqr,fdiff
if(abs(fdiff).lt.0.0001) exit
chisqr0=chisqr
enddo
30 ccfbest=ccfmax * (1378.125/fsample)**2
ccfbest=ccfmax * (1378.125/fsample)**2
dtbest=dtmax
return

View File

@ -49,9 +49,9 @@ subroutine decode65a(dd,npts,newdat,nqd,f0,nflip,mode65,ntrials, &
fsample=1378.125/4.
call timer('afc65b ',0)
! Best fit for DF, drift, banana-coefficient, and dt. fsample = 344.53125 S/s
! Best fit for DF, drift, and dt. fsample = 344.53125 S/s
dtbest=dt
call afc65b(c5x,n6,fsample,nflip,a,ccfbest,dtbest)
call afc65b(c5x,n6,fsample,nflip,mode65,a,ccfbest,dtbest)
call timer('afc65b ',1)
dtbest=dtbest+0.003628 !Remove decimation filter and coh. integrator delay
dt=dtbest !Return new, improved estimate of dt