From d2e160005330b192d6f69499aa60c67c42663a39 Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Tue, 16 Jan 2018 09:57:45 +0100 Subject: [PATCH] Updated viterbi 16-bit scaling --- lib/src/phy/fec/viterbi.c | 6 +++--- lib/src/phy/fec/viterbi37_avx2_16bit.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/src/phy/fec/viterbi.c b/lib/src/phy/fec/viterbi.c index 9edcb52c0..25d77ef36 100644 --- a/lib/src/phy/fec/viterbi.c +++ b/lib/src/phy/fec/viterbi.c @@ -42,7 +42,7 @@ #define DEFAULT_GAIN 100 -#define DEFAULT_GAIN_16 10000 +#define DEFAULT_GAIN_16 1000 #define VITERBI_16 #ifndef LV_HAVE_AVX2 @@ -423,7 +423,7 @@ int init37_avx2_16bit(srslte_viterbi_t *q, int poly[3], uint32_t framebits, bool q->R = 3; q->framebits = framebits; q->gain_quant_s = 4; - q->gain_quant = DEFAULT_GAIN; + q->gain_quant = DEFAULT_GAIN_16; q->tail_biting = tail_biting; q->decode_s = decode37_avx2_16bit; q->free = free37_avx2_16bit; @@ -537,7 +537,7 @@ int srslte_viterbi_decode_f(srslte_viterbi_t *q, float *symbols, uint8_t *data, } } #ifdef VITERBI_16 - srslte_vec_quant_fus(symbols, q->symbols_us, DEFAULT_GAIN_16/max, 32767.5, 65535, len); + srslte_vec_quant_fus(symbols, q->symbols_us, q->gain_quant/max, 32767.5, 65535, len); return srslte_viterbi_decode_us(q, q->symbols_us, data, frame_length); #else srslte_vec_quant_fuc(symbols, q->symbols_uc, q->gain_quant/max, 127.5, 255, len); diff --git a/lib/src/phy/fec/viterbi37_avx2_16bit.c b/lib/src/phy/fec/viterbi37_avx2_16bit.c index cda292017..913b6a82e 100644 --- a/lib/src/phy/fec/viterbi37_avx2_16bit.c +++ b/lib/src/phy/fec/viterbi37_avx2_16bit.c @@ -301,7 +301,7 @@ void update_viterbi37_blk_avx2_16bit(void *p, unsigned short *syms, int nbits, u } // See if we need to normalize - if (vp->new_metrics->c[0] > 25600) { + if (vp->new_metrics->c[0] > 12288) { int i; uint16_t adjust;