mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-07-30 20:52:28 -04:00
Code cleanup after changing sync scheme.
This commit is contained in:
parent
0c03b9fc00
commit
523023fe65
@ -2,19 +2,20 @@ module sfox_mod
|
|||||||
|
|
||||||
parameter (NMAX=15*12000) !Samples in iwave (180,000)
|
parameter (NMAX=15*12000) !Samples in iwave (180,000)
|
||||||
integer MM,NQ,NN,KK,ND1,ND2,NFZ,NSPS,NS,NSYNC,NZ,NFFT,NFFT1
|
integer MM,NQ,NN,KK,ND1,ND2,NFZ,NSPS,NS,NSYNC,NZ,NFFT,NFFT1
|
||||||
integer isync(24)
|
integer isync(50)
|
||||||
|
|
||||||
contains
|
contains
|
||||||
subroutine sfox_init(mm0,nn0,kk0,itu,fspread,delay,fsample)
|
subroutine sfox_init(mm0,nn0,kk0,itu,fspread,delay,fsample)
|
||||||
|
|
||||||
character*2 itu
|
character*2 itu
|
||||||
integer isps(50)
|
integer isps(54)
|
||||||
integer iloc(1)
|
integer iloc(1)
|
||||||
data isps/1000,1008,1024,1029,1050,1080,1120,1125,1134,1152, &
|
data isps/ 896, 960, 972, 980,1000,1008,1024,1029,1050,1080, &
|
||||||
1176,1200,1215,1225,1250,1260,1280,1296,1323,1344, &
|
1120,1125,1134,1152,1176,1200,1215,1225,1250,1260, &
|
||||||
1350,1372,1400,1440,1458,1470,1500,1512,1536,1568, &
|
1280,1296,1323,1344,1350,1372,1400,1440,1458,1470, &
|
||||||
1575,1600,1620,1680,1701,1715,1728,1750,1764,1792, &
|
1500,1512,1536,1568,1575,1600,1620,1680,1701,1715, &
|
||||||
1800,1875,1890,1920,1944,1960,2000,2016,2025,2048/
|
1728,1750,1764,1792,1800,1875,1890,1920,1944,1960, &
|
||||||
|
2000,2016,2025,2048/
|
||||||
|
|
||||||
MM=mm0 !Bits per symbol
|
MM=mm0 !Bits per symbol
|
||||||
NQ=2**MM !Q, number of MFSK tones
|
NQ=2**MM !Q, number of MFSK tones
|
||||||
@ -24,7 +25,7 @@ contains
|
|||||||
ND2=NN-ND1 !Data symbols after sync
|
ND2=NN-ND1 !Data symbols after sync
|
||||||
NFZ=3 !First zero
|
NFZ=3 !First zero
|
||||||
|
|
||||||
tsync=2.0
|
tsync=3.0
|
||||||
jsps=nint((12.8-tsync)*fsample/NN)
|
jsps=nint((12.8-tsync)*fsample/NN)
|
||||||
iloc=minloc(abs(isps-jsps))
|
iloc=minloc(abs(isps-jsps))
|
||||||
NSPS=isps(iloc(1)) !Samples per symbol
|
NSPS=isps(iloc(1)) !Samples per symbol
|
||||||
@ -35,6 +36,7 @@ contains
|
|||||||
NFFT=32768 !Length of FFT for sync waveform
|
NFFT=32768 !Length of FFT for sync waveform
|
||||||
NFFT1=2*NSPS !Length of FFTs for symbol spectra
|
NFFT1=2*NSPS !Length of FFTs for symbol spectra
|
||||||
|
|
||||||
|
print*,'AAA',NS,NSPS,NSYNC/12000.0
|
||||||
fspread=0.0
|
fspread=0.0
|
||||||
delay=0.0
|
delay=0.0
|
||||||
if(itu.eq.'LQ') then
|
if(itu.eq.'LQ') then
|
||||||
|
@ -1,27 +1,30 @@
|
|||||||
subroutine sfox_sync(crcvd,nv,f,t)
|
subroutine sfox_sync(crcvd,fsample,f,t)
|
||||||
|
|
||||||
use sfox_mod
|
use sfox_mod
|
||||||
parameter (NFFT2=2048,NH=NFFT2/2)
|
complex crcvd(NMAX) !Signal as received
|
||||||
parameter (NSZ=562) !Number of 1/8-symbol steps
|
complex, allocatable :: c(:) !Work array
|
||||||
complex clo(NMAX) !Complex Local Oscillator
|
real, allocatable :: s(:,:) !Symbol spectra, 1/8 symbol steps
|
||||||
complex crcvd(NMAX) !Signal as received
|
|
||||||
complex c(0:NFFT2-1) !Work array
|
|
||||||
real s(NH/2,NSZ)
|
|
||||||
! character*1 line(-30:30),mark(0:5)
|
! character*1 line(-30:30),mark(0:5)
|
||||||
! data mark/' ','.','-','+','X','$'/
|
! data mark/' ','.','-','+','X','$'/
|
||||||
|
|
||||||
df=12000.0/NFFT2 !5.86 Hz
|
nh=NFFT1/2 !1024
|
||||||
istep=NH/8
|
istep=nh/8 !128
|
||||||
tstep=istep/12000.0 !0.0107 s
|
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
|
ia=1-istep
|
||||||
fac=1.0/NFFT2
|
fac=1.0/NFFT1
|
||||||
do j=1,NSZ
|
do j=1,nsz
|
||||||
ia=ia+istep
|
ia=ia+istep
|
||||||
ib=ia+NH-1
|
ib=ia+nh-1
|
||||||
c(0:NSPS-1)=fac*crcvd(ia:ib)
|
c(0:NSPS-1)=fac*crcvd(ia:ib)
|
||||||
c(NSPS:)=0.
|
c(NSPS:)=0.
|
||||||
call four2a(c,NFFT2,1,-1,1)
|
call four2a(c,NFFT1,1,-1,1)
|
||||||
do i=1,NH/2
|
do i=1,nh/2
|
||||||
s(i,j)=real(c(i))**2 + aimag(c(i))**2
|
s(i,j)=real(c(i))**2 + aimag(c(i))**2
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
@ -32,7 +35,7 @@ subroutine sfox_sync(crcvd,nv,f,t)
|
|||||||
i0=nint(1500.0/df)
|
i0=nint(1500.0/df)
|
||||||
ipk=-999
|
ipk=-999
|
||||||
jpk=-999
|
jpk=-999
|
||||||
do j=1,NSZ-8*NS
|
do j=1,nsz-8*NS
|
||||||
do i=-iz,iz
|
do i=-iz,iz
|
||||||
p=0.
|
p=0.
|
||||||
do k=1,NS
|
do k=1,NS
|
||||||
@ -50,9 +53,7 @@ subroutine sfox_sync(crcvd,nv,f,t)
|
|||||||
|
|
||||||
dfreq=ipk*df
|
dfreq=ipk*df
|
||||||
f=1500.0+dfreq
|
f=1500.0+dfreq
|
||||||
t=(jpk-201)*128.0/12000.0
|
t=(jpk-201)*istep/fsample
|
||||||
! write(*,4001) ipk,jpk,pmax,dfreq,t
|
|
||||||
!4001 format(2i8,3f10.3)
|
|
||||||
|
|
||||||
return
|
return
|
||||||
end subroutine sfox_sync
|
end subroutine sfox_sync
|
||||||
|
@ -178,7 +178,7 @@ program sfoxtest
|
|||||||
else
|
else
|
||||||
! Find signal freq and DT
|
! Find signal freq and DT
|
||||||
call timer('sync ',0)
|
call timer('sync ',0)
|
||||||
call sfox_sync(crcvd,nv,f,t)
|
call sfox_sync(crcvd,fsample,f,t)
|
||||||
call timer('sync ',1)
|
call timer('sync ',1)
|
||||||
endif
|
endif
|
||||||
ferr=f-f1
|
ferr=f-f1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user