HRv1 error flags » History » Revision 2
« Previous |
Revision 2/7
(diff)
| Next »
falconia, 07/22/2024 07:50 PM
HRv1 error flags¶
On TCH/F channels for FR and EFR, the channel decoder produces only one Boolean error flag: BFI, Bad Frame Indicator. It indicates whether the decoded frame should be regarded as good or bad - see BFI criteria page. For TCH/HS there are two officially defined error flags per frame: BFI and UFI, the latter being Unreliable Frame Indicator. The TRAU-UL frame format of GSM 08.61 carries both BFI and UFI. However, a more thorough review of the available evidence from ETSI and from one concrete vendor implementation (TI Calypso DSP) indicates that the original design for TCH/HS channel decoding exhibits a total of three error flags: BFI, UFI and BCI. The meaning of the latter acronym is unknown; one possible meaning might be Bad Channel Indicator.
Evidence for BCI in ETSI reference code¶
The venerable GSM 06.06 code drop includes a utility named REID, which stands for Residual Error Insertion Device. This program is not a part of the speech codec proper (neither encoder nor decoder), hence the functions implemented therein will not be found in a TRAU, for example. Instead this program simulates the radio leg from the output of the speech encoder on the Tx end to Rx DTX handler input on the receiving end; in the context of codec testing, the input to REID is the output of the encoder process and the output from REID serves as decoder input test sequences. The published version simulates only error-free transmission, but the code is structured to facilitate true simulation of channel errors. (This situation makes one wonder if perhaps the original developers of GSM-HR codec started out with a REID program that included error simulation, but then it was sanitized for publication.)
This REID source includes a function (swSidDetection
) that implements ternary SID classification of GSM 06.41 section 6.1.1 - the latter spec also refers to this C code, but declares it to be an example, rather than normative. However, if we look at the body of this function, we see an interesting oddity: one of the bit-counting thresholds for SID classification depends on a mystery error flag from the channel decoder. As we take a closer look at the interface to this function and the code comments in two different places (see lines 154-156 and 808-809), we see that the channel decoder puts out 3 error flags: BFI, UFI and BCI. We know BFI and UFI - they are defined in GSM 06.41 spec and included in the TRAU-UL interface of GSM 08.61 - but what is BCI?
It appears that BCI flag was omitted from the interoperable interface of GSM 08.61 (and from chapter 6 of GSM 06.41, which defines an equivalent interface in more abstract terms, also applicable to MS implementations) because it has no effect on the Rx DTX handler: its only effect is on the swSidDetection
function or its equivalent in hardware/DSP implementations.
TI Calypso DSP¶
This article describes a nifty feature of this DSP whereby we can see all TCH DL frames passing across the interface depicted at the top of chapter 6 (Rx functions) of GSM 06.31, 06.41 and 06.81 specs. The status word in a_dd_0[0]
(or a_dd_1[0]
for TCH/H subchannel 1) is particularly interesting in that it carries all of the various metadata flags, similar to control flags on GSM 08.60/08.61 on the network side, but adapted by TI for their MS implementation. Of course there is no documentation, and the meaning of each bit had to be reverse-engineered by empirical observation - but this reverse eng has been done, and we know this bit meaning now.
In the case of TCH/FS and TCH/EFS, bit 2 is BFI, while bits 1 and 0 are unused (always seen as 0). However, in the case of TCH/HS, all 3 error flags are present:
- bit 2 is BFI
- bit 1 is BCI
- bit 0 is UFI
Bits [4:3]
encode the ternary SID flag (just like bits C13 & C14 in 16 kbit/s TRAU-UL frames) for all 3 codecs. For FR and EFR the bit counting rules are those prescribed in GSM 06.31 and 06.81 specs, but in the case of TCH/HS, experiments reveal that TI's DSP does implement exactly the same logic as in ETSI's non-normative example code. Furthermore, the threshold of 11 or 16 not-matching bits changes per the BCI flag exactly like in ETSI's version!
Updated by falconia 26 days ago · 2 revisions