New scheme for finding candidates. Speed up sync. Improved SNR calibration.

This commit is contained in:
Steve Franke 2019-02-02 16:29:17 -06:00
parent 40fd3f6551
commit 91e3dbdf20
3 changed files with 38 additions and 20 deletions

View File

@ -78,7 +78,7 @@ subroutine ft4_decode(cdatetime0,tbuf,nfa,nfb,nfqso,iwave,ndecodes,mycall, &
ndecodes=0
do icand=1,ncand
f0=candidate(1,icand)
xsnr=10*log10(candidate(3,icand))-18.0
snr=candidate(3,icand)-1.0
if( f0.le.375.0 .or. f0.ge.(5000.0-375.0) ) cycle
call clockit('ft4_down',0)
call ft4_downsample(iwave,f0,cd2) !Downsample from 512 to 32 Sa/Symbol
@ -89,15 +89,15 @@ subroutine ft4_decode(cdatetime0,tbuf,nfa,nfb,nfqso,iwave,ndecodes,mycall, &
! Sample rate is now 12000/16 = 750 samples/second
do isync=1,2
if(isync.eq.1) then
idfmin=-50
idfmax=50
idfmin=-12
idfmax=12
idfstp=3
ibmin=0
ibmax=374
ibstp=4
else
idfmin=idfbest-5
idfmax=idfbest+5
idfmin=idfbest-4
idfmax=idfbest+4
idfstp=1
ibmin=max(0,ibest-5)
ibmax=min(ibest+5,NMAX/NDOWN-1)
@ -265,6 +265,11 @@ subroutine ft4_decode(cdatetime0,tbuf,nfa,nfb,nfqso,iwave,ndecodes,mycall, &
if(idupe.eq.1) exit
ndecodes=ndecodes+1
decodes(ndecodes)=message
if(snr.gt.0.0) then
xsnr=10*log10(snr)-14.0
else
xsnr=-18.0
endif
nsnr=nint(xsnr)
freq=f0
tsig=mod(tbuf + ibest/750.0,100.0)

View File

@ -11,6 +11,6 @@ parameter (NZ=NSPS*NN) !Sync and Data samples (52736)
parameter (NZ2=NSPS*NN2) !Total samples in shaped waveform (53760)
parameter (NMAX=5*12000) !Samples in iwave (60,000)
parameter (NFFT1=2048, NH1=NFFT1/2) !Length of FFTs for symbol spectra
parameter (NSTEP=NSPS/4) !Coarse time-sync step size
parameter (NHSYM=NMAX/NSTEP-3) !Number of symbol spectra (1/4-sym steps)
parameter (NSTEP=NSPS) !Coarse time-sync step size
parameter (NHSYM=(NMAX-NFFT1)/NSTEP) !Number of symbol spectra (1/4-sym steps)
parameter (NDOWN=16) !Downsample factor

View File

@ -56,19 +56,32 @@ subroutine getcandidates4(id,fa,fb,syncmin,nfqso,maxcand,savg,candidate, &
ncand=0
f_offset = -1.5*12000/512
do i=1,maxcand
ipk=maxloc(savsm(nfa:nfb))
ip=nfa-1+ipk(1)
xmax=savsm(ip)
savsm(max(1,ip-8):min(NH1,ip+8))=0.0
if(xmax.ge.syncmin) then
do i=nfa+1,nfb-1
if(savsm(i).ge.savsm(i-1) .and. savsm(i).ge.savsm(i+1) .and. savsm(i).ge.syncmin) then
del=0.5*(savsm(i-1)-savsm(i+1))/(savsm(i-1)-2*savsm(i)+savsm(i+1))
fpeak=(i+del)*df+f_offset
speak=savsm(i) - 0.25*(savsm(i-1)-savsm(i+1))*del
ncand=ncand+1
candidate(1,ncand)=ip*df+f_offset
candidate(2,ncand)=-99.9
candidate(3,ncand)=xmax
else
exit
if(ncand.gt.maxcand) exit
candidate(1,ncand)=fpeak
candidate(2,ncand)=-99.99
candidate(3,ncand)=speak
endif
enddo
! do i=1,maxcand
! ipk=maxloc(savsm(nfa:nfb))
! ip=nfa-1+ipk(1)
! xmax=savsm(ip)
! savsm(max(1,ip-8):min(NH1,ip+8))=0.0
! if(xmax.ge.syncmin) then
! ncand=ncand+1
! candidate(1,ncand)=ip*df+f_offset
! candidate(2,ncand)=-99.9
! candidate(3,ncand)=xmax
! else
! exit
! endif
! enddo
return
end subroutine getcandidates4