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 astro0.f90
astrosub.f90 astrosub.f90
cfom.f90 cfom.f90
# chkstat.f90 chkstat.f90
dcoord.f90 dcoord.f90
decode0.f90 decode0.f90
dot.f90 dot.f90

View File

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

View File

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

View File

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

View File

@ -12,7 +12,7 @@ subroutine q65c(itimer)
real*8 fcenter real*8 fcenter
integer nparams0(NJUNK+3),nparams(NJUNK+3) integer nparams0(NJUNK+3),nparams(NJUNK+3)
logical first logical first
logical*1 bAlso30,bSkip logical*1 bAlso30
character*12 mycall,hiscall character*12 mycall,hiscall
character*6 mygrid,hisgrid character*6 mygrid,hisgrid
character*20 datetime character*20 datetime
@ -41,21 +41,28 @@ subroutine q65c(itimer)
npatience=1 npatience=1
newdat=1 !Always on ?? 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 if(ntx30a.gt.5) then
dd(1:2,1:30*96000)=0. dd(1:2,1:30*96000)=0.
ss(1:200,1:NFFT)=0. ss(1:200,1:NFFT)=0.
do i=1,NFFT
savg(i)=sum(ss(201:400,i))
enddo
endif endif
if(ntx30b.gt.5) then if(ntx30b.gt.5) then
dd(1:2,30*96000+1:60*96000)=0. dd(1:2,30*96000+1:60*96000)=0.
ss(201:400,1:NFFT)=0. ss(201:400,1:NFFT)=0.
do i=1,NFFT
savg(i)=sum(ss(1:200,i))
enddo
endif 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 timer('decode0 ',0)
call decode0(dd,ss,savg) call decode0(dd,ss,savg)
call timer('decode0 ',1) call timer('decode0 ',1)

View File

@ -1,7 +1,7 @@
subroutine qmapa(dd,ss,savg,newdat,nutc,fcenter,ntol,nfa,nfb, & subroutine qmapa(dd,ss,savg,newdat,nutc,fcenter,ntol,nfa,nfb, &
mousedf,mousefqso,nagain,nfshift,max_drift,offset,nfcal,mycall, & mousedf,mousefqso,nagain,ntx30a,ntx30b,nfshift,max_drift,offset, &
hiscall,hisgrid,nfsample,nBaseSubmode,ndepth,datetime,ndop00, & nfcal,mycall,hiscall,hisgrid,nfsample,nBaseSubmode,ndepth, &
fselected,bAlso30,nhsym,nCFOM) datetime,ndop00,fselected,bAlso30,nhsym,nCFOM)
! Processes timf2 data received from Linrad to find and decode Q65 signals. ! Processes timf2 data received from Linrad to find and decode Q65 signals.
@ -44,8 +44,8 @@ subroutine qmapa(dd,ss,savg,newdat,nutc,fcenter,ntol,nfa,nfb, &
call timer('get_cand',0) call timer('get_cand',0)
! Get a list of decoding candidates ! Get a list of decoding candidates
call getcand2(ss,savg,nts_q65,nagain,nhsym,ntol,f0_selected,bAlso30, & call getcand2(ss,savg,nts_q65,nagain,nhsym,ntx30a,ntx30b,ntol, &
cand,ncand) f0_selected,bAlso30,cand,ncand)
call timer('get_cand',1) call timer('get_cand',1)
nwrite_q65=0 nwrite_q65=0