add cshift to ft8_downsample and sync8

This commit is contained in:
Pavel Demin 2018-10-13 21:45:41 +02:00
parent ab3fe4b93d
commit f9e209f399
2 changed files with 10 additions and 14 deletions

View File

@ -16,21 +16,17 @@ subroutine ft8_downsample(dd,newdat,f0,c1)
! Data in dd have changed, recompute the long FFT ! Data in dd have changed, recompute the long FFT
x(1:NMAX)=dd x(1:NMAX)=dd
x(NMAX+1:NFFT1)=0. !Zero-pad the x array 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. newdat=.false.
endif endif
if(f0.lt.2000.0) then
f=f0+2000.0
else
f=f0-2000.0
endif
df=4000.0/NFFT1 df=4000.0/NFFT1
baud=4000.0/NSPS baud=4000.0/NSPS
i0=nint(f/df) i0=nint(f0/df)
ft=f+8.0*baud ft=f0+8.0*baud
it=min(nint(ft/df),NFFT1) it=min(nint(ft/df),NFFT1)
fb=f-1.0*baud fb=f0-1.0*baud
ib=max(1,nint(fb/df)) ib=max(1,nint(fb/df))
k=0 k=0
c1=0. c1=0.

View File

@ -3,7 +3,7 @@ subroutine sync8(dd,nfa,nfb,syncmin,nfqso,s,candidate,ncand,sbase)
include 'ft8_params.f90' include 'ft8_params.f90'
! Search over +/- 2.5s relative to 0.5s TX start time. ! Search over +/- 2.5s relative to 0.5s TX start time.
parameter (JZ=62) parameter (JZ=62)
complex cx(NFFT1) complex cx(0:NFFT1)
real s(NFFT1,NHSYM) real s(NFFT1,NHSYM)
real savg(NFFT1) real savg(NFFT1)
real sbase(NFFT1) real sbase(NFFT1)
@ -19,6 +19,7 @@ subroutine sync8(dd,nfa,nfb,syncmin,nfqso,s,candidate,ncand,sbase)
integer icos7(0:6) integer icos7(0:6)
data icos7/2,5,6,0,4,1,3/ !Costas 7x7 tone pattern data icos7/2,5,6,0,4,1,3/ !Costas 7x7 tone pattern
equivalence (x,cx) equivalence (x,cx)
save cx
! Compute symbol spectra, stepping by NSTEP steps. ! Compute symbol spectra, stepping by NSTEP steps.
savg=0. 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(1:NSPS)=fac*dd(ia:ib)
x(NSPS+1:)=0. x(NSPS+1:)=0.
call four2a(x,NFFT1,1,-1,1) !c2c FFT call four2a(x,NFFT1,1,-1,1) !c2c FFT
do i=2,NH1 x=cshift(x,NFFT1/2)
s(i-1,j)=real(cx(i+NH1))**2 + aimag(cx(i+NH1))**2 do i=1,NFFT1
s(i-1+NH1,j)=real(cx(i))**2 + aimag(cx(i))**2 s(i,j)=real(cx(i))**2 + aimag(cx(i))**2
enddo enddo
s(NH1,j)=real(cx(1))**2 + aimag(cx(1))**2
savg=savg + s(1:NFFT1,j) !Average spectrum savg=savg + s(1:NFFT1,j) !Average spectrum
enddo enddo
call baseline(savg,nfa,nfb,sbase) call baseline(savg,nfa,nfb,sbase)