mirror of
https://github.com/pavel-demin/ft8d.git
synced 2024-11-23 21:08:36 -05:00
add cshift to ft8_downsample and sync8
This commit is contained in:
parent
ab3fe4b93d
commit
f9e209f399
@ -16,21 +16,17 @@ subroutine ft8_downsample(dd,newdat,f0,c1)
|
||||
! Data in dd have changed, recompute the long FFT
|
||||
x(1:NMAX)=dd
|
||||
x(NMAX+1:NFFT1)=0. !Zero-pad the x array
|
||||
call four2a(cx,NFFT1,1,-1,1) !c2c FFT to freq domain
|
||||
call four2a(x,NFFT1,1,-1,1) !c2c FFT to freq domain
|
||||
x=cshift(x,NFFT1/2)
|
||||
newdat=.false.
|
||||
endif
|
||||
|
||||
if(f0.lt.2000.0) then
|
||||
f=f0+2000.0
|
||||
else
|
||||
f=f0-2000.0
|
||||
endif
|
||||
df=4000.0/NFFT1
|
||||
baud=4000.0/NSPS
|
||||
i0=nint(f/df)
|
||||
ft=f+8.0*baud
|
||||
i0=nint(f0/df)
|
||||
ft=f0+8.0*baud
|
||||
it=min(nint(ft/df),NFFT1)
|
||||
fb=f-1.0*baud
|
||||
fb=f0-1.0*baud
|
||||
ib=max(1,nint(fb/df))
|
||||
k=0
|
||||
c1=0.
|
||||
|
10
sync8.f90
10
sync8.f90
@ -3,7 +3,7 @@ subroutine sync8(dd,nfa,nfb,syncmin,nfqso,s,candidate,ncand,sbase)
|
||||
include 'ft8_params.f90'
|
||||
! Search over +/- 2.5s relative to 0.5s TX start time.
|
||||
parameter (JZ=62)
|
||||
complex cx(NFFT1)
|
||||
complex cx(0:NFFT1)
|
||||
real s(NFFT1,NHSYM)
|
||||
real savg(NFFT1)
|
||||
real sbase(NFFT1)
|
||||
@ -19,6 +19,7 @@ subroutine sync8(dd,nfa,nfb,syncmin,nfqso,s,candidate,ncand,sbase)
|
||||
integer icos7(0:6)
|
||||
data icos7/2,5,6,0,4,1,3/ !Costas 7x7 tone pattern
|
||||
equivalence (x,cx)
|
||||
save cx
|
||||
|
||||
! Compute symbol spectra, stepping by NSTEP steps.
|
||||
savg=0.
|
||||
@ -31,11 +32,10 @@ subroutine sync8(dd,nfa,nfb,syncmin,nfqso,s,candidate,ncand,sbase)
|
||||
x(1:NSPS)=fac*dd(ia:ib)
|
||||
x(NSPS+1:)=0.
|
||||
call four2a(x,NFFT1,1,-1,1) !c2c FFT
|
||||
do i=2,NH1
|
||||
s(i-1,j)=real(cx(i+NH1))**2 + aimag(cx(i+NH1))**2
|
||||
s(i-1+NH1,j)=real(cx(i))**2 + aimag(cx(i))**2
|
||||
x=cshift(x,NFFT1/2)
|
||||
do i=1,NFFT1
|
||||
s(i,j)=real(cx(i))**2 + aimag(cx(i))**2
|
||||
enddo
|
||||
s(NH1,j)=real(cx(1))**2 + aimag(cx(1))**2
|
||||
savg=savg + s(1:NFFT1,j) !Average spectrum
|
||||
enddo
|
||||
call baseline(savg,nfa,nfb,sbase)
|
||||
|
Loading…
Reference in New Issue
Block a user