1
0
mirror of https://github.com/saitohirga/WSJT-X.git synced 2025-04-10 05:19:12 -04:00

Code cleanup after changing sync scheme.

This commit is contained in:
Joe Taylor 2024-02-22 14:25:17 -05:00
parent 0c03b9fc00
commit 523023fe65
3 changed files with 31 additions and 28 deletions

View File

@ -2,19 +2,20 @@ module sfox_mod
parameter (NMAX=15*12000) !Samples in iwave (180,000)
integer MM,NQ,NN,KK,ND1,ND2,NFZ,NSPS,NS,NSYNC,NZ,NFFT,NFFT1
integer isync(24)
integer isync(50)
contains
subroutine sfox_init(mm0,nn0,kk0,itu,fspread,delay,fsample)
character*2 itu
integer isps(50)
integer isps(54)
integer iloc(1)
data isps/1000,1008,1024,1029,1050,1080,1120,1125,1134,1152, &
1176,1200,1215,1225,1250,1260,1280,1296,1323,1344, &
1350,1372,1400,1440,1458,1470,1500,1512,1536,1568, &
1575,1600,1620,1680,1701,1715,1728,1750,1764,1792, &
1800,1875,1890,1920,1944,1960,2000,2016,2025,2048/
data isps/ 896, 960, 972, 980,1000,1008,1024,1029,1050,1080, &
1120,1125,1134,1152,1176,1200,1215,1225,1250,1260, &
1280,1296,1323,1344,1350,1372,1400,1440,1458,1470, &
1500,1512,1536,1568,1575,1600,1620,1680,1701,1715, &
1728,1750,1764,1792,1800,1875,1890,1920,1944,1960, &
2000,2016,2025,2048/
MM=mm0 !Bits per symbol
NQ=2**MM !Q, number of MFSK tones
@ -24,7 +25,7 @@ contains
ND2=NN-ND1 !Data symbols after sync
NFZ=3 !First zero
tsync=2.0
tsync=3.0
jsps=nint((12.8-tsync)*fsample/NN)
iloc=minloc(abs(isps-jsps))
NSPS=isps(iloc(1)) !Samples per symbol
@ -35,6 +36,7 @@ contains
NFFT=32768 !Length of FFT for sync waveform
NFFT1=2*NSPS !Length of FFTs for symbol spectra
print*,'AAA',NS,NSPS,NSYNC/12000.0
fspread=0.0
delay=0.0
if(itu.eq.'LQ') then

View File

@ -1,27 +1,30 @@
subroutine sfox_sync(crcvd,nv,f,t)
subroutine sfox_sync(crcvd,fsample,f,t)
use sfox_mod
parameter (NFFT2=2048,NH=NFFT2/2)
parameter (NSZ=562) !Number of 1/8-symbol steps
complex clo(NMAX) !Complex Local Oscillator
complex crcvd(NMAX) !Signal as received
complex c(0:NFFT2-1) !Work array
real s(NH/2,NSZ)
complex crcvd(NMAX) !Signal as received
complex, allocatable :: c(:) !Work array
real, allocatable :: s(:,:) !Symbol spectra, 1/8 symbol steps
! character*1 line(-30:30),mark(0:5)
! data mark/' ','.','-','+','X','$'/
df=12000.0/NFFT2 !5.86 Hz
istep=NH/8
tstep=istep/12000.0 !0.0107 s
nh=NFFT1/2 !1024
istep=nh/8 !128
nsz=(nint(3.0*fsample) + NS*NSPS)/istep !473
df=fsample/NFFT1 !5.86 Hz
tstep=istep/fsample !0.0107 s
allocate(c(0:nfft1-1))
allocate(s(nh/2,nsz))
ia=1-istep
fac=1.0/NFFT2
do j=1,NSZ
fac=1.0/NFFT1
do j=1,nsz
ia=ia+istep
ib=ia+NH-1
ib=ia+nh-1
c(0:NSPS-1)=fac*crcvd(ia:ib)
c(NSPS:)=0.
call four2a(c,NFFT2,1,-1,1)
do i=1,NH/2
call four2a(c,NFFT1,1,-1,1)
do i=1,nh/2
s(i,j)=real(c(i))**2 + aimag(c(i))**2
enddo
enddo
@ -32,7 +35,7 @@ subroutine sfox_sync(crcvd,nv,f,t)
i0=nint(1500.0/df)
ipk=-999
jpk=-999
do j=1,NSZ-8*NS
do j=1,nsz-8*NS
do i=-iz,iz
p=0.
do k=1,NS
@ -50,9 +53,7 @@ subroutine sfox_sync(crcvd,nv,f,t)
dfreq=ipk*df
f=1500.0+dfreq
t=(jpk-201)*128.0/12000.0
! write(*,4001) ipk,jpk,pmax,dfreq,t
!4001 format(2i8,3f10.3)
t=(jpk-201)*istep/fsample
return
end subroutine sfox_sync

View File

@ -178,7 +178,7 @@ program sfoxtest
else
! Find signal freq and DT
call timer('sync ',0)
call sfox_sync(crcvd,nv,f,t)
call sfox_sync(crcvd,fsample,f,t)
call timer('sync ',1)
endif
ferr=f-f1