From 94c31572d25abda67e1de9d6acd66badb4eb9e75 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Tue, 23 Feb 2021 16:13:46 -0500 Subject: [PATCH] More tweaks to the Fast/Normal/Deep parameters. --- UnitTests.txt | 8 ++++++++ lib/q65_decode.f90 | 16 +++++++++------- lib/qra/q65/q65.c | 6 ++++-- lib/qra/q65/q65.f90 | 4 ++-- lib/qra/q65/q65.h | 11 ++++++----- lib/qra/q65/q65_loops.f90 | 8 ++++---- lib/qra/q65/q65_subs.c | 5 +++-- 7 files changed, 36 insertions(+), 22 deletions(-) diff --git a/UnitTests.txt b/UnitTests.txt index 4c506dc70..d424738c6 100644 --- a/UnitTests.txt +++ b/UnitTests.txt @@ -6,10 +6,18 @@ RxFreq: 1000/10 Commit No_AP MyCall BothCalls ----------------------------------------------- ef4787: 3 10 6 14 30 33 +ef4787: 1 3 8 85 +ef4787: 3 3 8* 286 ada5a6: 3 6 6 10 29 36 10f574: 2 7 97.6 6 10 95.4 21 33 80.7 b8ea4c: 2 7 100.5 6 10 96.9 21 33 81.0 a6779e: 3 1 6 95.2 6 11 90.1 21 33 67.3 +767f53: 1 1 5 116 6 10 85 21 32 59 +767f53: 2 2 7 301 6 10 241 21 33 168 +767f53: 3 2 7 334 6 10 283 21 33 194 +0765a1: 1 1 5 61 6 10 56 21 33 39 +0765a1: 2 2 7 205 6 12 183 21 34 126 +0765a1: 3 2 7 234 6 12 209 21 34 152 Mode: Q65-30A Data: 30A_N0AN_6m_Ionoscatter (69 files, 6m ionoscatter) diff --git a/lib/q65_decode.f90 b/lib/q65_decode.f90 index 6b4ce922a..8140036f7 100644 --- a/lib/q65_decode.f90 +++ b/lib/q65_decode.f90 @@ -112,14 +112,17 @@ contains baud=12000.0/nsps this%callback => callback nFadingModel=1 + maxiters=50 ibwa=max(1,int(1.8*log(baud*mode_q65)) + 1) ibwb=min(10,ibwa+3) if(iand(ndepth,3).ge.2) then ibwa=max(1,int(1.8*log(baud*mode_q65)) + 1) ibwb=min(10,ibwa+5) + maxiters=75 else if(iand(ndepth,3).eq.3) then ibwa=max(1,ibwa-1) ibwb=min(10,ibwb+1) + maxiters=100 endif ! Generate codewords for full-AP list decoding @@ -241,12 +244,12 @@ contains if(c6.eq.' ') c6=' ' c4=hisgrid(1:4) if(c4.eq.' ') c4=' ' - fmt='(i6.4,1x,a4,5i2,5i3,f6.2,f7.1,f7.2,f6.1,f6.2,'// & + fmt='(i6.4,1x,a4,4i2,6i3,i4,f6.2,f7.1,f6.1,f6.2,'// & '1x,a6,1x,a6,1x,a4,1x,a)' if(ntrperiod.le.30) fmt(5:5)='6' if(idec.eq.3) nrc=0 - write(22,fmt) nutc,cmode,nQSOprogress,idec,ndist,idf,idt,ibw, & - nused,icand,ncand,nrc,xdt,f0,db(snr1),snr2,tdecode, & + write(22,fmt) nutc,cmode,nQSOprogress,idec,idf,idt,ibw,ndist, & + nused,icand,ncand,nrc,ndepth,xdt,f0,snr2,tdecode, & mycall(1:6),c6,c4,trim(decoded) close(22) endif @@ -323,13 +326,12 @@ contains if(c6.eq.' ') c6=' ' c4=hisgrid(1:4) if(c4.eq.' ') c4=' ' - fmt='(i6.4,1x,a4,5i2,5i3,f6.2,f7.1,f7.2,f6.1,f6.2,'// & + fmt='(i6.4,1x,a4,4i2,6i3,i4,f6.2,f7.1,f6.1,f6.2,'// & '1x,a6,1x,a6,1x,a4,1x,a)' - if(ntrperiod.le.30) fmt(5:5)='6' if(idec.eq.3) nrc=0 - write(22,fmt) nutc,cmode,nQSOprogress,idec,ndist,idf,idt,ibw, & - nused,icand,ncand,nrc,xdt,f0,db(snr1),snr2,tdecode, & + write(22,fmt) nutc,cmode,nQSOprogress,idec,idf,idt,ibw,ndist, & + nused,icand,ncand,nrc,ndepth,xdt,f0,snr2,tdecode, & mycall(1:6),c6,c4,trim(decoded) close(22) endif diff --git a/lib/qra/q65/q65.c b/lib/qra/q65/q65.c index f47f25fa3..f7701792f 100644 --- a/lib/qra/q65/q65.c +++ b/lib/qra/q65/q65.c @@ -522,7 +522,9 @@ int q65_esnodb_fastfading( } -int q65_decode(q65_codec_ds *pCodec, int* pDecodedCodeword, int *pDecodedMsg, const float *pIntrinsics, const int *pAPMask, const int *pAPSymbols) +int q65_decode(q65_codec_ds *pCodec, int* pDecodedCodeword, int *pDecodedMsg, + const float *pIntrinsics, const int *pAPMask, + const int *pAPSymbols, const int maxiters) { const qracode *pQraCode; float *ix, *ex; @@ -579,7 +581,7 @@ int q65_decode(q65_codec_ds *pCodec, int* pDecodedCodeword, int *pDecodedMsg, co rc = qra_extrinsic( pQraCode, ex, ix, - 100, + maxiters, pCodec->qra_v2cmsg, pCodec->qra_c2vmsg); diff --git a/lib/qra/q65/q65.f90 b/lib/qra/q65/q65.f90 index 51830ec8f..e79f48d83 100644 --- a/lib/qra/q65/q65.f90 +++ b/lib/qra/q65/q65.f90 @@ -11,7 +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,ndist + integer idf,idt,ibw,ndist,maxiters integer istep,nsmo,lag1,lag2,npasses,nused,iseq,ncand,nrc integer i0,j0 integer navg(0:1) @@ -516,7 +516,7 @@ subroutine q65_dec2(s3,nsubmode,b90ts,esnodb,irc,dat4,decoded) nFadingModel=1 decoded=' ' call q65_intrinsics_ff(s3,nsubmode,b90ts,nFadingModel,s3prob) - call q65_dec(s3,s3prob,APmask,APsymbols,esnodb,dat4,irc) + call q65_dec(s3,s3prob,APmask,APsymbols,maxiters,esnodb,dat4,irc) if(sum(dat4).le.0) irc=-2 nrc=irc if(irc.ge.0) then diff --git a/lib/qra/q65/q65.h b/lib/qra/q65/q65.h index 9e3d79adb..d0a04d4e9 100644 --- a/lib/qra/q65/q65.h +++ b/lib/qra/q65/q65.h @@ -75,11 +75,12 @@ int q65_intrinsics_fastfading(q65_codec_ds *pCodec, int q65_decode(q65_codec_ds *pCodec, - int* pDecodedCodeword, - int *pDecodedMsg, - const float *pIntrinsics, - const int *pAPMask, - const int *pAPSymbols); + int* pDecodedCodeword, + int *pDecodedMsg, + const float *pIntrinsics, + const int *pAPMask, + const int *pAPSymbols, + const int maxiters); int q65_decode_fullaplist(q65_codec_ds *codec, int *ydec, diff --git a/lib/qra/q65/q65_loops.f90 b/lib/qra/q65/q65_loops.f90 index 1028a8e44..6d9e24122 100644 --- a/lib/qra/q65/q65_loops.f90 +++ b/lib/qra/q65/q65_loops.f90 @@ -26,13 +26,13 @@ subroutine q65_loops(c00,npts2,nsps2,nsubmode,ndepth,jpk0, & idfmax=3 idtmax=3 ibw0=(ibwa+ibwb)/2 - maxdist=2 + maxdist=5 if(iand(ndepth,3).ge.2) then idfmax=5 idtmax=5 - maxdist=3 + maxdist=10 endif - if(iand(ndepth,3).eq.3) maxdist=4 + if(iand(ndepth,3).eq.3) maxdist=15 LL=64*(mode_q65+2) napmin=99 @@ -58,7 +58,7 @@ subroutine q65_loops(c00,npts2,nsps2,nsubmode,ndepth,jpk0, & where(s3(1:LL*NN)>s3lim) s3(1:LL*NN)=s3lim call q65_bzap(s3,LL) !Zap birdies do ibw=ibwa,ibwb - ndist=sqrt(float(ndf**2 + ndt**2 + (ibw-ibw0)**2)) + ndist=ndf**2 + ndt**2 + (ibw-ibw0)**2 if(ndist.gt.maxdist) cycle b90=1.72**ibw if(b90.gt.345.0) cycle diff --git a/lib/qra/q65/q65_subs.c b/lib/qra/q65/q65_subs.c index e55fe927d..4311ba392 100644 --- a/lib/qra/q65/q65_subs.c +++ b/lib/qra/q65/q65_subs.c @@ -77,7 +77,7 @@ void q65_intrinsics_ff_(float s3[], int* submode, float* B90Ts, } void q65_dec_(float s3[], float s3prob[], int APmask[], int APsymbols[], - float* esnodb0, int xdec[], int* rc0) + int* maxiters0, float* esnodb0, int xdec[], int* rc0) { /* Input: s3[LL,NN] Symbol spectra @@ -93,8 +93,9 @@ void q65_dec_(float s3[], float s3prob[], int APmask[], int APsymbols[], int rc; int ydec[63]; float esnodb; + int maxiters=*maxiters0; - rc = q65_decode(&codec,ydec,xdec,s3prob,APmask,APsymbols); + rc = q65_decode(&codec,ydec,xdec,s3prob,APmask,APsymbols,maxiters); *rc0=rc; // rc = -1: Invalid params // rc = -2: Decode failed