fixing issue in Viterbi when decoding zero codeword

it seems that when the input is only zero, the calculated max
becomes zero too. This causes a div by zero later in the
normalization (q->gain_quant/max).
master
Andre Puschmann 5 years ago
parent dca1be9157
commit 768ce745dc

@ -528,8 +528,7 @@ int srslte_viterbi_decode_f(srslte_viterbi_t *q, float *symbols, uint8_t *data,
len = 3 * (frame_length + q->K - 1);
}
if (!q->decode_f) {
float max = -9e9;
float max = 1e-9;
for (int i=0;i<len;i++) {
if (fabs(symbols[i]) > max) {
max = fabs(symbols[i]);

Loading…
Cancel
Save