Field Guide · algorithm

Also known as: TCH/S, TETRA speech channel coding, full-rate traffic channel

TETRA TCH/S (Traffic Channel / Speech, full rate) is the channel coding that carries a TETRA voice call.1 The ACELP vocoder produces a 137-bit speech frame every 30 ms; one transmission slot carries two such frames coded together into 432 on-air bits.2 The coding is unequal error protection: the 137 bits are ranked by how much a bit error hurts perceived speech, sorted into three sensitivity classes, and each class is protected proportionally to its importance.

2 × 137 ACELP bits class0 102 class1 112 class2 60 +CRC8 +tail4 uncoded 102 RCPC 8/12→ 168 RCPC 8/18→ 162 24 × 18 interleave432 type-3 → type-4 102 + 168 + 162 = 432 type-3 bits per slot
Each slot's two 137-bit frames are reordered into three sensitivity classes; class 2 gains an 8-bit CRC and is coded most heavily, class 1 lightly, class 0 not at all, and the 432 type-3 bits are spread across a 24×18 interleaver.

Class split and coding

Reordered into type-2 order (EN 300 395-2 Table 5), the two frames’ 274 speech bits group as class 0 (102 bits — 2×51 of the least sensitive), class 1 (112 bits — 2×56), and class 2 (60 bits — 2×30, the most sensitive). An 8-bit CRC and 4 tail bits follow class 2. The three classes are coded differently:

  • Class 0 is sent uncoded — its bits map straight into the output.
  • Class 1 is RCPC-coded at rate 8/12, expanding 112 bits to 168.
  • Class 2 + CRC + tail are RCPC-coded at rate 8/18, expanding the 72 bits to 162.

Both coded regions come from one continuous K=5 rate-1/3 mother stream, punctured to the two different rates. The result — 102 + 168 + 162 = 432 type-3 bits — is then permuted by a 24×18 block interleaver (C4(i·24+j) = C3(j·18+i), reading the matrix column by column) to type-4, and scrambled to the type-5 bits carried on air as BKN1 + BKN2 around the slot’s training sequence.

The class-2 CRC trap

The 8-bit class-2 CRC (§5.5.1) is the gate the decoder uses to accept or reject a burst — and its definition is a landmine. It is not a cyclic G(X) LFSR CRC. Each of the 8 CRC bits is the even parity (XOR) of the class-2 bits at a fixed set of ranks — a fixed parity-check matrix, verbatim the ETSI reference codec’s TAB_CRC1..8 tables. An earlier G(X) = 1 + X³ + X⁷ approximation looked plausible and passed synthetic encode-decode round-trips (it set the bits the same wrong way on both ends), but it did not match on-air frames, so every real TCH/S burst failed the CRC and was silently dropped. This is the canonical “self-consistent bug”: the vocoder unit tests passed while no live voice decoded, because the fault was in the channel coding, not the codec.

Soft-decision path

GopherTrunk decodes TCH/S soft-decision: the receiver’s per-symbol differentials become type-5 LLRs, descrambled and deinterleaved in the soft domain, soft-depunctured into the mother stream, and run through a soft Viterbi decoder before the hard class-2 CRC check. The class-0 bits, being uncoded, are hard-sliced straight from their LLRs. The soft path recovers roughly 2 dB of coding gain the hard slicer discards, which on a marginal same-carrier call is the difference between a clean recording and a short, garbled one — it is what fixed the same-carrier voice-follow captures.

Relevance to SDR

internal/radio/tetra/tch.go implements the chain both ways — DecodeTCHS / TCHSpeechFrames (hard) and DecodeTCHSSoft / TCHSpeechFramesSoft (soft) — and tch_tables.go holds the generated type-2 bit order and the tchCRCTaps parity matrix. The CRC gate also does double duty as a slot demux on a single-carrier system: a burst that is not TCH/S speech descrambles to essentially random class-2 bits and passes the 8-bit CRC only about 1 in 256 times, so a passing CRC reliably isolates the granted call’s speech from the other TDMA timeslots’ bursts. The 137-bit frames it recovers feed the clean-room ACELP vocoder in internal/voice/acelp.

Sources

  1. Terrestrial Trunked Radio — Wikipedia, on the TETRA voice traffic channel. 

  2. Algebraic code-excited linear prediction — Wikipedia, on the ACELP speech coder whose frames TCH/S carries. 

See also