diff --git a/lib/fst240/genfst240.f90 b/lib/fst240/genfst240.f90 index b442b3efa..f60dc8446 100644 --- a/lib/fst240/genfst240.f90 +++ b/lib/fst240/genfst240.f90 @@ -20,10 +20,11 @@ subroutine genfst240(msg0,ichk,msgsent,msgbits,i4tone,iwspr) integer*4 i4tone(NN),itmp(ND) integer*1 codeword(2*ND) integer*1 msgbits(101),rvec(77) - integer isyncword(8) + integer isyncword1(8),isyncword2(8) integer ncrc24 logical unpk77_success - data isyncword/0,1,3,2,1,0,2,3/ + data isyncword1/0,1,3,2,1,0,2,3/ + data isyncword2/2,3,1,0,3,2,0,1/ data rvec/0,1,0,0,1,0,1,0,0,1,0,1,1,1,1,0,1,0,0,0,1,0,0,1,1,0,1,1,0, & 1,0,0,1,0,1,1,0,0,0,0,1,0,0,0,1,0,1,0,0,1,1,1,1,0,0,1,0,1, & 0,1,0,1,0,1,1,0,1,1,1,1,1,0,0,0,1,0,1/ @@ -86,15 +87,15 @@ subroutine genfst240(msg0,ichk,msgsent,msgbits,i4tone,iwspr) if(is.eq.3) itmp(i)=2 enddo - i4tone( 1: 8)=isyncword + i4tone( 1: 8)=isyncword1 i4tone( 9: 38)=itmp( 1: 30) - i4tone( 39: 46)=isyncword + i4tone( 39: 46)=isyncword2 i4tone( 47: 76)=itmp( 31: 60) - i4tone( 77: 84)=isyncword + i4tone( 77: 84)=isyncword1 i4tone( 85:114)=itmp( 61: 90) - i4tone(115:122)=isyncword + i4tone(115:122)=isyncword2 i4tone(123:152)=itmp( 91:120) - i4tone(153:160)=isyncword + i4tone(153:160)=isyncword1 999 return diff --git a/lib/fst240/get_fst240_bitmetrics.f90 b/lib/fst240/get_fst240_bitmetrics.f90 index 491158264..60804cba7 100644 --- a/lib/fst240/get_fst240_bitmetrics.f90 +++ b/lib/fst240/get_fst240_bitmetrics.f90 @@ -7,7 +7,7 @@ subroutine get_fst240_bitmetrics(cd,nss,hmod,nmax,bitmetrics,s4,badsync) complex, allocatable, save :: c1(:,:) ! ideal waveforms, 20 samples per symbol, 4 tones complex cp(0:3) ! accumulated phase shift over symbol types 0:3 complex csum,cterm - integer icos8(0:7) + integer isyncword1(0:7),isyncword2(0:7) integer graymap(0:3) integer ip(1) integer hmod @@ -17,7 +17,8 @@ subroutine get_fst240_bitmetrics(cd,nss,hmod,nmax,bitmetrics,s4,badsync) real bitmetrics(2*NN,4) real s2(0:65535) real s4(0:3,NN) - data icos8/0,1,3,2,1,0,2,3/ + data isyncword1/0,1,3,2,1,0,2,3/ + data isyncword2/2,3,1,0,3,2,0,1/ data graymap/0,1,3,2/ data first/.true./,nss0/-1/ save first,one,cp,nss0 @@ -65,15 +66,15 @@ subroutine get_fst240_bitmetrics(cd,nss,hmod,nmax,bitmetrics,s4,badsync) do k=1,8 ip=maxloc(s4(:,k)) - if(icos8(k-1).eq.(ip(1)-1)) is1=is1+1 + if(isyncword1(k-1).eq.(ip(1)-1)) is1=is1+1 ip=maxloc(s4(:,k+38)) - if(icos8(k-1).eq.(ip(1)-1)) is2=is2+1 + if(isyncword2(k-1).eq.(ip(1)-1)) is2=is2+1 ip=maxloc(s4(:,k+76)) - if(icos8(k-1).eq.(ip(1)-1)) is3=is3+1 + if(isyncword1(k-1).eq.(ip(1)-1)) is3=is3+1 ip=maxloc(s4(:,k+114)) - if(icos8(k-1).eq.(ip(1)-1)) is4=is4+1 + if(isyncword2(k-1).eq.(ip(1)-1)) is4=is4+1 ip=maxloc(s4(:,k+152)) - if(icos8(k-1).eq.(ip(1)-1)) is5=is5+1 + if(isyncword1(k-1).eq.(ip(1)-1)) is5=is5+1 enddo nsync=is1+is2+is3+is4+is5 !Number of correct hard sync symbols, 0-40 badsync=.false. diff --git a/lib/fst240_decode.f90 b/lib/fst240_decode.f90 index a0ad0591e..4fded52ae 100644 --- a/lib/fst240_decode.f90 +++ b/lib/fst240_decode.f90 @@ -270,6 +270,7 @@ contains fc_synced=candidates(icand,3) isbest=nint(candidates(icand,4)) xdt=(isbest-nspsec)/fs2 + if(ntrperiod.eq.15) xdt=(isbest-real(nspsec)/2.0)/fs2 call fst240_downsample(c_bigfft,nfft1,ndown,fc_synced,sigbw,c2) do ijitter=0,jittermax @@ -286,9 +287,9 @@ contains hbits=0 where(bitmetrics(:,1).ge.0) hbits=1 ns1=count(hbits( 1: 16).eq.(/0,0,0,1,1,0,1,1,0,1,0,0,1,1,1,0/)) - ns2=count(hbits( 77: 92).eq.(/0,0,0,1,1,0,1,1,0,1,0,0,1,1,1,0/)) + ns2=count(hbits( 77: 92).eq.(/1,1,1,0,0,1,0,0,1,0,1,1,0,0,0,1/)) ns3=count(hbits(153:168).eq.(/0,0,0,1,1,0,1,1,0,1,0,0,1,1,1,0/)) - ns4=count(hbits(229:244).eq.(/0,0,0,1,1,0,1,1,0,1,0,0,1,1,1,0/)) + ns4=count(hbits(229:244).eq.(/1,1,1,0,0,1,0,0,1,0,1,1,0,0,0,1/)) ns5=count(hbits(305:320).eq.(/0,0,0,1,1,0,1,1,0,1,0,0,1,1,1,0/)) nsync_qual=ns1+ns2+ns3+ns4+ns5 if(nsync_qual.lt. 44) cycle !### Value ?? ###