diff --git a/lib/qra/q65/q65.c b/lib/qra/q65/q65.c index c91571ba6..9c8544ffb 100644 --- a/lib/qra/q65/q65.c +++ b/lib/qra/q65/q65.c @@ -681,8 +681,7 @@ int q65_decode_fullaplist(q65_codec_ds *codec, int k; int nK, nN, nM; - float llh; - float maxllh = Q65_LLH_THRESHOLD-1; // set to a value less than the threshold + float llh, maxllh, llh_threshold; int maxcw = -1; // index of the most likely codeword const int *pCw; @@ -693,6 +692,12 @@ int q65_decode_fullaplist(q65_codec_ds *codec, nN = q65_get_codeword_length(codec); nM = q65_get_alphabet_size(codec); + // we adjust the llh threshold in order to mantain the + // same false decode rate independently from the size + // of the list + llh_threshold = Q65_LLH_THRESHOLD + logf(1.0f*nCodewords/3); + maxllh = llh_threshold; // at least one llh should be larger than the threshold + // compute codewords log likelihoods and find max pCw = pCodewords; // start from the first codeword for (k=0;k>6); } - - diff --git a/lib/qra/q65/q65.h b/lib/qra/q65/q65.h index 2e764a32b..1962509a3 100644 --- a/lib/qra/q65/q65.h +++ b/lib/qra/q65/q65.h @@ -34,7 +34,7 @@ // Verify loglikelihood after successful decoding #define Q65_CHECKLLH // Max codeword list size in q65_decode_fullaplist -#define Q65_FULLAPLIST_SIZE 64 +#define Q65_FULLAPLIST_SIZE 256 // maximum number of weights for the fast-fading metric evaluation #define Q65_FASTFADING_MAXWEIGTHS 65