Channel Coding
Channel coding adds redundancy to transmitted data so the receiver can detect and correct errors. 5G NR uses LDPC for high-throughput data channels and Polar codes for reliable control channels. Covers rate matching and HARQ soft-combining (Chase/IR).
#1Why Channel Coding — The Shannon Limit
Every communication channel has a theoretical maximum data rate — the Shannon capacity — beyond which error-free transmission is impossible:
Shannon-Hartley Theorem
C = B × log2(1 + SNR) [bits/s]
Channel coding bridges the gap between uncoded performance and the Shannon limit. A good code achieves near-capacity throughput at the target BLER.
BLER vs SNR for uncoded, LDPC, and Polar codes — see how coding gain bridges the Shannon gap
Code Rate — The Efficiency Metric
Code Rate R = k / n k = information bits (payload) n = coded bits (after redundancy) Rate 1/2: 100 info → 200 coded (50% overhead) → strong protection Rate 3/4: 100 info → 133 coded (33% overhead) → moderate protection Rate 5/6: 100 info → 120 coded (20% overhead) → high throughput Rate 1: 100 info → 100 coded (no protection) → uncoded 5G NR dynamically adapts code rate based on CQI.
#2LDPC Codes — Data Channel (PDSCH/PUSCH)
Low-Density Parity-Check codes are the channel coding scheme for 5G NR data channels, chosen for excellent throughput at moderate-to-long block lengths:
| Property | LDPC Advantage for Data |
|---|---|
| Block length | Excellent at long blocks (1000–8448+ bits) |
| Throughput | Highly parallelizable decoder → multi-Gbps |
| Latency | Converges in 5–20 iterations |
| Flexibility | Any code rate and block length via rate matching |
Parity Check Matrix & Tanner Graph
An LDPC code is defined by a sparse parity check matrix H. A valid codeword c satisfies H × cT = 0 (mod 2):
Tanner graph with belief propagation — messages pass between variable nodes (bits) and check nodes (equations) each iteration
5G NR LDPC Base Graphs
| Parameter | Base Graph 1 (BG1) | Base Graph 2 (BG2) |
|---|---|---|
| Mother matrix | 46 × 68 (22,168 bits max) | 42 × 52 (3,840 bits max) |
| Used for | Large code blocks | Small code blocks |
| Mother rate | R = 1/3 (kb=22) | R = 1/5 (kb=10) |
| Selection | TBS > 3824 OR R > 0.67 | Otherwise |
#3Polar Codes — Control Channel (PDCCH/PUCCH)
Invented by Erdal Arıkan (2009), Polar codes are the first provably capacity-achieving codes with low-complexity encoding/decoding. Used for 5G NR control channels:
| Property | Polar Advantage for Control |
|---|---|
| Block length | Excellent at short blocks (12–1024 bits) |
| Reliability | Superior BLER at short lengths (CA-SCL) |
| Capacity-achieving | Provably achieves Shannon as N → ∞ |
| Error floor | No error floor (unlike LDPC) |
Channel Polarization
Polar codes exploit channel polarization — combining N channels and splitting them into nearly-perfect and nearly-useless channels:
Channel polarization — as levels increase, channels split into "good" (data) and "bad" (frozen) channels
Decoding: SC → SCL → CA-SCL
| Algorithm | Complexity | Performance | 5G NR |
|---|---|---|---|
| SC (Successive Cancellation) | O(N log N) | Moderate | No |
| SCL (SC List, L paths) | O(L·N log N) | Good | No |
| CA-SCL (CRC-Aided SCL) | O(L·N log N) | Near-ML bound | Yes (L=8) |
#4LDPC vs Polar — Head-to-Head
| Aspect | LDPC (Data) | Polar (Control) |
|---|---|---|
| Used for | PDSCH, PUSCH | PDCCH, PUCCH, PBCH |
| Block length | Long (1000–8448+) | Short (12–1024) |
| Inventor | Gallager (1963) | Arıkan (2009) |
| Decoding | Belief Propagation | CA-SCL (list) |
| Parallelism | Excellent | Limited (sequential) |
| Max throughput | Multi-Gbps | ~100 Mbps |
| Error floor | Yes (at low BLER) | No |
| Capacity-achieving | Empirically close | Proven (N→∞) |
BLER performance comparison — Polar wins at short blocks, LDPC wins at long blocks with faster decode
#5Rate Matching — Adapting Code Rate
Rate matching adjusts the effective code rate by selecting bits from a circular buffer. This allows a single mother code to support any desired rate:
Mother code: k info bits → n coded bits (R_mother)
Need E bits to transmit:
E < n → PUNCTURE (remove bits) → higher effective rate
E > n → REPEAT (duplicate bits) → lower effective rate
LDPC Rate Matching — Circular Buffer
Circular buffer rate matching — adjust code rate and redundancy version (RV) to see which bits are transmitted
Polar Rate Matching
| Technique | Condition | Method |
|---|---|---|
| Puncturing | E < N | Remove last (N-E) bits, decoder LLR = 0 |
| Shortening | E < N, N > 2E | Set last bits to known 0, decoder LLR = +∞ |
| Repetition | E > N | Repeat first (E-N) bits at end |
#6HARQ — Hybrid ARQ Soft-Combining
HARQ combines error detection (CRC), error correction (channel coding), and retransmissions for reliable communication:
Chase Combining (CC)
Retransmit same coded bits. Receiver adds LLRs: LLR_combined = LLR₁ + LLR₂. Gain: 3 dB per reTX (energy only).
Incremental Redundancy (IR)
Retransmit different coded bits (new parity from circular buffer). Gain: 3 dB + coding gain. R_eff decreases each reTX.
HARQ process — step through retransmissions to see LLR combining and effective code rate evolution
HARQ in 5G NR
| Parameter | DL (PDSCH) | UL (PUSCH) |
|---|---|---|
| Max HARQ processes | 16 | 16 |
| Max retransmissions | 4 (configurable) | 4 (configurable) |
| HARQ type | Asynchronous (DCI) | Synchronous (K2) |
| Default scheme | IR (RV sequence) | IR (RV sequence) |
| RV sequence | {0, 2, 3, 1} — configurable via RRC | |
#7Soft Buffer Management
The UE maintains a soft buffer to store LLR values from failed transmissions for HARQ combining:
Total soft buffer: N_soft (UE capability) Per HARQ process: N_IR = floor(N_soft / (C × N_cells × K_MIMO × 16)) Example: N_soft = 10M bits, 1 CC, 2×2 MIMO → N_IR = 10M / (1 × 1 × 2 × 16) = 312,500 bits per process → BG1 mother code (8448 bits) fits easily ✅
Soft Buffer Overflow Risk
If N_IR < mother code size, LLR values must be discarded → IR-HARQ performance degrades. Monitor utilization in dense carrier aggregation scenarios.
#8End-to-End Coding Chain
PDSCH processing chain: TB → CRC → segmentation → LDPC encode → rate match → modulate
#9Practical Field Considerations
| Pitfall | Impact | Best Practice |
|---|---|---|
| High code rate + poor channel | BLER spike → HARQ storm | CQI-based MCS; target BLER ≤ 10% |
| Ignoring HARQ RTT | Pipeline stalls | Ensure K1 + delay ≤ slot budget |
| Soft buffer overflow | LLR truncation → IR degrades | Monitor utilization; reduce processes |
| Wrong BG selection | Suboptimal decode | Verify BG1/BG2 per TS 38.214 |
| Polar list size too small | BLER floor at short blocks | L = 8 minimum for CA-SCL |
| RV mismatch between gNB/UE | HARQ combining fails | Verify RV sequence via RRC |
Common Misconception
Myth: "More retransmissions always improve throughput." Reality: Each reTX consumes radio resources. If BLER > 30%, reduce MCS instead of relying on HARQ retransmissions.
LTE vs 5G NR Coding
| Aspect | LTE | 5G NR |
|---|---|---|
| Data code | Turbo codes | LDPC (faster, parallel) |
| Control code | Tail-biting convolutional | Polar (capacity-achieving) |
| Max block length | 6144 bits | 8448 bits (BG1) |
| Max HARQ processes | 8 (FDD) | 16 |
#10Further Reading
3GPP Specifications
- TS 38.212 — NR Multiplexing and Channel Coding (LDPC, Polar, rate matching, CRC)
- TS 38.214 — NR Physical Layer Procedures for Data (MCS, TBS, HARQ)
- TS 38.213 — NR Physical Layer Procedures (HARQ-ACK timing, scheduling)
- TS 38.306 — NR UE Radio Access Capabilities (soft buffer N_soft)
Research Papers
- "Low-Density Parity-Check Codes" — R. Gallager, MIT Press, 1963
- "Channel Polarization: A Method for Constructing Capacity-Achieving Codes" — E. Arıkan, IEEE Trans. IT, 2009
- "Near Shannon Limit Performance of LDPC Codes" — MacKay & Neal, 1996