From b3f0aec4075fc0ff995b63256971b017fa255ced Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Fri, 30 Oct 2020 14:52:58 -0400 Subject: [PATCH] Q65: compute snr from esnodb, using actual symbol rate. --- lib/qra/q65/q65_loops.f90 | 7 ++++--- lib/qra/q65/q65_subs.c | 8 ++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/lib/qra/q65/q65_loops.f90 b/lib/qra/q65/q65_loops.f90 index 8fef412d4..f476ce0fc 100644 --- a/lib/qra/q65/q65_loops.f90 +++ b/lib/qra/q65/q65_loops.f90 @@ -69,7 +69,7 @@ subroutine q65_loops(c00,npts2,nsps,mode,mode64,nsubmode,nFadingModel, & ncall=ncall+1 call timer('qra64_de',0) call q65_intrinsics_ff(s3,nsubmode,b90,nFadingModel,s3prob) - call q65_dec(s3,s3prob,APmask,APsymbols,snr2,dat4,irc) + call q65_dec(s3,s3prob,APmask,APsymbols,esnodb,dat4,irc) ! irc > 0 ==> number of iterations required to decode ! -1 = invalid params ! -2 = decode failed @@ -84,8 +84,7 @@ subroutine q65_loops(c00,npts2,nsps,mode,mode64,nsubmode,nFadingModel, & a(1)=-f0 call twkfreq(c00,c0,npts2,6000.0,a) jpk=3000 !### These definitions need work ### -! if(nsps.ge.3600) jpk=4080 !### - if(nsps.ge.3600) jpk=6000 !### + if(nsps.ge.3600) jpk=6000 !### TR >= 60 s call spec64(c0,nsps,mode,mode64,jpk,s3,LL,NN) call pctile(s3,LL*NN,40,base) s3=s3/base @@ -100,6 +99,8 @@ subroutine q65_loops(c00,npts2,nsps,mode,mode64,nsubmode,nFadingModel, & if(irc.ge.0) then navg=nsave + baud=6000.0/nsps + snr2=esnodb - db(2500.0/baud) if(iavg.eq.0) navg=0 !### For tests only: open(53,file='fort.53',status='unknown',position='append') diff --git a/lib/qra/q65/q65_subs.c b/lib/qra/q65/q65_subs.c index ffd4c0385..b36adc540 100644 --- a/lib/qra/q65/q65_subs.c +++ b/lib/qra/q65/q65_subs.c @@ -77,14 +77,14 @@ void q65_intrinsics_ff_(float s3[], int* submode, float* B90, } void q65_dec_(float s3[], float s3prob[], int APmask[], int APsymbols[], - float* snr2500, int xdec[], int* rc0) + float* esnodb0, int xdec[], int* rc0) { /* Input: s3prob[LL,NN] Symbol-value intrinsic probabilities * APmask[13] AP information to be used in decoding * APsymbols[13] Available AP informtion * Output: - * snr2500 SNR_2500 of decoded signal, or lower limit + * esnodb0 Estimated Es/No in dB * xdec[13] Decoded 78-bit message as 13 six-bit integers * rc0 Return code from q65_decode() */ @@ -98,7 +98,7 @@ void q65_dec_(float s3[], float s3prob[], int APmask[], int APsymbols[], // rc = -1: Invalid params // rc = -2: Decode failed // rc = -3: CRC mismatch - *snr2500 = -31.0; + *esnodb0 = 0.0; //Default Es/No for a failed decode if(rc<0) return; rc = q65_esnodb_fastfading(&codec,&esnodb,ydec,s3); @@ -106,5 +106,5 @@ void q65_dec_(float s3[], float s3prob[], int APmask[], int APsymbols[], printf("error in q65_esnodb_fastfading()\n"); exit(0); } - *snr2500 = esnodb - 31.0; + *esnodb0 = esnodb; }