From 2bfeaf813cbfdab495d44b55999df1556d7bc9ed Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Tue, 9 Apr 2013 20:59:53 +0000 Subject: [PATCH] 1. Fix end-of-transmission logic so that CW ID works again. 2. Much better logic for choosing frequencies at which to attempt decodes. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3143 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- lib/decode9.f90 | 2 +- lib/decoder.f90 | 7 +++++-- mainwindow.cpp | 2 +- soundout.cpp | 10 ++++++++-- 4 files changed, 15 insertions(+), 6 deletions(-) diff --git a/lib/decode9.f90 b/lib/decode9.f90 index 95b446add..030671838 100644 --- a/lib/decode9.f90 +++ b/lib/decode9.f90 @@ -71,7 +71,7 @@ subroutine decode9(i1SoftSymbols,limit,nlim,msg) call fano232(i1SoftSymbols,nbits+31,mettab,ndelta,limit,i1DecodedBytes, & ncycles,metric,ierr) - nlim=ncycles/nbits + nlim=ncycles/(nbits+31) if(ncycles.lt.(nbits*limit)) then nbytes=(nbits+7)/8 do i=1,nbytes diff --git a/lib/decoder.f90 b/lib/decoder.f90 index 95f10464f..a56193fd1 100644 --- a/lib/decoder.f90 +++ b/lib/decoder.f90 @@ -59,7 +59,6 @@ subroutine decoder(ss,c0) idf=ntol/df3 + 0.999 do nqd=1,0,-1 - limit=5000 ccflim=4.0 if(ndepth.ge.2) then @@ -110,7 +109,8 @@ subroutine decoder(ss,c0) do i=ia,ib f=(i-1)*df3 - if(.not.ccfok(i)) cycle + if(.not.ccfok(i) .or. ccfred(i).lt.ccflim-1.0 .or. & + ccfred(i).lt.ccfred(i+1)) cycle if(nqd.eq.1 .or. & (ccfred(i).ge.3.0 .and. abs(f-fgood).gt.10.0*df8)) then call timer('decode9a',0) @@ -122,6 +122,8 @@ subroutine decoder(ss,c0) call timer('decode9 ',0) call decode9(i1SoftSymbols,limit,nlim,msg) +! write(69,3300) nqd,i,f+1000.0,ccflim,ccfred(i),limit,nlim,msg(1:18) +!3300 format(i1,i6,f10.3,2f8.1,2i9,2x,a18) call timer('decode9 ',1) sync=(syncpk+1)/4.0 @@ -149,6 +151,7 @@ subroutine decoder(ss,c0) 1010 format('',2i4) call flush(6) close(13) +! call flush(69) call timer('decoder ',1) if(nstandalone.eq.0) call timer('decoder ',101) diff --git a/mainwindow.cpp b/mainwindow.cpp index 818747f65..4e32b385b 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1,4 +1,4 @@ -//------------------------------------------------------------- MainWindow +//-------------------------------------------------------------- MainWindow #include "mainwindow.h" #include "ui_mainwindow.h" #include "devsetup.h" diff --git a/soundout.cpp b/soundout.cpp index bb208f236..759595956 100644 --- a/soundout.cpp +++ b/soundout.cpp @@ -92,7 +92,10 @@ extern "C" int d2aCallback(const void *inputBuffer, void *outputBuffer, return paContinue; } - if(isym>=85 and itone[0]>=0) return paComplete; + if(isym>=85 and icw[0]>=0) { +// qDebug() << "C" << isym << icw[0]; + return paComplete; + } baud=12000.0/udata->nsps; freq=udata->ntxfreq + itone[isym]*baud; dphi=twopi*freq/48000.0; @@ -118,7 +121,10 @@ extern "C" int d2aCallback(const void *inputBuffer, void *outputBuffer, #endif ic++; } - if(amp<1.0 and itone[0]>=0) return paComplete; + if(amp<1.0 and icw[0]==0) { +// qDebug() << "A" << isym << amp << icw[0]; + return paComplete; + } return paContinue; }