mirror of https://github.com/saitohirga/WSJT-X.git
Merge branch 'feat-ft2' of bitbucket.org:k1jt/wsjtx into feat-ft2
This commit is contained in:
commit
1261434e84
|
@ -79,9 +79,9 @@ subroutine ft4_decode(cdatetime0,nfqso,iwave,ndecodes,mycall,hiscall,nrx,line)
|
||||||
do icand=1,ncand
|
do icand=1,ncand
|
||||||
f0=candidate(1,icand)
|
f0=candidate(1,icand)
|
||||||
xsnr=10*log10(candidate(3,icand))-18.0
|
xsnr=10*log10(candidate(3,icand))-18.0
|
||||||
if( f0.le.375.0 .or. f0.ge.(5000.0-375.0) ) cycle !### TBD? ###
|
if( f0.le.375.0 .or. f0.ge.(5000.0-375.0) ) cycle
|
||||||
call ft4_downsample(iwave,f0,cd2) !Downsample to 32 Samples/Symbol
|
call ft4_downsample(iwave,f0,cd2) ! downsample from 512 Sa/Symbol to 32 Sa/Symbol
|
||||||
sum2=sum(cd2*conjg(cd2))/(20.0*76)
|
sum2=sum(cd2*conjg(cd2))/(real(NMAX)/real(NDOWN))
|
||||||
if(sum2.gt.0.0) cd2=cd2/sqrt(sum2)
|
if(sum2.gt.0.0) cd2=cd2/sqrt(sum2)
|
||||||
! Sample rate is now 12000/16 = 750 samples/second
|
! Sample rate is now 12000/16 = 750 samples/second
|
||||||
do isync=1,2
|
do isync=1,2
|
||||||
|
@ -149,7 +149,13 @@ subroutine ft4_decode(cdatetime0,nfqso,iwave,ndecodes,mycall,hiscall,nrx,line)
|
||||||
enddo
|
enddo
|
||||||
nsync=is1+is2+is3+is4 !Number of hard sync errors, 0-16
|
nsync=is1+is2+is3+is4 !Number of hard sync errors, 0-16
|
||||||
|
|
||||||
|
<<<<<<< HEAD
|
||||||
do nseq=1,3 !Try coherent sequences of 1, 2, and 4 symbols
|
do nseq=1,3 !Try coherent sequences of 1, 2, and 4 symbols
|
||||||
|
=======
|
||||||
|
if(smax .lt. 0.9 .or. nsync .lt. 9) cycle
|
||||||
|
|
||||||
|
do nseq=1,3
|
||||||
|
>>>>>>> 66bb999126e00874a7b300735b2aef631386a099
|
||||||
if(nseq.eq.1) nsym=1
|
if(nseq.eq.1) nsym=1
|
||||||
if(nseq.eq.2) nsym=2
|
if(nseq.eq.2) nsym=2
|
||||||
if(nseq.eq.3) nsym=4
|
if(nseq.eq.3) nsym=4
|
||||||
|
@ -206,9 +212,7 @@ subroutine ft4_decode(cdatetime0,nfqso,iwave,ndecodes,mycall,hiscall,nrx,line)
|
||||||
ns4=count(hbits(199:206).eq.(/0,0,0,1,1,0,1,1/))
|
ns4=count(hbits(199:206).eq.(/0,0,0,1,1,0,1,1/))
|
||||||
nsync_qual=ns1+ns2+ns3+ns4
|
nsync_qual=ns1+ns2+ns3+ns4
|
||||||
|
|
||||||
if(nsync.lt.8 .or. nsync_qual.lt. 20) then
|
if(nsync_qual.lt. 20) cycle
|
||||||
cycle
|
|
||||||
endif
|
|
||||||
|
|
||||||
scalefac=2.83
|
scalefac=2.83
|
||||||
llra( 1: 58)=bmeta( 9: 66)
|
llra( 1: 58)=bmeta( 9: 66)
|
||||||
|
@ -299,25 +303,39 @@ subroutine ft4_downsample(iwave,f0,c)
|
||||||
complex c(0:NMAX/NDOWN-1)
|
complex c(0:NMAX/NDOWN-1)
|
||||||
complex c1(0:NFFT2-1)
|
complex c1(0:NFFT2-1)
|
||||||
complex cx(0:NMAX/2)
|
complex cx(0:NMAX/2)
|
||||||
real x(NMAX)
|
real x(NMAX), window(0:NFFT2-1)
|
||||||
equivalence (x,cx)
|
equivalence (x,cx)
|
||||||
|
logical first
|
||||||
|
data first/.true./
|
||||||
|
save first,window
|
||||||
|
|
||||||
!****** Tune this
|
|
||||||
bw=250.0
|
|
||||||
df=12000.0/NMAX
|
df=12000.0/NMAX
|
||||||
|
baud=12000.0/NSPS
|
||||||
|
if(first) then
|
||||||
|
bw_transition = 0.5*baud
|
||||||
|
bw_flat = 4*baud
|
||||||
|
iwt = bw_transition / df
|
||||||
|
iwf = bw_flat / df
|
||||||
|
pi=4.0*atan(1.0)
|
||||||
|
window(0:iwt-1) = 0.5*(1+cos(pi*(/(i,i=iwt-1,0,-1)/)/iwt))
|
||||||
|
window(iwt:iwt+iwf-1)=1.0
|
||||||
|
window(iwt+iwf:2*iwt+iwf-1) = 0.5*(1+cos(pi*(/(i,i=0,iwt)/)/iwt))
|
||||||
|
window(2*iwt+iwf:)=0.0
|
||||||
|
iws = baud / df
|
||||||
|
window=cshift(window,iws)
|
||||||
|
first=.false.
|
||||||
|
endif
|
||||||
|
|
||||||
x=iwave
|
x=iwave
|
||||||
call four2a(x,NMAX,1,-1,0) !r2c FFT to freq domain
|
call four2a(x,NMAX,1,-1,0) !r2c FFT to freq domain
|
||||||
ibw=nint(bw/df)
|
|
||||||
i0=nint(f0/df)
|
i0=nint(f0/df)
|
||||||
c1=0.
|
c1=0.
|
||||||
c1(0)=cx(i0)
|
c1(0)=cx(i0)
|
||||||
do i=1,NFFT2/2
|
do i=1,NFFT2/2
|
||||||
arg=(i-1)*df/bw
|
if(i0+i.le.NMAX/2) c1(i)=cx(i0+i)
|
||||||
win=exp(-arg*arg)
|
if(i0-i.ge.0) c1(NFFT2-i)=cx(i0-i)
|
||||||
if(i0+i.le.NMAX/2) c1(i)=cx(i0+i)*win
|
|
||||||
if(i0-i.ge.0) c1(NFFT2-i)=cx(i0-i)*win
|
|
||||||
enddo
|
enddo
|
||||||
c1=c1/NFFT2
|
c1=c1*window/NFFT2
|
||||||
call four2a(c1,NFFT2,1,1,1) !c2c FFT back to time domain
|
call four2a(c1,NFFT2,1,1,1) !c2c FFT back to time domain
|
||||||
c=c1(0:NMAX/NDOWN-1)
|
c=c1(0:NMAX/NDOWN-1)
|
||||||
|
|
||||||
|
|
|
@ -6,12 +6,23 @@ subroutine getcandidates4(id,fa,fb,syncmin,nfqso,maxcand,savg,candidate, &
|
||||||
real savg(NH1),savsm(NH1)
|
real savg(NH1),savsm(NH1)
|
||||||
real sbase(NH1)
|
real sbase(NH1)
|
||||||
real x(NFFT1)
|
real x(NFFT1)
|
||||||
|
real window(NFFT1)
|
||||||
complex cx(0:NH1)
|
complex cx(0:NH1)
|
||||||
real candidate(3,maxcand)
|
real candidate(3,maxcand)
|
||||||
integer*2 id(NMAX)
|
integer*2 id(NMAX)
|
||||||
integer indx(NH1)
|
integer indx(NH1)
|
||||||
integer ipk(1)
|
integer ipk(1)
|
||||||
equivalence (x,cx)
|
equivalence (x,cx)
|
||||||
|
logical first
|
||||||
|
data first/.true./
|
||||||
|
save first,window
|
||||||
|
|
||||||
|
if(first) then
|
||||||
|
first=.false.
|
||||||
|
pi=4.0*atan(1.)
|
||||||
|
window=0.5*(1-cos(pi*(/(i,i=1,NFFT1)/)/(NFFT1/2.0)))
|
||||||
|
window=window**2
|
||||||
|
endif
|
||||||
|
|
||||||
! Compute symbol spectra, stepping by NSTEP steps.
|
! Compute symbol spectra, stepping by NSTEP steps.
|
||||||
savg=0.
|
savg=0.
|
||||||
|
@ -20,9 +31,9 @@ subroutine getcandidates4(id,fa,fb,syncmin,nfqso,maxcand,savg,candidate, &
|
||||||
fac=1.0/300.0
|
fac=1.0/300.0
|
||||||
do j=1,NHSYM
|
do j=1,NHSYM
|
||||||
ia=(j-1)*NSTEP + 1
|
ia=(j-1)*NSTEP + 1
|
||||||
ib=ia+NSPS-1
|
ib=ia+NFFT1-1
|
||||||
x(1:NSPS)=fac*id(ia:ib)
|
if(ib.gt.NMAX) exit
|
||||||
x(NSPS+1:)=0.
|
x=fac*id(ia:ib)*window
|
||||||
call four2a(x,NFFT1,1,-1,0) !r2c FFT
|
call four2a(x,NFFT1,1,-1,0) !r2c FFT
|
||||||
do i=1,NH1
|
do i=1,NH1
|
||||||
s(i,j)=real(cx(i))**2 + aimag(cx(i))**2
|
s(i,j)=real(cx(i))**2 + aimag(cx(i))**2
|
||||||
|
|
|
@ -13,9 +13,9 @@ subroutine sync4d(cd0,i0,ctwk,itwk,sync)
|
||||||
integer icos4(0:3)
|
integer icos4(0:3)
|
||||||
data icos4/0,1,3,2/
|
data icos4/0,1,3,2/
|
||||||
data first/.true./
|
data first/.true./
|
||||||
save first,twopi,csync
|
save first,twopi,csync,fac
|
||||||
|
|
||||||
p(z1)=real(z1)**2 + aimag(z1)**2 !Statement function for power
|
p(z1)=real(z1*fac)**2 + aimag(z1*fac)**2 !Statement function for power
|
||||||
|
|
||||||
if( first ) then
|
if( first ) then
|
||||||
twopi=8.0*atan(1.0)
|
twopi=8.0*atan(1.0)
|
||||||
|
@ -30,6 +30,7 @@ subroutine sync4d(cd0,i0,ctwk,itwk,sync)
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
first=.false.
|
first=.false.
|
||||||
|
fac=1.0/(4.0*NSS)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
sync=0
|
sync=0
|
||||||
|
|
Loading…
Reference in New Issue