From 5d7b5f83e270f8b8318ad47789359a5c2322ef13 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Wed, 30 Dec 2020 15:05:02 -0500 Subject: [PATCH] Fix several more flaws in the way Q65 decodes are presented. --- lib/q65_decode.f90 | 4 ++-- lib/qra/q65/q65_avg.f90 | 4 ++-- lib/qra/q65/q65_loops.f90 | 34 ++++++++++++++++------------------ lib/qra/q65/q65_sync.f90 | 2 +- widgets/mainwindow.cpp | 2 ++ 5 files changed, 23 insertions(+), 23 deletions(-) diff --git a/lib/q65_decode.f90 b/lib/q65_decode.f90 index 584f5aaa6..d7c75c6ea 100644 --- a/lib/q65_decode.f90 +++ b/lib/q65_decode.f90 @@ -153,9 +153,9 @@ contains call timer('q65loops',0) call q65_loops(c00,npts/2,nsps/2,mode65,nsubmode,ndepth,jpk0, & - xdt,f0,width,iaptype,xdt1,f1,snr2,dat4,idec) + xdt,f0,iaptype,xdt1,f1,snr2,dat4,idec) call timer('q65loops',1) - if(id2.gt.0) exit !Exit main loop after a successful decode + if(idec.gt.0) go to 100 !Successful decode, we're done enddo ! No single-transmission decode. diff --git a/lib/qra/q65/q65_avg.f90 b/lib/qra/q65/q65_avg.f90 index 6c94c868e..3b46f10cb 100644 --- a/lib/qra/q65/q65_avg.f90 +++ b/lib/qra/q65/q65_avg.f90 @@ -1,4 +1,4 @@ -subroutine q65_avg(nutc,ntrperiod,LL,ntol,lclearave,xdt,f0,snr1,s3) +subroutine q65_avg(nutc,ntrperiod,LL,nfqso,ntol,lclearave,xdt,f0,snr1,s3) ! Accumulate Q65 spectra s3(LL,63) and associated parameters for ! message averaging. @@ -47,7 +47,7 @@ subroutine q65_avg(nutc,ntrperiod,LL,ntol,lclearave,xdt,f0,snr1,s3) endif do i=1,MAXAVE !Don't save info more than once for same UTC and freq - if(nutc.eq.iutc(i) .and. abs(nfreq-f0save(i)).le.ntol) go to 10 + if(nutc.eq.iutc(i) .and. abs(nfqso-f0save(i)).le.ntol) go to 10 enddo ! Save data for message averaging diff --git a/lib/qra/q65/q65_loops.f90 b/lib/qra/q65/q65_loops.f90 index d734af305..ef5504040 100644 --- a/lib/qra/q65/q65_loops.f90 +++ b/lib/qra/q65/q65_loops.f90 @@ -1,5 +1,5 @@ subroutine q65_loops(c00,npts2,nsps,mode_q65,nsubmode,ndepth,jpk0, & - xdt0,f0,width,iaptype,xdt1,f1,snr2,dat4,id2) + xdt0,f0,iaptype,xdt1,f1,snr2,dat4,idec) use packjt77 use timer_module, only: timer @@ -19,16 +19,18 @@ subroutine q65_loops(c00,npts2,nsps,mode_q65,nsubmode,ndepth,jpk0, & 51,51,42,42,50,25,31,35,57,30, 1,54,54,10,10,22,44,58,57,40, & 21,21,19/ - id2=-1 + idec=-1 ircbest=9999 allocate(c0(0:npts2-1)) irc=-99 s3lim=20. + baud=6000.0/nsps idfmax=3 idtmax=3 - ibwmin=1 - ibwmax=3 + ibwa=max(1,int(1.8*log(baud*mode_q65)) + 2) + ibwb=min(10,ibwa+4) + ibw0=(ibwa+ibwb)/2 maxdist=5 if(iand(ndepth,3).ge.2) then idfmax=5 @@ -36,11 +38,14 @@ subroutine q65_loops(c00,npts2,nsps,mode_q65,nsubmode,ndepth,jpk0, & maxdist=15 endif if(iand(ndepth,3).eq.3) then - ibwmax=5 + maxdist=25 + ibwa=max(1,ibwa-1) + ibwb=min(10,ibwb+1) endif + + LL=64*(mode_q65+2) napmin=99 - baud=6000.0/nsps xdt1=xdt0 f1=f0 @@ -63,13 +68,10 @@ subroutine q65_loops(c00,npts2,nsps,mode_q65,nsubmode,ndepth,jpk0, & s3=s3/base where(s3(1:LL*NN)>s3lim) s3(1:LL*NN)=s3lim endif - do ibw=ibwmin,ibwmax - nbw=ibw/2 - if(mod(ibw,2).eq.0) nbw=-nbw - ndist=ndf**2 + ndt**2 + nbw**2 + do ibw=ibwa,ibwb + ndist=ndf**2 + ndt**2 + (ibw-ibw0)**2 if(ndist.gt.maxdist) cycle - xx=1.885*log(3.0*width)+nbw - b90=1.7**xx + b90=1.72**ibw if(b90.gt.345.0) cycle b90ts = b90/baud call q65_dec2(s3,nsubmode,b90ts,esnodb,irc,dat4,decoded) @@ -77,17 +79,13 @@ subroutine q65_loops(c00,npts2,nsps,mode_q65,nsubmode,ndepth,jpk0, & ! -1 = invalid params ! -2 = decode failed ! -3 = CRC mismatch -! irc=-99 !### TEMPORARY ### - if(irc.ge.0) then - id2=iaptype+2 -! print*,'B dec2 ',ibw,irc,id2,decoded - go to 100 - endif + if(irc.ge.0) go to 100 enddo ! ibw (b90 loop) enddo ! idt (DT loop) enddo ! idf (f0 loop) 100 if(irc.ge.0) then + idec=iaptype+2 snr2=esnodb - db(2500.0/baud) xdt1=xdt0 + nsps*ndt/(16.0*6000.0) f1=f0 + 0.5*baud*ndf diff --git a/lib/qra/q65/q65_sync.f90 b/lib/qra/q65/q65_sync.f90 index 600a5c86a..e2b35098c 100644 --- a/lib/qra/q65/q65_sync.f90 +++ b/lib/qra/q65/q65_sync.f90 @@ -250,7 +250,7 @@ subroutine q65_sync(nutc,iwave,ntrperiod,mode_q65,codewords,ncw,nsps, & enddo ! write(*,3002) 'B',xdt,f0,sum(s3) !3002 format(a1,f7.2,2f8.1) - call q65_avg(nutc,ntrperiod,LL,ntol,lclearave,xdt,f0,snr1,s3) + call q65_avg(nutc,ntrperiod,LL,nfqso,ntol,lclearave,xdt,f0,snr1,s3) endif endif diff --git a/widgets/mainwindow.cpp b/widgets/mainwindow.cpp index 2c06d6dd6..86f85d343 100644 --- a/widgets/mainwindow.cpp +++ b/widgets/mainwindow.cpp @@ -3498,6 +3498,8 @@ void MainWindow::readFromStdout() //readFromStdout if(SpecOp::FOX==m_config.special_op_id() and for_us and (audioFreq<1000)) bDisplayRight=true; if(SpecOp::FOX!=m_config.special_op_id() and (for_us or (abs(audioFreq - m_wideGraph->rxFreq()) <= 10))) bDisplayRight=true; } + if((abs(audioFreq - m_wideGraph->rxFreq()) <= ui->sbFtol->value()) and + m_mode=="Q65") bDisplayRight=true; } else { if((abs(audioFreq - m_wideGraph->rxFreq()) <= 10) and !m_config.enable_VHF_features()) bDisplayRight=true;