File: sync9f.f90

package info (click to toggle)
wsjtx 2.7.0%2Brepack-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 70,440 kB
  • sloc: cpp: 75,379; f90: 46,460; python: 27,241; ansic: 13,367; fortran: 2,382; makefile: 197; sh: 133
file content (55 lines) | stat: -rwxr-xr-x 1,060 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
subroutine sync9f(s2,nq,nfa,nfb,ss2,ss3,lagpk,ipk,ccfbest)

! Look for JT9 sync pattern in the folded symbol spectra, s2.
! Frequency search extends from nfa to nfb.  Synchronized symbol
! spectra are put into ss2() and ss3().

  integer ii4(16)
  real s2(240,340)
  real ss2(0:8,85)
  real ss3(0:7,69)
  include 'jt9sync.f90'

  ii4=4*ii-3
  ccf=0.
  ccfbest=0.
  nfft=4*nq
  df=12000.0/nfft
  ia=nfa/df
  ib=nfb/df + 0.9999

  do i=ia,ib
     do lag=0,339
        t=0.
        do n=1,16
           j=ii4(n)+lag
           if(j.gt.340) j=j-340
           t=t + s2(i,j)
        enddo
        if(t.gt.ccfbest) then
           lagpk=lag
           ipk=i
           ccfbest=t
        endif
     enddo
  enddo

  do i=0,8
     j4=lagpk-4
     i2=2*i + ipk
     if(i2.lt.1) i2=1
     m=0
     do j=1,85
        j4=j4+4
        if(j4.gt.340) j4=j4-340
        if(j4.lt.1) j4=j4+340
        ss2(i,j)=s2(i2,j4)
        if(i.ge.1 .and. isync(j).eq.0) then
           m=m+1
           ss3(i-1,m)=ss2(i,j)
        endif
     enddo
  enddo

  return
end subroutine sync9f