mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-09-03 13:47:51 -04:00
More work on msk144 decoder.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6738 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
30cb728d5b
commit
5935bdc0dc
@ -62,7 +62,8 @@ subroutine mskdt(d,npts,ty,yellow,nyel)
|
|||||||
do j=2,nyel
|
do j=2,nyel
|
||||||
ok=.true.
|
ok=.true.
|
||||||
do i=1,j-1
|
do i=1,j-1
|
||||||
if(abs(ty(i)-ty(j)).lt.0.117) ok=.false.
|
! if(abs(ty(i)-ty(j)).lt.0.117) ok=.false.
|
||||||
|
if(abs(ty(i)-ty(j)).lt.0.072) ok=.false. ! does this break jtmsk?
|
||||||
enddo
|
enddo
|
||||||
if(ok) then
|
if(ok) then
|
||||||
k=k+1
|
k=k+1
|
||||||
|
@ -41,7 +41,7 @@ subroutine syncmsk144(cdat,npts,msgreceived,fest)
|
|||||||
|
|
||||||
data s8/0,1,1,1,0,0,1,0/
|
data s8/0,1,1,1,0,0,1,0/
|
||||||
save first,cb,pi,twopi,dt,f0,f1
|
save first,cb,pi,twopi,dt,f0,f1
|
||||||
! save
|
|
||||||
if(first) then
|
if(first) then
|
||||||
! These files can be found in /lib/ldpc/jtmode_codes directory
|
! These files can be found in /lib/ldpc/jtmode_codes directory
|
||||||
pchk_file="peg-128-80-reg3.pchk"
|
pchk_file="peg-128-80-reg3.pchk"
|
||||||
@ -88,35 +88,28 @@ subroutine syncmsk144(cdat,npts,msgreceived,fest)
|
|||||||
|
|
||||||
ismask=.false.
|
ismask=.false.
|
||||||
ismask(1901:2101)=.true. ! high tone search window
|
ismask(1901:2101)=.true. ! high tone search window
|
||||||
! ismask(1801:2201)=.true. ! high tone search window
|
|
||||||
iloc=maxloc(tonespec,ismask)
|
iloc=maxloc(tonespec,ismask)
|
||||||
ihpk=iloc(1)
|
ihpk=iloc(1)
|
||||||
ah=tonespec(ihpk)
|
ah=tonespec(ihpk)
|
||||||
ismask=.false.
|
ismask=.false.
|
||||||
ismask(901:1101)=.true. ! window for low tone
|
ismask(901:1101)=.true. ! window for low tone
|
||||||
! ismask(801:1201)=.true. ! window for low tone
|
|
||||||
iloc=maxloc(tonespec,ismask)
|
iloc=maxloc(tonespec,ismask)
|
||||||
ilpk=iloc(1)
|
ilpk=iloc(1)
|
||||||
al=tonespec(ilpk)
|
al=tonespec(ilpk)
|
||||||
fdiff=(ihpk-ilpk)*df
|
fdiff=(ihpk-ilpk)*df
|
||||||
ferrh=(ihpk-2001)*df/2.0
|
ferrh=(ihpk-2001)*df/2.0
|
||||||
ferrl=(ilpk-1001)*df/2.0
|
ferrl=(ilpk-1001)*df/2.0
|
||||||
if( abs(fdiff-2000) .le. 8.0 ) then ! we are pretty sure we've got the right peaks
|
if( abs(fdiff-2000) .le. 16.0 ) then
|
||||||
if( ah .ge. al ) then
|
if( ah .ge. al ) then
|
||||||
ferr=ferrh
|
ferr=ferrh
|
||||||
else
|
else
|
||||||
ferr=ferrl
|
ferr=ferrl
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
! if fdiff is not 2000, then carrier acquisition is on shaky ground
|
msgreceived=' '
|
||||||
! in this case, ignore amplitude and pick the peak that has the smallest ferr
|
goto 999
|
||||||
if( abs(ihpk-2001) .le. abs(ilpk-1001) ) then
|
endif
|
||||||
ferr=ferrh
|
|
||||||
else
|
|
||||||
ferr=ferrl
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
! remove coarse freq error - should now be within a few Hz
|
! remove coarse freq error - should now be within a few Hz
|
||||||
call tweak1(cdat,npts,-(1500+ferr),cdat)
|
call tweak1(cdat,npts,-(1500+ferr),cdat)
|
||||||
|
|
||||||
@ -148,12 +141,12 @@ subroutine syncmsk144(cdat,npts,msgreceived,fest)
|
|||||||
do ii=1,5
|
do ii=1,5
|
||||||
do jj=ii+1,5
|
do jj=ii+1,5
|
||||||
if( (ii .ne. jj) .and. (abs( abs(ipeaks(ii)-ipeaks(jj))-864) .le. 5) ) then
|
if( (ii .ne. jj) .and. (abs( abs(ipeaks(ii)-ipeaks(jj))-864) .le. 5) ) then
|
||||||
! write(78,*) "closed brackets: ",ii,jj,ipeaks(ii),ipeaks(jj),abs(ipeaks(ii)-ipeaks(jj))
|
! write(*,*) "closed brackets: ",ii,jj,ipeaks(ii),ipeaks(jj),abs(ipeaks(ii)-ipeaks(jj))
|
||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
do iav=1,3
|
do iav=1,6
|
||||||
do ipk=1,5
|
do ipk=1,5
|
||||||
do id=1,3
|
do id=1,3
|
||||||
if( id .eq. 1 ) is=0
|
if( id .eq. 1 ) is=0
|
||||||
@ -175,6 +168,7 @@ subroutine syncmsk144(cdat,npts,msgreceived,fest)
|
|||||||
enddo
|
enddo
|
||||||
iloc=maxloc(abs(bb))
|
iloc=maxloc(abs(bb))
|
||||||
ibb=iloc(1)
|
ibb=iloc(1)
|
||||||
|
|
||||||
! Adjust frame index to place peak of bb at desired lag
|
! Adjust frame index to place peak of bb at desired lag
|
||||||
ic=ic + ibb-2+is
|
ic=ic + ibb-2+is
|
||||||
if( ic .le. 864 ) ic=ic+864
|
if( ic .le. 864 ) ic=ic+864
|
||||||
@ -198,19 +192,25 @@ subroutine syncmsk144(cdat,npts,msgreceived,fest)
|
|||||||
|
|
||||||
! Final estimate of the carrier frequency - returned to the calling program
|
! Final estimate of the carrier frequency - returned to the calling program
|
||||||
fest=1500+ferr+ferr2
|
fest=1500+ferr+ferr2
|
||||||
|
|
||||||
! Remove fine frequency error
|
! Remove fine frequency error
|
||||||
call tweak1(cdat,npts,-ferr2,cdat2)
|
call tweak1(cdat,npts,-ferr2,cdat2)
|
||||||
|
|
||||||
! place the beginning of the central frame at NSPM+1
|
! place the beginning of the central frame at NSPM+1
|
||||||
cdat2=cshift(cdat2,ic-865)
|
cdat2=cshift(cdat2,ic-865)
|
||||||
|
|
||||||
! Do frame averaging on passes 2 and 3
|
! Try each of the three frames individually, and then
|
||||||
|
! do frame averaging on passes 4 and 5
|
||||||
if( iav .eq. 1 ) then
|
if( iav .eq. 1 ) then
|
||||||
c=cdat2(NSPM+1:2*NSPM)
|
c=cdat2(NSPM+1:2*NSPM)
|
||||||
elseif( iav .eq. 2 ) then
|
elseif( iav .eq. 2 ) then
|
||||||
c=cdat2(NSPM+1:2*NSPM)+cdat2(2*NSPM+1:npts)
|
c=cdat2(2*NSPM+1:npts)
|
||||||
elseif( iav .eq. 3 ) then
|
elseif( iav .eq. 3 ) then
|
||||||
|
c=cdat2(1:NSPM)
|
||||||
|
elseif( iav .eq. 4 ) then
|
||||||
|
c=cdat2(1:NSPM)+cdat2(NSPM+1:2*NSPM)
|
||||||
|
elseif( iav .eq. 5 ) then
|
||||||
|
c=cdat2(NSPM+1:2*NSPM)+cdat2(2*NSPM+1:npts)
|
||||||
|
elseif( iav .eq. 6 ) then
|
||||||
c=cdat2(1:NSPM)+cdat2(NSPM+1:2*NSPM)+cdat2(2*NSPM+1:npts)
|
c=cdat2(1:NSPM)+cdat2(NSPM+1:2*NSPM)+cdat2(2*NSPM+1:npts)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -269,10 +269,6 @@ subroutine syncmsk144(cdat,npts,msgreceived,fest)
|
|||||||
max_dither=100
|
max_dither=100
|
||||||
call ldpc_decode(unscrambledsoftbits, decoded, max_iterations, niterations, max_dither, ndither)
|
call ldpc_decode(unscrambledsoftbits, decoded, max_iterations, niterations, max_dither, ndither)
|
||||||
|
|
||||||
! if( niterations .lt. 0 ) then
|
|
||||||
! msgreceived=' '
|
|
||||||
! return
|
|
||||||
! endif
|
|
||||||
if( niterations .ge. 0.0 ) then
|
if( niterations .ge. 0.0 ) then
|
||||||
goto 778
|
goto 778
|
||||||
endif
|
endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user