summaryrefslogtreecommitdiff
path: root/lib/qra
diff options
context:
space:
mode:
authortony mancill <tmancill@debian.org>2021-10-30 11:14:35 -0700
committertony mancill <tmancill@debian.org>2021-10-30 11:14:35 -0700
commit27d0d660257d9dcdab5c5ca8addd01cc10552902 (patch)
tree14e3cb9743f1a04da7c9093d08520e801a48adf3 /lib/qra
parent6ec76defdb6622d379e68ee4a4d45f8c9758bb1f (diff)
New upstream version 2.5.1+repackupstream/2.5.1+repack
Diffstat (limited to 'lib/qra')
-rw-r--r--lib/qra/q65/q65.f9052
-rw-r--r--lib/qra/q65/q65_set_list.f9062
2 files changed, 106 insertions, 8 deletions
diff --git a/lib/qra/q65/q65.f90 b/lib/qra/q65/q65.f90
index 86cd15d5..1bd51f77 100644
--- a/lib/qra/q65/q65.f90
+++ b/lib/qra/q65/q65.f90
@@ -19,6 +19,7 @@ module q65
real candidates(20,3) !snr, xdt, and f0 of top candidates
real, allocatable :: s1raw(:,:) !Symbol spectra, 1/8-symbol steps
real, allocatable :: s1(:,:) !Symbol spectra w/suppressed peaks
+ real, allocatable :: s1w(:,:) !Symbol spectra w/suppressed peaks !w3sz added
real, allocatable,save :: s1a(:,:,:) !Cumulative symbol spectra
real, allocatable,save :: ccf2(:) !Max CCF(freq) at any lag, single seq
real, allocatable,save :: ccf2_avg(:) !Like ccf2, but for accumulated average
@@ -28,7 +29,7 @@ module q65
contains
subroutine q65_dec0(iavg,nutc,iwave,ntrperiod,nfqso,ntol,ndepth,lclearave, &
- emedelay,xdt,f0,snr1,width,dat4,snr2,idec)
+ emedelay,xdt,f0,snr1,width,dat4,snr2,idec,stageno)
! Top-level routine in q65 module
! - Compute symbol spectra
@@ -69,6 +70,11 @@ subroutine q65_dec0(iavg,nutc,iwave,ntrperiod,nfqso,ntol,ndepth,lclearave, &
data first/.true./
save first
+ integer w3t
+ integer w3f
+ integer mm
+ integer stageno
+
NN=63
if(nutc+ndepth.eq.-999) stop !Silence compiler warnings
@@ -222,7 +228,49 @@ subroutine q65_dec0(iavg,nutc,iwave,ntrperiod,nfqso,ntol,ndepth,lclearave, &
call q65_dec_q012(s3,LL,snr2,dat4,idec,decoded)
endif
-900 return
+ if(idec.lt.0 .and. max_drift.eq.50 .and. stageno.eq.5) then
+
+ if(allocated(s1w)) deallocate(s1w) ! w3sz
+ allocate(s1w(iz,jz)) ! w3sz
+
+ s1w=s1
+ do w3t=1,jz
+ do w3f=1,iz
+ mm=w3f + nint(drift*w3t/(jz*df))
+ if(mm.ge.1 .and. mm.le.iz) then
+ s1w(w3f,w3t)=s1(mm,w3t)
+ endif
+ end do
+ end do
+
+ if(ncw.gt.0 .and. iavg.le.1) then
+ ! Try list decoding via "Deep Likelihood".
+ call timer('ccf_85 ',0)
+ ! Try to synchronize using all 85 symbols
+ call q65_ccf_85(s1w,iz,jz,nfqso,ia,ia2,ipk,jpk,f0,xdt,imsg_best, &
+ better,ccf1)
+ call timer('ccf_85 ',1)
+ ! nsubmode is Tone-spacing indicator, 0-4 for A-E: a 0; b 1; c 2; d 3; e 4.
+ ! and mode_q65=2**nsubmode
+ if(better.ge.1.10) then
+ ! if(better.ge.1.04 .or. mode_q65.ge.8) then
+ ! if(better.ge.1.10 .or. mode_q65.ge.8) then ORIGINAL
+ call timer('list_dec',0)
+ call q65_dec_q3(s1w,iz,jz,s3,LL,ipk,jpk,snr2,dat4,idec,decoded)
+ call timer('list_dec',1)
+ ! if(idec.ge.0) write(70,3070) idec,mode_q65,better,trim(decoded)
+ !3070 format(i3,i5,f8.2,2x,a)
+ endif ! if(better.ge.1.10)
+ endif ! if(ncw.gt.0 .and. iavg.le.1)
+ ! If idec=3 we have a q3 decode. Continue to compute sync curve for plotting.
+
+ if(idec.eq.3) then
+ idec=5
+ endif
+
+ endif ! if(idec.lt.0 .and. maxdrift.eq.50 .and. stageno.eq.5)
+
+ return
end subroutine q65_dec0
subroutine q65_clravg
diff --git a/lib/qra/q65/q65_set_list.f90 b/lib/qra/q65/q65_set_list.f90
index 44b2e12c..acc7091e 100644
--- a/lib/qra/q65/q65_set_list.f90
+++ b/lib/qra/q65/q65_set_list.f90
@@ -4,6 +4,7 @@ subroutine q65_set_list(mycall,hiscall,hisgrid,codewords,ncw)
character*12 mycall,hiscall
character*6 hisgrid
character*37 msg0,msg,msgsent
+ logical my_std,his_std
integer codewords(63,MAX_NCW)
integer itone(85)
integer isync(22)
@@ -11,17 +12,32 @@ subroutine q65_set_list(mycall,hiscall,hisgrid,codewords,ncw)
ncw=0
if(hiscall(1:1).eq. ' ') return
+ call stdcall(mycall,my_std)
+ call stdcall(hiscall,his_std)
ncw=MAX_NCW
- msg0=trim(mycall)//' '//trim(hiscall)
- j0=len(trim(msg0))+2
do i=1,ncw
- msg=msg0
+ msg=trim(mycall)//' '//trim(hiscall)
+ if(.not.my_std) then
+ if(i.eq.1 .or. i.ge.6) msg='<'//trim(mycall)//'> '//trim(hiscall)
+ if(i.ge.2 .and. i.le.4) msg=trim(mycall)//' <'//trim(hiscall)//'>'
+ else if(.not.his_std) then
+ if(i.le.4) msg='<'//trim(mycall)//'> '//trim(hiscall)
+ if(i.ge.7) msg=trim(mycall)//' <'//trim(hiscall)//'>'
+ if(i.eq.6) then
+ msg='TNX 73 GL'
+ go to 10
+ endif
+ endif
+ j0=len(trim(msg))+2
if(i.eq.2) msg(j0:j0+2)='RRR'
if(i.eq.3) msg(j0:j0+3)='RR73'
if(i.eq.4) msg(j0:j0+1)='73'
- if(i.eq.5) msg='CQ '//trim(hiscall)//' '//hisgrid(1:4)
- if(i.eq.6) msg(j0:j0+3)=hisgrid(1:4)
+ if(i.eq.5) then
+ if(his_std) msg='CQ '//trim(hiscall)//' '//hisgrid(1:4)
+ if(.not.his_std) msg='CQ '//trim(hiscall)
+ endif
+ if(i.eq.6 .and. his_std) msg(j0:j0+3)=hisgrid(1:4)
if(i.ge.7 .and. i.le.206) then
isnr = -50 + (i-7)/2
if(iand(i,1).eq.1) then
@@ -32,7 +48,8 @@ subroutine q65_set_list(mycall,hiscall,hisgrid,codewords,ncw)
if(msg(j0+1:j0+1).eq.' ') msg(j0+1:j0+1)='+'
endif
endif
- call genq65(msg,0,msgsent,itone,i3,n3)
+
+10 call genq65(msg,0,msgsent,itone,i3,n3)
i0=1
j=0
do k=1,85
@@ -49,3 +66,36 @@ subroutine q65_set_list(mycall,hiscall,hisgrid,codewords,ncw)
return
end subroutine q65_set_list
+
+subroutine stdcall(callsign,std)
+
+ character*12 callsign
+ character*1 c
+ logical is_digit,is_letter,std
+!Statement functions:
+ is_digit(c)=c.ge.'0' .and. c.le.'9'
+ is_letter(c)=c.ge.'A' .and. c.le.'Z'
+
+! Check for standard callsign
+ iarea=-1
+ n=len(trim(callsign))
+ do i=n,2,-1
+ if(is_digit(callsign(i:i))) exit
+ enddo
+ iarea=i !Right-most digit (call area)
+ npdig=0 !Digits before call area
+ nplet=0 !Letters before call area
+ do i=1,iarea-1
+ if(is_digit(callsign(i:i))) npdig=npdig+1
+ if(is_letter(callsign(i:i))) nplet=nplet+1
+ enddo
+ nslet=0 !Letters in suffix
+ do i=iarea+1,n
+ if(is_letter(callsign(i:i))) nslet=nslet+1
+ enddo
+ std=.true.
+ if(iarea.lt.2 .or. iarea.gt.3 .or. nplet.eq.0 .or. &
+ npdig.ge.iarea-1 .or. nslet.gt.3) std=.false.
+
+ return
+end subroutine stdcall