mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-08-09 01:12:27 -04:00
Tweak coarse frequency acquisition.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6731 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
31d393cd45
commit
6c50362ccc
@ -73,7 +73,7 @@ subroutine syncmsk144(cdat,npts,msgreceived,fest)
|
|||||||
|
|
||||||
! Coarse carrier frequency sync
|
! Coarse carrier frequency sync
|
||||||
! look for tones near 2k and 4k in the (analytic signal)**2 spectrum
|
! look for tones near 2k and 4k in the (analytic signal)**2 spectrum
|
||||||
! search range for coarse frequency error is +/- 200 Hz
|
! search range for coarse frequency error is +/- 100 Hz
|
||||||
fs=12000.0
|
fs=12000.0
|
||||||
nfft=6000 !using a zero-padded fft to get 2 Hz bins
|
nfft=6000 !using a zero-padded fft to get 2 Hz bins
|
||||||
df=fs/nfft
|
df=fs/nfft
|
||||||
@ -97,16 +97,24 @@ subroutine syncmsk144(cdat,npts,msgreceived,fest)
|
|||||||
iloc=maxloc(tonespec,ismask)
|
iloc=maxloc(tonespec,ismask)
|
||||||
ilpk=iloc(1)
|
ilpk=iloc(1)
|
||||||
al=tonespec(ilpk)
|
al=tonespec(ilpk)
|
||||||
if( ah .ge. al ) then
|
|
||||||
ferr=(ihpk-2001)*df/2.0
|
|
||||||
tot=sum(tonespec(1901:2101))
|
|
||||||
q1=200*ah/(tot-tonespec(ihpk))
|
|
||||||
else
|
|
||||||
ferr=(ilpk-1001)*df/2.0
|
|
||||||
tot=sum(tonespec(901:1101))
|
|
||||||
q1=200*al/(tot-tonespec(ilpk))
|
|
||||||
endif
|
|
||||||
fdiff=(ihpk-ilpk)*df
|
fdiff=(ihpk-ilpk)*df
|
||||||
|
ferrh=(ihpk-2001)*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( ah .ge. al ) then
|
||||||
|
ferr=ferrh
|
||||||
|
else
|
||||||
|
ferr=ferrl
|
||||||
|
endif
|
||||||
|
else
|
||||||
|
! if fdiff is not 2000, then carrier acquisition is on shaky ground
|
||||||
|
! in this case, ignore amplitude and pick the peak that has the smallest ferr
|
||||||
|
if( abs(ihpk-2001) .le. abs(ilpk-1001) ) then
|
||||||
|
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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user