Attention is currently required from: pespin. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/28176 )
Change subject: coding: add gsm0503_detect_a[fh]s_dtx_frame2() ......................................................................
Patch Set 2:
(1 comment)
Commit Message:
https://gerrit.osmocom.org/c/libosmocore/+/28176/comment/98ae6b67_77c49aad PS2, Line 14: Converting to hard-bits is not really needed.
Why? I see you now moved the conversion inside the implementation. […]
Initially I was planning to simplify the code to calculate a sum of all soft-bits, so that we could avoid conditionals in the loops. Basically id_marker[]s would contain multipliers: -1 (for bit 1) and +1 (for bit 0), so then:
sum = 0 for (...) sum -= *sbits * id_marker[k];
if (sum >= (n_bits * 127 * 0.8)) /* tolerate up to 20% bit errors */
This works fine, unless you want to calculate BER. You cannot just do:
max = n_bits * 127 n_errors = (sum - max) / 127
Because this is not accurate at all. So we still have to convert to hard-bits for the BER calculation. I believe doing this in the same loop (where we match the marker) is better. Also this allows us to handle soft-bit value 0 properly (see my other comment).
I can clarify the commit message.