diff --git a/lib/q65_decode.f90 b/lib/q65_decode.f90 index 4e1e0280c..d76e12087 100644 --- a/lib/q65_decode.f90 +++ b/lib/q65_decode.f90 @@ -49,6 +49,7 @@ contains use packjt77 use, intrinsic :: iso_c_binding use q65 !Shared variables + use prog_args parameter (NMAX=300*12000) !Max TRperiod is 300 s class(q65_decoder), intent(inout) :: this @@ -59,6 +60,7 @@ contains character*77 c77 character*78 c78 character*6 cutc + character c6*6,c4*4 integer*2 iwave(NMAX) !Raw data real, allocatable :: dd(:) !Raw data integer dat4(13) !Decoded message as 12 6-bit integers @@ -68,10 +70,14 @@ contains complex, allocatable :: c0(:) !Analytic signal, 6000 Sa/s ! Start by setting some parameters and allocating storage for large arrays + call sec0(0,tdecode) nfa=nfa0 nfb=nfb0 lnewdat=lnewdat0 idec=-1 + idf=0 + idt=0 + irc=0 mode_q65=2**nsubmode npts=ntrperiod*12000 nfft1=ntrperiod*12000 @@ -230,12 +236,34 @@ contains call this%callback(nutc,snr1,nsnr,dtdec,f0dec,decoded, & idec,nused,ntrperiod) if(iand(ndepth,128).ne.0) call q65_clravg !AutoClrAvg after decode + call sec0(1,tdecode) + open(22,file=trim(data_dir)//'/q65_decodes.dat',status='unknown', & + position='append',iostat=ios) + if(ios.eq.0) then +! Save decoding parameters to q65_decoded.dat, for later analysis. + c6=hiscall(1:6) + if(c6.eq.' ') c6=' ' + c4=hisgrid(1:4) + if(c4.eq.' ') c4=' ' + if(ntrperiod.ge.60) then + write(22,1022) nutc,ntrperiod,nsubmode,nQSOprogress,idec, & + nused,iaptype,irc,idf,idt,ibw,xdt,f0,snr1,snr2, & + tdecode,mycall(1:6),c6,c4,trim(decoded) +1022 format(i6.4,10i3,f6.2,f7.1,f7.2,f6.1,f6.2,1x,a6,1x,a6,1x,a4,1x,a) + else + write(22,1023) nutc,ntrperiod,nsubmode,nQSOprogress,idec, & + nused,iaptype,irc,idf,idt,ibw,xdt,f0,snr1,snr2, & + tdecode,mycall(1:6),c6,c4,trim(decoded) +1023 format(i6.6,10i3,f6.2,f7.1,f7.2,f6.1,f6.2,1x,a6,1x,a6,1x,a4,1x,a) + endif + close(22) + endif else ! Report snr1, even if no decode. nsnr=db(snr1) - 35.0 if(nsnr.lt.-35) nsnr=-35 idec=-1 - call this%callback(nutc,snr1,nsnr,xdt,f0,decoded, & + call this%callback(nutc,snr1,nsnr,xdt,f0,decoded, & idec,0,ntrperiod) endif navg0=1000*navg(0) + navg(1) diff --git a/lib/qra/q65/q65.f90 b/lib/qra/q65/q65.f90 index f01ba6d67..4714eb641 100644 --- a/lib/qra/q65/q65.f90 +++ b/lib/qra/q65/q65.f90 @@ -11,6 +11,7 @@ module q65 38,46,50,55,60,62,66,69,74,76,85/) integer codewords(63,206) integer ibwa,ibwb,ncw,nsps,mode_q65,nfa,nfb + integer idf,idt,ibw integer istep,nsmo,lag1,lag2,npasses,nused,iseq integer i0,j0 integer navg(0:1) diff --git a/lib/qra/q65/q65_loops.f90 b/lib/qra/q65/q65_loops.f90 index 9a70916cd..092997e69 100644 --- a/lib/qra/q65/q65_loops.f90 +++ b/lib/qra/q65/q65_loops.f90 @@ -75,9 +75,6 @@ subroutine q65_loops(c00,npts2,nsps2,nsubmode,ndepth,jpk0, & enddo ! idf (f0 loop) 100 if(irc.ge.0) then -! write(55,3055) ndepth,iaptype,idf,idt,ibw,ndist,irc,sum(s3(1:LL*NN)), & -! trim(decoded) -!3055 format(7i4,f10.1,1x,a) idec=iaptype snr2=esnodb - db(2500.0/baud) xdt1=xdt0 + nsps2*ndt/(16.0*6000.0)