mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-07-03 10:25:15 -04:00
Merge branch 'feat-fst280' of bitbucket.org:k1jt/wsjtx into feat-fst280
This commit is contained in:
commit
dc2d1057bd
@ -1,5 +1,4 @@
|
|||||||
module fst280_decode
|
module fst280_decode
|
||||||
|
|
||||||
type :: fst280_decoder
|
type :: fst280_decoder
|
||||||
procedure(fst280_decode_callback), pointer :: callback
|
procedure(fst280_decode_callback), pointer :: callback
|
||||||
contains
|
contains
|
||||||
@ -41,7 +40,7 @@ contains
|
|||||||
complex, allocatable :: c_bigfft(:) !Complex waveform
|
complex, allocatable :: c_bigfft(:) !Complex waveform
|
||||||
real, allocatable :: r_data(:)
|
real, allocatable :: r_data(:)
|
||||||
real llr(280),llra(280),llrb(280),llrc(280),llrd(280)
|
real llr(280),llra(280),llrb(280),llrc(280),llrd(280)
|
||||||
real candidates(100,3)
|
real candidates(100,4)
|
||||||
real bitmetrics(328,4)
|
real bitmetrics(328,4)
|
||||||
integer hmod
|
integer hmod
|
||||||
integer*1 apmask(280),cw(280)
|
integer*1 apmask(280),cw(280)
|
||||||
@ -187,7 +186,40 @@ contains
|
|||||||
endif
|
endif
|
||||||
fc_synced = fc0 + fc2
|
fc_synced = fc0 + fc2
|
||||||
dt_synced = (isbest-fs2)*dt2 !nominal dt is 1 second so frame starts at sample fs2
|
dt_synced = (isbest-fs2)*dt2 !nominal dt is 1 second so frame starts at sample fs2
|
||||||
|
candidates(icand,3)=fc_synced
|
||||||
|
candidates(icand,4)=isbest
|
||||||
|
enddo
|
||||||
|
|
||||||
|
! remove duplicate candidates
|
||||||
|
do icand=1,ncand
|
||||||
|
fc=candidates(icand,3)
|
||||||
|
isbest=nint(candidates(icand,4))
|
||||||
|
do ic2=1,ncand
|
||||||
|
fc2=candidates(ic2,3)
|
||||||
|
isbest2=nint(candidates(ic2,4))
|
||||||
|
if(ic2.ne.icand .and. fc2.gt.0.0) then
|
||||||
|
if(abs(fc2-fc).lt.0.05*baud) then ! same frequency
|
||||||
|
if(abs(isbest2-isbest).le.2) then
|
||||||
|
candidates(ic2,3)=-1
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
enddo
|
||||||
|
enddo
|
||||||
|
|
||||||
|
ic=0
|
||||||
|
do icand=1,ncand
|
||||||
|
if(candidates(icand,3).gt.0) then
|
||||||
|
ic=ic+1
|
||||||
|
candidates(ic,:)=candidates(icand,:)
|
||||||
|
endif
|
||||||
|
enddo
|
||||||
|
ncand=ic
|
||||||
|
|
||||||
|
do icand=1,ncand
|
||||||
|
fc_synced=candidates(icand,3)
|
||||||
|
isbest=nint(candidates(icand,4))
|
||||||
|
xdt=(isbest-nspsec)/fs2
|
||||||
call fst280_downsample(c_bigfft,nfft1,ndown,fc_synced,c2)
|
call fst280_downsample(c_bigfft,nfft1,ndown,fc_synced,c2)
|
||||||
|
|
||||||
do ijitter=0,2
|
do ijitter=0,2
|
||||||
@ -378,7 +410,7 @@ contains
|
|||||||
|
|
||||||
complex c_bigfft(0:nfft1/2)
|
complex c_bigfft(0:nfft1/2)
|
||||||
integer hmod
|
integer hmod
|
||||||
real candidates(100,3)
|
real candidates(100,4)
|
||||||
real s(18000)
|
real s(18000)
|
||||||
real s2(18000)
|
real s2(18000)
|
||||||
data nfft1z/-1/
|
data nfft1z/-1/
|
||||||
@ -388,7 +420,7 @@ contains
|
|||||||
df1=fs/nfft1
|
df1=fs/nfft1
|
||||||
baud=fs/nsps
|
baud=fs/nsps
|
||||||
df2=baud/2.0
|
df2=baud/2.0
|
||||||
nd=df1/df2
|
nd=df2/df1
|
||||||
ndh=nd/2
|
ndh=nd/2
|
||||||
ia=fa/df2
|
ia=fa/df2
|
||||||
ib=fb/df2
|
ib=fb/df2
|
||||||
@ -399,18 +431,14 @@ contains
|
|||||||
s(i)=s(i) + real(c_bigfft(j))**2 + aimag(c_bigfft(j))**2
|
s(i)=s(i) + real(c_bigfft(j))**2 + aimag(c_bigfft(j))**2
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
call pctile(s(ia:ib),ib-ia+1,30,base)
|
|
||||||
s=s/base
|
|
||||||
nh=hmod
|
nh=hmod
|
||||||
do i=ia,ib
|
do i=ia,ib
|
||||||
s2(i)=s(i-nh*3) + s(i-nh) +s(i+nh) +s(i+nh*3)
|
s2(i)=s(i-nh*3) + s(i-nh) +s(i+nh) +s(i+nh*3)
|
||||||
s2(i)=db(s2(i)) - 48.5
|
|
||||||
enddo
|
enddo
|
||||||
|
call pctile(s2(ia:ib),ib-ia+1,30,base)
|
||||||
|
s2=s2/base
|
||||||
|
|
||||||
if(hmod.eq.1) thresh=-29.5 !### temporaray? ###
|
thresh=1.25
|
||||||
if(hmod.eq.2) thresh=-27.0
|
|
||||||
if(hmod.eq.4) thresh=-27.0
|
|
||||||
if(hmod.eq.8) thresh=-27.0
|
|
||||||
|
|
||||||
ncand=0
|
ncand=0
|
||||||
if(ia.lt.3) ia=3
|
if(ia.lt.3) ia=3
|
||||||
@ -421,7 +449,11 @@ contains
|
|||||||
(s2(i).gt.thresh).and.ncand.lt.100) then
|
(s2(i).gt.thresh).and.ncand.lt.100) then
|
||||||
ncand=ncand+1
|
ncand=ncand+1
|
||||||
candidates(ncand,1)=df2*i
|
candidates(ncand,1)=df2*i
|
||||||
candidates(ncand,2)=s2(i)
|
x=s2(i)-1
|
||||||
|
snr=-99
|
||||||
|
! temporary placeholder until we implement subtraction...
|
||||||
|
if(x.gt.0) snr=10*log10(x)-10*log10(2500.0*nsps/12000.0)+6.0
|
||||||
|
candidates(ncand,2)=snr
|
||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user