mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-29 15:48:38 -05:00
56e3638bc5
displayed DT values appear to be to low by 0.2 s -- they range from -2.2 s to +4.8 s, according to files generated by jt65sim. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6179 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
49 lines
1.2 KiB
Fortran
49 lines
1.2 KiB
Fortran
subroutine ccf2(ss,nz,nflip,ccfbest,xlagpk)
|
|
|
|
parameter (LAGMIN=-86,LAGMAX=258)
|
|
real ss(nz)
|
|
real ccf(-LAGMAX:LAGMAX)
|
|
integer npr(126)
|
|
|
|
! The JT65 pseudo-random sync pattern:
|
|
data npr/ &
|
|
1,0,0,1,1,0,0,0,1,1,1,1,1,1,0,1,0,1,0,0, &
|
|
0,1,0,1,1,0,0,1,0,0,0,1,1,1,0,0,1,1,1,1, &
|
|
0,1,1,0,1,1,1,1,0,0,0,1,1,0,1,0,1,0,1,1, &
|
|
0,0,1,1,0,1,0,1,0,1,0,0,1,0,0,0,0,0,0,1, &
|
|
1,0,0,0,0,0,0,0,1,1,0,1,0,0,1,0,1,1,0,1, &
|
|
0,1,0,1,0,0,1,1,0,0,1,0,0,1,0,0,0,0,1,1, &
|
|
1,1,1,1,1,1/
|
|
save
|
|
|
|
ccfbest=0.
|
|
lag1=LAGMIN
|
|
lag2=LAGMAX
|
|
do lag=lag1,lag2
|
|
s0=0.
|
|
s1=0.
|
|
do i=1,126
|
|
j=16*(i-1)+1 + lag
|
|
if(j.ge.1 .and. j.le.nz-8) then
|
|
x=ss(j)
|
|
if(npr(i).eq.0) then
|
|
s0=s0 + x
|
|
else
|
|
s1=s1 + x
|
|
endif
|
|
endif
|
|
enddo
|
|
ccf(lag)=nflip*(s1-s0)
|
|
if(ccf(lag).gt.ccfbest) then
|
|
ccfbest=ccf(lag)
|
|
lagpk=lag
|
|
xlagpk=lagpk
|
|
endif
|
|
enddo
|
|
if( lagpk.gt.-LAGMAX .and. lagpk.lt.LAGMAX) then
|
|
call peakup(ccf(lagpk-1),ccf(lagpk),ccf(lagpk+1),dx)
|
|
xlagpk=lagpk+dx
|
|
endif
|
|
return
|
|
end subroutine ccf2
|