Topic hub

Channel coding

How forward error correction lets a link run close to the Shannon limit. Block and convolutional codes, turbo, LDPC and polar codes, soft decoding, which code 5G NR uses on which channel, and HARQ.

Updated 15 Nov 2026 · forward error correction, convolutional code, turbo code, LDPC code, polar code, soft decoding, HARQ, TS 38.212

Overview

Channel coding adds structured redundancy so that a receiver can correct the errors noise and fading cause. It is the reason a modern link can work a few dB from the Shannon bound instead of the 10 dB or more an uncoded link needs. Coding gain is the cheapest gain in a radio. It costs processing and some rate, but no transmit power, spectrum or antenna area.

This hub covers the families of codes that matter in practice, how decoders use soft information, and how cellular systems combine coding with retransmission. It is for engineers who need to know why a standard picked a particular code, what the decoder in their chipset or FPGA is doing, or how to simulate a coded link honestly.

Key ideas

Redundancy, rate and soft decisions

A code maps K information bits to N coded bits, giving a code rate R = K/N. The redundancy lets the decoder find the most likely transmitted codeword even when some bits are wrong. Hamming’s 1950 codes correct single errors in short blocks. Cyclic redundancy checks (CRCs) only detect errors, and every cellular transport block carries one so the receiver knows whether decoding succeeded.

The largest practical gain comes from soft decisions. Instead of hard 0s and 1s, the demodulator passes a log-likelihood ratio (LLR) per bit: its sign is the likely value and its magnitude the confidence. Soft-decision decoding performs measurably better than hard decisions, and the advantage grows on fading channels where some bits arrive much weaker than others.

Convolutional and turbo codes

A convolutional code passes the bit stream through a shift register and outputs parity bits that depend on the current and recent inputs. Viterbi’s 1967 algorithm decodes it by finding the most likely path through the code’s trellis, with complexity that grows with the number of states rather than the message length. Convolutional codes are still used for short control messages.

Turbo codes, presented by Berrou, Glavieux and Thitimajshima in 1993, concatenate two convolutional encoders through an interleaver. Their decoders exchange soft information iteratively, and the original paper reported performance near the Shannon limit. LTE adopted them. In 3GPP TS 36.212 (Release 19 version), LTE uses rate 1/3 turbo coding for its shared, paging and multicast data channels, and rate 1/3 tail-biting convolutional coding for the broadcast channel and downlink control information.

LDPC and polar codes in 5G NR

Low-density parity-check (LDPC) codes, proposed by Gallager in 1962 and revived by MacKay and Neal in 1996, are defined by a sparse parity-check matrix. Belief-propagation decoders pass messages along its edges and parallelise well, which suits the high throughputs of NR. Polar codes, introduced by Arıkan in 2009, provably achieve capacity on symmetric binary-input memoryless channels with low-complexity encoding and decoding. At short block lengths they are decoded with successive-cancellation list decoders aided by a CRC.

In 3GPP TS 38.212 (Release 19 version), NR uses LDPC for the uplink and downlink shared channels and the paging channel. Two base graphs cover different block sizes and rates: base graph 1 has a maximum code block size of 8448 bits and base graph 2 of 3840 bits. Polar codes protect the broadcast channel, downlink control information, and uplink control information of 12 bits or more. Uplink control information of up to 11 bits uses small block codes.

NR DL-SCH coding chaintransport blockcode blocksBG1 or BG2circular bufferQAM symbolsTB CRCsegmentLDPCrate matchconcatenatemodulatechannelsoft combineLDPC decode, CRC checkNACK: retransmitwith next RVACK: next blockother NR channelsBCH and DCI: polar codeUCI: small block code or polar
The NR downlink shared channel coding chain in TS 38.212, with HARQ. A CRC is attached to the transport block, which is split into code blocks with their own CRCs, LDPC encoded, rate matched from a circular buffer at the start point set by the redundancy version and concatenated. Scrambling and modulation follow as TS 38.211 specifies. If decoding fails, the receiver sends a NACK and the transmitter sends another redundancy version, which the receiver combines with what it already holds. Control channels use polar or small block codes instead.

HARQ

Hybrid automatic repeat request (HARQ) combines coding with retransmission. The transmitter sends a coded block and keeps it. If the CRC fails, the receiver keeps its soft values and sends a negative acknowledgement. The retransmission is combined with the stored values before decoding again. With chase combining every retransmission is identical. With incremental redundancy each one carries different coded bits, so the effective code rate falls with each attempt.

TS 38.300 describes NR HARQ as asynchronous incremental redundancy. The rate matcher writes the LDPC output into a circular buffer, and the redundancy version, 0 to 3, sets where reading starts. TS 38.214 supports up to 16 HARQ processes per cell in each direction, or 32 where the UE supports it, so the link keeps sending new data while earlier blocks wait for acknowledgement. Because HARQ catches residual errors, link adaptation does not aim for zero errors. With the usual CQI tables in TS 38.214, the UE reports the highest CQI whose transport block error probability would not exceed 0.1.

Where to start

The beginner track covers the modulation and noise behind coding: read /learn/beginner/04-noise-snr-and-capacity/ and /learn/beginner/05-digital-modulation/ first. The project /projects/qpsk-modem-ber/ gives you an uncoded baseline to compare coded links against. Intermediate lessons on convolutional, LDPC and polar decoding are in preparation. Keep /reference/capacity-and-spectral-efficiency/ and the 3GPP spec map to hand.

Tools and platforms

Tool What it is for Licence Platform
AFF3CT Fast C++ simulation of LDPC, polar, turbo, convolutional, BCH and Reed-Solomon codes MIT /platforms/opensource/
Sionna 5G NR LDPC and polar encoders and decoders in a link-level simulator Apache-2.0 /platforms/opensource/
CommPy Convolutional encoder, Viterbi and MAP decoders, turbo codes, LDPC belief propagation in Python BSD-3-Clause /platforms/opensource/
GNU Radio fec module Convolutional, LDPC and polar encoders and decoders as streaming blocks GPL-3.0 /platforms/gnuradio/

For decoder hardware, FPGA Guide covers the arithmetic in its DSP on FPGA hub.

Common mistakes

  • Comparing coded and uncoded curves against SNR per symbol instead of Eb/N0, which hides the rate penalty.
  • Feeding a soft decoder LLRs with the wrong sign convention or scaling. Check with a noiseless input first.
  • Simulating too few blocks to see the error floor of an LDPC or turbo code.
  • Quoting block error rate and bit error rate interchangeably.
  • Assuming an LDPC decoder from one standard works for another. The parity-check matrices differ.

Going deeper

Recent papers

  • Optimization of Finite Alphabet Message Passing Decoding on Fully Node-Parallel Architectures for 5G LDPC Codes

    A. von Bank, O. Griebel, E.-M. Edelmann et al. · arXiv cs.IT · digest

    Finite-alphabet LDPC decoders replace arithmetic in the message updates with small lookup tables, which saves wires and power in fully parallel hardware. The authors design these tables with Bayesian optimisation against frame error rate, without assuming a channel or modulation, and produce one set of tables used in every iteration. For the (1000, 500) base graph 2 5G NR LDPC code on a simulated binary-input AWGN channel, the decoder matched a normalised min-sum decoder in error rate. After synthesis and place and route in a 12 nm FinFET process, it reached 21.6 Gbit/s at 15.36 pJ/bit against 25.02 pJ/bit for min-sum, a 38.6% gain in energy efficiency. These are post-layout estimates for one code, not measured silicon.