Chapter 6: Turbo & LDPC Codes

For 45 years after Shannon's 1948 paper, the best known codes were still 3 dB or more from his theoretical limit. Then in 1993, Berrou et al. announced turbo codesβ€”a construction so close to Shannon capacity that many researchers suspected an error. This chapter explains how iterative decoding, sparse graph codes, and polar codes finally conquered the Shannon limit.

Turbo Codes

A turbo code (Berrou, Glavieux & Thitimajshima, 1993) uses two or more convolutional codes connected through an interleaver. The key breakthrough was the iterative (turbo) decoding algorithm that passes soft information back and forth between component decoders.

Parallel Concatenated Structure

The message \( u \) is fed to two recursive systematic convolutional (RSC) encoders. Encoder 2 receives a permuted (interleaved) copy \( \Pi(u) \).

The transmitted codeword is \( (u, v_1, v_2) \):

  • \( u \): systematic (message) bits
  • \( v_1 \): parity from RSC encoder 1
  • \( v_2 \): parity from RSC encoder 2 (on permuted input)

Rate: \( R = 1/3 \) (or higher with puncturing).

Iterative (BCJR) Decoding

Each component decoder computes Log-Likelihood Ratios (LLRs)using the BCJR (forward-backward) algorithm:

\( L(u_t) = \log \frac{P(u_t=1 \mid r)}{P(u_t=0 \mid r)} \)

Decoder 1 computes an extrinsic LLR, passes it (after interleaving) as a prior to Decoder 2. Decoder 2 returns its extrinsic LLR (after de-interleaving) to Decoder 1. After ~10 iterations, the combined LLR gives a near-MAP decision.

Why Does It Work? The "Turbo" Intuition

The interleaver breaks up burst errors. What looks like a strong constraint for one encoder is a spread-out, weak constraint for the other, and vice versa. As soft information passes between decoders, each iteration refines the estimate β€” like a turbocharger recycling exhaust energy.

The weight enumerator of a good turbo code has a large free distance growing with block length, ensuring exponentially decreasing error rate. Berrou's original code operated at \( E_b/N_0 = 0.7 \text{ dB} \) for BER \( 10^{-5} \)β€” just 0.5 dB from the Shannon limit at rate 1/3.

LDPC Codes & Tanner Graphs

Low-Density Parity-Check (LDPC) codes were invented by Gallager (1962) but ignored for 30 years. MacKay and Neal (1996) rediscovered them and showed they approach Shannon capacity under belief propagation (sum-product) decoding.

Definition

An LDPC code is a linear code defined by a sparseparity-check matrix \( H \). Each row has exactly \( d_c \) ones (check node degree); each column has exactly \( d_v \) ones (variable node degree).

Regular \( (d_v, d_c) \)-LDPC: all variable nodes have degree \( d_v \), all check nodes have degree \( d_c \). Rate: \( R = 1 - d_v/d_c \).

Sparsity means \( O(n) \) edges in the Tanner graph β€” enabling\( O(n) \) encoding and decoding complexity.

Belief Propagation (Sum-Product)

Messages are LLRs passed along Tanner graph edges. Each iteration:

  1. Variable β†’ check: Sum of all incoming check messages plus channel LLR, minus the receiving check's own message.
  2. Check β†’ variable: \( \tanh \)-product rule: \( L_{c \to v} = 2 \tanh^{-1}\!\bigl(\prod_{v' \neq v} \tanh(L_{v' \to c}/2)\bigr) \)
  3. Hard-decide on variable node marginals; stop if all parity checks satisfied.

Tanner Graph for a (3,6)-regular LDPC code β€” variable nodes (circles) connected to check nodes (squares)

v1v2v3v4v5v6v7c1c2c3c4Variable nodes (v) ↔ bit positions; Check nodes (c) ↔ parity constraintsVariableCheck

Why LDPC Codes Are Capacity-Achieving

Richardson & Urbanke (2001) proved via density evolutionthat LDPC codes with optimised degree distributions achieve the BEC (binary erasure channel) capacity exactly, and come within a small gap of AWGN capacity. The analysis tracks the distribution of LLR messages across iterations as \( n \to \infty \).

The EXIT chart (extrinsic information transfer) provides a visual tool: plotting check and variable node transfer curves, capacity-approaching codes correspond to configurations where the two curves just touch β€” a "turbo cliff" in BER performance.

Polar Codes β€” Provably Capacity-Achieving

Polar codes (ArΔ±kan, 2009) are the first family of error-correcting codes with a constructive, efficient proof of capacity achievementβ€” not just existential arguments. They exploit the phenomenon of channel polarisation.

Channel Polarisation

Apply the recursive Hadamard-like transform:

\( G_N = F^{\otimes \log_2 N}, \quad F = \begin{pmatrix} 1 & 0 \\ 1 & 1 \end{pmatrix} \)

After \( n = \log_2 N \) levels of combining and splitting, \( N \)copies of a B-DMC with capacity \( C \) polarise into:

  • \( CN \) near-perfect channels (capacity \( \approx 1 \))
  • \( (1-C)N \) near-useless channels (capacity \( \approx 0 \))

Encoding & Decoding

Frozen bits: Fix the \( (1-C)N \)bad channels to known constants (typically 0). Only transmit information on the \( CN \)good channels.

Encoding: \( x = u G_N \pmod{2} \), where\( u \) places data bits in good positions, frozen bits elsewhere. Complexity: \( O(N \log N) \).

Successive Cancellation (SC) Decoding: Decode bits sequentially, using already-decoded bits as side information for later decisions. Complexity: \( O(N \log N) \). SCL (list decoding) + CRC improves finite-length performance.

Capacity Achievement Theorem (ArΔ±kan)

For any B-DMC with capacity \( C \) and any \( \beta < 1/2 \):

\( P_e^{(N)} \leq O\!\left(2^{-N^\beta}\right) \quad \text{as } N \to \infty \)

The block error probability decays super-polynomially, and the rate approaches \( C \). Unlike turbo/LDPC, this is a rigorous proof that the code family is capacity-achieving, not an empirical observation.

Polar Codes in Practice: 5G NR

The 5G New Radio standard (3GPP Release 15, 2018) adopted polar codes for the control channel(PBCH, PUCCH, PDCCH) and LDPC codes for the data channel. Polar codes won due to superior short-block performance β€” an irony that Gallager's 1962 LDPC codes, forgotten for 30 years, now run alongside ArΔ±kan's 2009 polar codes in every modern smartphone.

Modern Codes: A Comparison

PropertyTurboLDPCPolar
Gap to Shannon limit~0.5 dB~0.1 dBProvably 0
Decoding algorithmBCJR + turbo iterationBelief propagationSuccessive cancellation (SC/SCL)
Encoder complexity\( O(n) \)\( O(n) \)\( O(n \log n) \)
Capacity proofEmpiricalDensity evolutionRigorous (ArΔ±kan)
Error floorYes (at very low BER)Yes (cycles in graph)None with SCL+CRC
Best for block sizeMedium (1k–10k)Large (>1k)Short–medium
Standard adoption3G UMTS, 4G LTE5G data, Wi-Fi, CCSDS5G control (NR)

Python: BER vs SNR β€” Uncoded, Hamming, and Repetition Codes

Simulate bit error rate (BER) performance over an AWGN channel for three schemes: uncoded BPSK, Hamming(7,4), and a rate-1/3 repetition code with majority-vote decoding. Visualise BER curves and the coding gain achieved by each scheme at a target BER of 10⁻³.

Python
script.py186 lines

Click Run to execute the Python code

Code will be executed with Python 3 on the server