Optimize calling the QMAP decoder for different sub-sequence tasks.

This commit is contained in:
Joe Taylor 2024-01-01 15:48:24 -05:00
parent 7276e86e60
commit fd0336f234
6 changed files with 38 additions and 32 deletions

View File

@ -6,7 +6,7 @@ set (libq65_FSRCS
astro0.f90
astrosub.f90
cfom.f90
# chkstat.f90
chkstat.f90
dcoord.f90
decode0.f90
dot.f90

View File

@ -1,23 +1,22 @@
subroutine chkstat(dd,ihsym,bSkip)
subroutine chkstat(dd,nhsym,dbdiff)
real dd(2,5760000)
real power(60)
logical*1 bSkip
sq0=0.
sq1=0.
k=0
do i=1,60
sq=0.
do j=1,96000
k=k+1
sq=sq + dd(1,k)*dd(1,k) + dd(2,k)*dd(2,k)
enddo
power(i)=sq/(2.0*96000.0)
enddo
if(i.ge.12 .and. i.le.24) sq0=sq0+sq
if(i.ge.42 .and. i.le.54) sq1=sq1+sq
enddo
bSkip=.false.
n1=count(power(1:30).lt.15.0)
n2=count(power(31:60).lt.15.0)
if(ihsym.le.200 .and. n1.gt.15) bSkip=.true.
if(ihsym.gt.200 .and. n2.gt.15) bSkip=.true.
db0=db(1.0+sq0)
db1=db(1.0+sq1)
dbdiff=db0-db1
return
end subroutine chkstat

View File

@ -43,9 +43,9 @@ subroutine decode0(dd,ss,savg)
hisgrid0=hisgrid
call timer('qmapa ',0)
call qmapa(dd,ss,savg,newdat,nutc,fcenter,ntol,nfa,nfb, &
mousedf,mousefqso,nagain,nfshift,max_drift,offset, &
nfcal,mycall,hiscall,hisgrid,nfsample,nmode,ndepth, &
call qmapa(dd,ss,savg,newdat,nutc,fcenter,ntol,nfa,nfb, &
mousedf,mousefqso,nagain,ntx30a,ntx30b,nfshift,max_drift,offset, &
nfcal,mycall,hiscall,hisgrid,nfsample,nmode,ndepth, &
datetime,ndop00,fselected,bAlso30,nhsym,NCFOM)
call timer('qmapa ',1)

View File

@ -1,5 +1,5 @@
subroutine getcand2(ss,savg0,nts_q65,nagain,nhsym,ntol,f0_selected, &
bAlso30,cand,ncand)
subroutine getcand2(ss,savg0,nts_q65,nagain,nhsym,ntx30a,ntx30b, &
ntol,f0_selected,bAlso30,cand,ncand)
! Get candidates for Q65 decodes, based on presence of sync tone.
@ -74,7 +74,7 @@ subroutine getcand2(ss,savg0,nts_q65,nagain,nhsym,ntol,f0_selected, &
if(.not.bAlso30) cycle
ntrperiod=30
if(nhsym.le.200) then
if(nhsym.le.200 .and. ntx30a.le.5) then
call q65_sync(ss,i0,nts_q65,ntrperiod,iseq,sync_ok,snr_sync,xdt)
if(sync_ok) then
! Sync tone is present, we have a candidate for decoding
@ -92,7 +92,7 @@ subroutine getcand2(ss,savg0,nts_q65,nagain,nhsym,ntol,f0_selected, &
endif
iseq=1
if(nhsym.ge.330) then
if(nhsym.ge.330 .and. ntx30b.le.5) then
call q65_sync(ss,i0,nts_q65,ntrperiod,iseq,sync_ok,snr_sync,xdt)
if(sync_ok) then
! Sync tone is present, we have a candidate for decoding

View File

@ -12,7 +12,7 @@ subroutine q65c(itimer)
real*8 fcenter
integer nparams0(NJUNK+3),nparams(NJUNK+3)
logical first
logical*1 bAlso30,bSkip
logical*1 bAlso30
character*12 mycall,hiscall
character*6 mygrid,hisgrid
character*20 datetime
@ -41,21 +41,28 @@ subroutine q65c(itimer)
npatience=1
newdat=1 !Always on ??
call chkstat(dd,nhsym,dbdiff)
! if(nhsym.eq.390) write(*,3001) nutc,nhsym,dbdiff
!3001 format(i4.4,i6,f7.1)
if(dbdiff.gt.5.0) ntx30b=30
if(dbdiff.lt.-5.0) ntx30a=30
if(ntx30a.gt.5) then
dd(1:2,1:30*96000)=0.
ss(1:200,1:NFFT)=0.
do i=1,NFFT
savg(i)=sum(ss(201:400,i))
enddo
endif
if(ntx30b.gt.5) then
dd(1:2,30*96000+1:60*96000)=0.
ss(201:400,1:NFFT)=0.
do i=1,NFFT
savg(i)=sum(ss(1:200,i))
enddo
endif
! call chkstat(dd,nhsym,bSkip)
! if(bSkip .and. nagain.eq.0) then
! print*,'A',nhsym,ntx30a,ntx30b,ntx60,junk1,junk2,bAlso30
! return
! endif
call timer('decode0 ',0)
call decode0(dd,ss,savg)
call timer('decode0 ',1)

View File

@ -1,7 +1,7 @@
subroutine qmapa(dd,ss,savg,newdat,nutc,fcenter,ntol,nfa,nfb, &
mousedf,mousefqso,nagain,nfshift,max_drift,offset,nfcal,mycall, &
hiscall,hisgrid,nfsample,nBaseSubmode,ndepth,datetime,ndop00, &
fselected,bAlso30,nhsym,nCFOM)
mousedf,mousefqso,nagain,ntx30a,ntx30b,nfshift,max_drift,offset, &
nfcal,mycall,hiscall,hisgrid,nfsample,nBaseSubmode,ndepth, &
datetime,ndop00,fselected,bAlso30,nhsym,nCFOM)
! Processes timf2 data received from Linrad to find and decode Q65 signals.
@ -32,7 +32,7 @@ subroutine qmapa(dd,ss,savg,newdat,nutc,fcenter,ntol,nfa,nfb, &
common/decodes/ndecodes,ncand,nQDecoderDone,nWDecoderBusy, &
nWTransmitting,result(50)
save
tsec0=sec_midn()
if(nagain.eq.1) ndepth=3 !Use full depth for click-to-decode
nkhz_center=nint(1000.0*(fcenter-int(fcenter)))
@ -44,8 +44,8 @@ subroutine qmapa(dd,ss,savg,newdat,nutc,fcenter,ntol,nfa,nfb, &
call timer('get_cand',0)
! Get a list of decoding candidates
call getcand2(ss,savg,nts_q65,nagain,nhsym,ntol,f0_selected,bAlso30, &
cand,ncand)
call getcand2(ss,savg,nts_q65,nagain,nhsym,ntx30a,ntx30b,ntol, &
f0_selected,bAlso30,cand,ncand)
call timer('get_cand',1)
nwrite_q65=0