Correct the FT8 downsample factor to be exactly 1/64.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7779 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2017-07-03 19:01:38 +00:00
parent e1b2bdef06
commit 4bce86d61e
2 changed files with 17 additions and 11 deletions

View File

@ -13,7 +13,7 @@ subroutine ft8b(dd0,nfqso,f1,xdt,nharderrors,dmin,nbadcrc,message,xsnr)
integer*1 decoded(KK),apmask(3*ND),cw(3*ND)
integer itone(NN)
integer icos7(0:6)
complex cd0(NP2)
complex cd0(3125)
complex csync(0:6,32)
complex ctwk(32)
complex csymb(32)
@ -193,30 +193,34 @@ subroutine ft8_downsample(dd,f0,c1)
! Downconvert to complex data sampled at 187.5 Hz, 32 samples/symbol
parameter (NMAX=15*12000,NFFT2=2812)
parameter (NMAX=15*12000)
parameter (NFFT1=200000,NFFT2=3125) !200000/64 = 3125
complex c1(0:NFFT2-1)
complex cx(0:NMAX/2)
real dd(NMAX),x(NMAX)
complex cx(0:NFFT1/2)
real dd(NMAX),x(NFFT1)
equivalence (x,cx)
save x
df=12000.0/NMAX
x=dd
call four2a(cx,NMAX,1,-1,0) !r2c FFT to freq domain
baud=12000.0/(32.0*64.0)
df=12000.0/NFFT1
x(1:NMAX)=dd
x(NMAX+1:NFFT1)=0. !Zero-pad the x array
call four2a(cx,NFFT1,1,-1,0) !r2c FFT to freq domain
baud=12000.0/2048.0
i0=nint(f0/df)
ft=f0+8.0*baud
it=min(nint(ft/df),NMAX/2-1)
it=min(nint(ft/df),NFFT1/2)
fb=f0-1.0*baud
ib=max(1,nint(fb/df))
k=0
c1=cmplx(0.0,0.0)
c1=0.
do i=ib,it
c1(k)=cx(i)
k=k+1
enddo
c1=cshift(c1,i0-ib)
call four2a(c1,NFFT2,1,1,1) !c2c FFT back to time domain
c1=c1/(NMAX*NFFT2)
fac=1.0/sqrt(float(NFFT1)*NFFT2)
c1=fac*c1
return
end subroutine ft8_downsample

View File

@ -25,6 +25,8 @@ subroutine refspectrum(id2,id2b,kk,bclear,brefspec,buseref,fname)
data first/.true./,blastuse/.false./
save
print*,fname
if(first) then
pi=4.0*atan(1.0)
do i=0,NFFT-1