diff options
| author | tony mancill <tmancill@debian.org> | 2021-10-30 11:14:35 -0700 |
|---|---|---|
| committer | tony mancill <tmancill@debian.org> | 2021-10-30 11:14:35 -0700 |
| commit | 27d0d660257d9dcdab5c5ca8addd01cc10552902 (patch) | |
| tree | 14e3cb9743f1a04da7c9093d08520e801a48adf3 /lib | |
| parent | 6ec76defdb6622d379e68ee4a4d45f8c9758bb1f (diff) | |
New upstream version 2.5.1+repackupstream/2.5.1+repack
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/four2a.f90 | 6 | ||||
| -rw-r--r-- | lib/ft8/ft8apset.f90 | 9 | ||||
| -rw-r--r-- | lib/jt65_decode.f90 | 1 | ||||
| -rw-r--r-- | lib/q65_decode.f90 | 37 | ||||
| -rw-r--r-- | lib/qra/q65/q65.f90 | 52 | ||||
| -rw-r--r-- | lib/qra/q65/q65_set_list.f90 | 62 |
6 files changed, 145 insertions, 22 deletions
diff --git a/lib/four2a.f90 b/lib/four2a.f90 index e7e0e801..9e08722e 100644 --- a/lib/four2a.f90 +++ b/lib/four2a.f90 @@ -21,7 +21,7 @@ subroutine four2a(a,nfft,ndim,isign,iform) use fftw3 parameter (NPMAX=2100) !Max numberf of stored plans - parameter (NSMALL=16384) !Max size of "small" FFTs + parameter (NSMALL=16385) !Max half complex size of "small" FFTs complex a(nfft) !Array to be transformed complex aa(NSMALL) !Local copy of "small" a() integer nn(NPMAX),ns(NPMAX),nf(NPMAX) !Params of stored plans @@ -67,7 +67,7 @@ subroutine four2a(a,nfft,ndim,isign,iform) if(nfft.le.NSMALL) then jz=nfft - if(iform.eq.0) jz=nfft/2 + if(iform.le.0) jz=nfft/2+1 aa(1:jz)=a(1:jz) endif @@ -87,7 +87,7 @@ subroutine four2a(a,nfft,ndim,isign,iform) if(nfft.le.NSMALL) then jz=nfft - if(iform.eq.0) jz=nfft/2 + if(iform.le.0) jz=nfft/2+1 a(1:jz)=aa(1:jz) endif end if diff --git a/lib/ft8/ft8apset.f90 b/lib/ft8/ft8apset.f90 index 90f05b70..73a224ec 100644 --- a/lib/ft8/ft8apset.f90 +++ b/lib/ft8/ft8apset.f90 @@ -6,20 +6,19 @@ subroutine ft8apset(mycall12,hiscall12,ncontest,apsym,aph10) character*13 hc13 character*10 c10 integer apsym(58),aph10(10) - logical nohiscall,unpk77_success + logical nohiscall,unpk77_success,std apsym=0 apsym(1)=99 apsym(30)=99 aph10=0 aph10(1)=99 - if(len(trim(mycall12)).lt.3) return nohiscall=.false. hiscall=hiscall12 if(len(trim(hiscall)).lt.3) then - hiscall=mycall12 ! use mycall for dummy hiscall - mycall won't be hashed. + hiscall='KA1ABC' !Use a dummy hiscall nohiscall=.true. else hc13=hiscall @@ -34,7 +33,9 @@ subroutine ft8apset(mycall12,hiscall12,ncontest,apsym,aph10) ! Encode a dummy standard message: i3=1, 28 1 28 1 1 15 ! - msg=trim(mycall12)//' '//trim(hiscall)//' RRR' + msg=trim(mycall12)//' '//trim(hiscall)//' RRR' + call stdcall(mycall12,std) + if(.not.std) msg='<'//trim(mycall12)//'> '//trim(hiscall)//' RRR' i3=0 n3=0 call pack77(msg,i3,n3,c77) diff --git a/lib/jt65_decode.f90 b/lib/jt65_decode.f90 index 8ac539e9..4e73ee7b 100644 --- a/lib/jt65_decode.f90 +++ b/lib/jt65_decode.f90 @@ -162,6 +162,7 @@ contains ib=min(NSZ,nint((nfb+100)/df)) nz=ib-ia+1 if(nz.lt.50) go to 900 + if(isnan(sum(savg(ia:ia+nz-1)))) go to 900 call lorentzian(savg(ia),nz,a) baseline=a(1) amp=a(2) diff --git a/lib/q65_decode.f90 b/lib/q65_decode.f90 index cbe295ad..087bc0ce 100644 --- a/lib/q65_decode.f90 +++ b/lib/q65_decode.f90 @@ -76,6 +76,10 @@ contains complex, allocatable :: c00(:) !Analytic signal, 6000 Sa/s complex, allocatable :: c0(:) !Analytic signal, 6000 Sa/s +!w3sz added + integer stageno + stageno=0 + ! Start by setting some parameters and allocating storage for large arrays call sec0(0,tdecode) nfa=nfa0 @@ -93,6 +97,9 @@ contains nfft2=ntrperiod*6000 npasses=1 + dxcall13=hiscall ! initialize for use in packjt77 + mycall13=mycall + ! Determine the T/R sequence: iseq=0 (even), or iseq=1 (odd) n=nutc if(ntrperiod.ge.60 .and. nutc.le.2359) n=100*n @@ -131,7 +138,8 @@ contains ibwa=max(1,int(1.8*log(baud*mode_q65)) + 1) ibwb=min(10,ibwa+5) maxiters=67 - else if(iand(ndepth,3).eq.3) then + endif + if(iand(ndepth,3).eq.3) then ibwa=max(1,ibwa-1) ibwb=min(10,ibwb+1) maxiters=100 @@ -151,7 +159,7 @@ contains ! Call top-level routine in q65 module: establish sync and try for a ! q3 or q0 decode. call 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) call timer('q65_dec0',1) ! write(*,3001) '=a',sum(abs(float(iwave))),nfqso,ntol,ndepth,xdt,f0,idec !3001 format(a2,f15.0,3i5,f7.2,f7.1,i5) @@ -208,7 +216,7 @@ contains ! decode, this time using the cumulative 's1a' symbol spectra. iavg=1 call 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) call timer('list_avg',1) if(idec.ge.0) then @@ -225,7 +233,7 @@ contains call timer('q65_avg ',0) iavg=2 call 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) call timer('q65_avg ',1) if(idec.ge.0) then dtdec=xdt !We have a q[012]n result @@ -233,7 +241,22 @@ contains nused=navg(iseq) endif -100 decoded=' ' +100 stageno = 5 + + if(idec.lt.0) then + call timer('q65_dec0',0) + ! Call top-level routine in q65 module: establish sync and try for a + ! q3 or q0 decode. + call q65_dec0(iavg,nutc,iwave,ntrperiod,nfqso,ntol,ndepth,lclearave, & + emedelay,xdt,f0,snr1,width,dat4,snr2,idec,stageno) + call timer('q65_dec0',1) + if(idec.ge.0) then + dtdec=xdt !We have a q[012]n result + f0dec=f0 + endif + endif ! if(idec.lt.0) + + decoded=' ' if(idec.ge.0) then ! idec Meaning ! ------------------------------------------------------ @@ -246,7 +269,7 @@ contains ! Unpack decoded message for display to user write(c77,1000) dat4(1:12),dat4(13)/2 1000 format(12b6.6,b5.5) - call unpack77(c77,0,decoded,unpk77_success) !Unpack to get msgsent + call unpack77(c77,1,decoded,unpk77_success) !Unpack to get msgsent call q65_snr(dat4,dtdec,f0dec,mode_q65,nused,snr2) nsnr=nint(snr2) call this%callback(nutc,snr1,nsnr,dtdec,f0dec,decoded, & @@ -322,7 +345,7 @@ contains if(idec.ge.0) then ! Unpack decoded message for display to user write(c77,1000) dat4(1:12),dat4(13)/2 - call unpack77(c77,0,decoded,unpk77_success) !Unpack to get msgsent + call unpack77(c77,1,decoded,unpk77_success) !Unpack to get msgsent call q65_snr(dat4,dtdec,f0dec,mode_q65,nused,snr2) nsnr=nint(snr2) call this%callback(nutc,snr1,nsnr,dtdec,f0dec,decoded, & 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 |
