Sum-Product for LDPC Decoding

LDPC Decoding as Canonical Sum-Product

Low-density parity-check codes are the test case for loopy BP. Their Tanner graphs are bipartite, locally tree-like for large block lengths, and enforced to have girth β‰₯6\geq 6 by code design. These are exactly the conditions under which loopy BP shines.

The point of this section is to instantiate the general sum-product rules on the specific factor graph of an LDPC code, derive the log-domain message updates, and understand why the algorithm achieves capacity-approaching performance. We will also introduce density evolution β€” the asymptotic tool that predicts the decoding threshold without simulation.

Definition:

LDPC Factor Graph

An (N,K)(N, K) LDPC code has a parity-check matrix H∈F2(Nβˆ’K)Γ—N\mathbf{H} \in \mathbb{F}_2^{(N-K) \times N}. Its Tanner graph has:

  • Variable nodes {x1,…,xN}\{x_1, \ldots, x_N\}, one per code bit.
  • Check nodes {c1,…,cNβˆ’K}\{c_1, \ldots, c_{N-K}\}, one per parity check.
  • Edge (xi,cm)(x_i, c_m) iff Hm,i=1\mathbf{H}_{m,i} = 1. The posterior given channel observations y\mathbf{y} is p(x∣y)∝∏i=1Np(yi∣xi)β‹…βˆm=1Nβˆ’K1{xβˆ‚cmΒ satisfiesΒ checkΒ m}.p(\mathbf{x}|\mathbf{y}) \propto \prod_{i=1}^N p(y_i | x_i) \cdot \prod_{m=1}^{N-K} \mathbb{1}\{x_{\partial c_m} \text{ satisfies check } m\}.

The channel likelihood factors are unary (attached to each variable); the parity-check factors are dcd_c-ary (degree equals check degree). LDPC-BP alternates updates between variable nodes (combining channel evidence with check messages) and check nodes (enforcing parity).

Theorem: Log-Domain Check-Node Update

Let Ljβ†’cL_{j \to c} be the incoming LLR on edge (j,c)(j, c). The outgoing LLR on edge (c,i)(c, i) is Lcβ†’i=2 atanh⁑ ⁣(∏jβˆˆβˆ‚cβˆ–itanh⁑ ⁣(12Ljβ†’c)).L_{c \to i} = 2\, \operatorname{atanh}\!\left(\prod_{j \in \partial c \setminus i} \tanh\!\left(\tfrac{1}{2} L_{j \to c}\right)\right). Equivalently, in sign-magnitude form: Lcβ†’i=(∏jβˆˆβˆ‚cβˆ–isgn⁑(Ljβ†’c))β‹…Ο•βˆ’1 ⁣(βˆ‘jβˆˆβˆ‚cβˆ–iΟ•(∣Ljβ†’c∣)),L_{c \to i} = \left(\prod_{j \in \partial c \setminus i} \operatorname{sgn}(L_{j \to c})\right) \cdot \phi^{-1}\!\left(\sum_{j \in \partial c \setminus i} \phi(|L_{j \to c}|)\right), where Ο•(x)=βˆ’log⁑tanh⁑(x/2)\phi(x) = -\log\tanh(x/2).

The check-node update combines dcβˆ’1d_c - 1 LLRs into one output. The sign of the output is the XOR of the incoming signs (because the check enforces βˆ‘jxj=0β€Šmodβ€Š2\sum_j x_j = 0 \bmod 2); the magnitude is dominated by the weakest incoming LLR. The Ο•\phi nonlinearity performs a soft-min operation, which is why the min-sum approximation works well.

,

Theorem: Log-Domain Variable-Node Update

Let Lich=log⁑p(yi∣xi=0)p(yi∣xi=1)L_i^{\text{ch}} = \log\frac{p(y_i|x_i=0)}{p(y_i|x_i=1)} be the channel LLR at bit ii. The outgoing LLR on edge (i,c)(i, c) is Liβ†’c=Lich+βˆ‘cβ€²βˆˆβˆ‚iβˆ–cLcβ€²β†’i.L_{i \to c} = L_i^{\text{ch}} + \sum_{c' \in \partial i \setminus c} L_{c' \to i}. The final posterior LLR after TT iterations is Li(T)=Lich+βˆ‘cβˆˆβˆ‚iLcβ†’i.L_i^{(T)} = L_i^{\text{ch}} + \sum_{c \in \partial i} L_{c \to i}.

Variable nodes simply add incoming LLRs β€” this is the log-domain analog of multiplying probabilities for independent evidence. The extrinsic rule ("exclude the target check") prevents double-counting.

LDPC Sum-Product Decoder (Log-Domain)

Complexity: Per iteration: O(∣E∣)O(|\mathcal{E}|) where ∣E∣|\mathcal{E}| is the number of edges in the Tanner graph. For regular (dv,dc)(d_v, d_c) codes: ∣E∣=Ndv|\mathcal{E}| = N d_v. Memory: one LLR per edge.
Input: channel LLRs L_ch[1..N], parity-check matrix H, max iterations T
Output: decoded codeword x_hat[1..N]
// Initialize messages
for each edge (i, c):
L_{i->c} = L_ch[i]
for t = 1 to T:
// Check-node update
for each check c:
for each i in N(c):
L_{c->i} = 2 * atanh( product over j in N(c){i}:
tanh(L_{j->c} / 2) )
// Variable-node update
for each variable i:
for each c in N(i):
L_{i->c} = L_ch[i] + sum over c' in N(i){c}: L_{c'->i}
// Hard-decision and syndrome check
for each i:
L_total[i] = L_ch[i] + sum over c in N(i): L_{c->i}
x_hat[i] = 0 if L_total[i] >= 0 else 1
if H * x_hat = 0 (mod 2):
return x_hat // Successful decoding
return x_hat // May not be a valid codeword

The min-sum approximation replaces Ο•βˆ’1(βˆ‘Ο•(∣Lj∣))\phi^{-1}(\sum \phi(|L_j|)) by min⁑j∣Lj∣\min_j |L_j|, dropping the nonlinearity at a small performance cost (typically 0.3-0.5 dB). Min-sum is the standard in hardware decoders.

LDPC BP Decoding Trajectory: BER vs. Iterations

Run sum-product decoding on a random regular LDPC code over a BSC or AWGN channel. Track the bit-error rate of the current estimate across iterations. Watch the waterfall below the threshold.

Parameters
500
3
6
1.5
30

Definition:

Density Evolution

Density evolution tracks the distribution of BP messages across iterations in the large-NN, locally-tree-like limit. Let Pβ„“(L)P_\ell(L) be the density of outgoing variable-to-check LLRs at iteration β„“\ell, and Qβ„“(L)Q_\ell(L) the density of check-to-variable LLRs. For a (Ξ»,ρ)(\lambda, \rho) irregular ensemble: Qβ„“=Ξ“(ρ,Pβ„“),Pβ„“+1=Ξ»(P0⊑Qβ„“),Q_\ell = \Gamma(\rho, P_\ell), \qquad P_{\ell+1} = \lambda(P_0 \boxdot Q_\ell), where Ξ“\Gamma and ⊑\boxdot are specific functional transforms determined by the check-node and variable-node updates, and Ξ»,ρ\lambda, \rho are the degree distributions.

Density evolution is a scalar (or functional) recursion that predicts the asymptotic BP bit-error rate as a function of channel quality. The threshold Ο΅βˆ—\epsilon^* is the largest channel parameter for which Pβ„“β†’Ξ΄βˆžP_\ell \to \delta_\infty (perfect recovery in the limit).

Theorem: BP Threshold (BEC)

For the Binary Erasure Channel (BEC) with erasure probability Ο΅\epsilon and a (Ξ»,ρ)(\lambda, \rho) irregular LDPC ensemble, the density evolution recursion on the erasure probability xβ„“x_\ell is xβ„“+1=ϡ⋅λ ⁣(1βˆ’Ο(1βˆ’xβ„“)).x_{\ell+1} = \epsilon \cdot \lambda\!\big(1 - \rho(1 - x_\ell)\big). The BP threshold Ο΅βˆ—\epsilon^* is the supremum of Ο΅\epsilon for which xβ„“β†’0x_\ell \to 0 from x0=Ο΅x_0 = \epsilon.

On the BEC, messages are either "known" or "erased", so the scalar recursion tracks just one number: the probability that a random variable-to-check message is erased. The threshold Ο΅βˆ—\epsilon^* is the channel quality at which the recursion first fails to drive erasure to zero β€” exactly the cliff where decoding breaks down.

,

Example: Threshold of the (3,6)-Regular LDPC Code on the BEC

Compute the BP threshold of the (dv,dc)=(3,6)(d_v, d_c) = (3, 6) regular LDPC ensemble on the BEC. Compare to Shannon's channel-coding bound.

LDPC Waterfall on AWGN

LDPC Waterfall on AWGN
BER vs. SNR for a rate-1/2 LDPC code: the characteristic waterfall curve. Above the threshold (predicted by density evolution), BER drops precipitously; below, it barely moves.

Irregular LDPC Codes Close the Gap

Irregular LDPC codes β€” with mixed variable-node degrees β€” can achieve thresholds arbitrarily close to Shannon capacity. The degree distribution is optimized by linear programming on the density evolution recursion (Richardson-Urbanke 2001). Modern 5G LDPC codes use carefully designed irregular ensembles with multi-edge types to optimize both threshold and error floor behavior.

Common Mistake: Uncalibrated Min-Sum Overestimates Confidence

Mistake:

Replacing the exact check-node Ο•\phi-operation by plain min-sum without applying a scaling factor.

Correction:

Min-sum systematically overestimates the magnitude of the output LLR. Scale the output by α∈[0.75,0.9]\alpha \in [0.75, 0.9] (determined empirically) to compensate. This is called normalized min-sum and is the standard in hardware decoders. Without scaling, min-sum BP diverges or converges to overconfident errors in the waterfall region.

Historical Note: Gallager, Rediscovery, and 5G

1963-2020

Robert Gallager invented LDPC codes and their iterative decoding in his 1963 PhD thesis β€” but computational limits of the era made the codes impractical. They were essentially forgotten for 30 years. David MacKay rediscovered them in 1995, showing that Gallager's iterative decoder achieves near-capacity performance at block lengths that modern hardware could handle. Richardson and Urbanke (2001) systematized density evolution, launching the era of code design by threshold optimization. Today LDPC is the channel code in 5G New Radio, in Wi-Fi (802.11n/ac/ax), in DVB-S2, and in NAND flash β€” a forty-year loop from theory to ubiquitous deployment.

πŸ”§Engineering Note

5G NR LDPC Decoder Specifications

5G NR uses two LDPC base graphs (BG1 and BG2) with lifting factors Z∈{2,3,…,384}Z \in \{2, 3, \ldots, 384\} to support block lengths from 40 to 8448 bits and rates from β‰ˆ1/5\approx 1/5 to β‰ˆ8/9\approx 8/9. Commercial decoders use normalized min-sum with Ξ±β‰ˆ0.8\alpha \approx 0.8, layered scheduling, and 15-30 iterations. Throughput exceeds 10 Gb/s in modern 5G modems.

πŸ“‹ Ref: 3GPP TS 38.212, Section 5.3.2
πŸŽ“CommIT Contribution(2004)

EXIT Charts for Iterative Decoder Design

S. ten Brink, G. Kramer, G. Caire β€” IEEE Trans. Commun.

The CommIT group contributed to developing EXIT (extrinsic information transfer) charts β€” a graphical dual of density evolution that tracks mutual information rather than message densities. EXIT charts enable joint design of LDPC codes with modulation, equalization, and MIMO detection in iterative receivers. They remain the workhorse tool for designing concatenated iterative systems.

LDPCEXIT chartiterative decodingView Paper β†’

Quick Check

A check node of degree dcd_c receives incoming LLRs with magnitudes {2,5,8,3}\{2, 5, 8, 3\}. In normalized min-sum BP with Ξ±=0.8\alpha = 0.8, what is the output magnitude (to a fifth incoming edge)?

0.8β‹…2=1.60.8 \cdot 2 = 1.6

0.8β‹…(2+3+5+8)=14.40.8 \cdot (2+3+5+8) = 14.4

0.8β‹…8=6.40.8 \cdot 8 = 6.4

0.8β‹…(2β‹…3β‹…5β‹…8)=1920.8 \cdot (2 \cdot 3 \cdot 5 \cdot 8) = 192

LDPC BP Decoding: Message Flow on a Tanner Graph

Animated BP decoding of an LDPC code. Variable-to-check messages carry accumulated channel evidence; check-to-variable messages enforce parity constraints. Watch the erroneous bits get corrected as iterations proceed.

Key Takeaway

LDPC decoding is canonical loopy BP. The check-node update combines LLRs through a soft-XOR (Ο•/Ο•βˆ’1\phi/\phi^{-1} or min-sum); the variable-node update adds extrinsic LLRs. Density evolution predicts the exact decoding threshold, and irregular codes push it within hundredths of a dB of Shannon capacity. This is the theoretical backbone of modern channel coding.