|
|
|||||||
|
This interactive tutorial visualizes 3GPP NR Polar Coding (TS 38.212): the encoding pipeline from information bits to codeword via mother code selection, interleaving, sub-channel mapping, and the polar transform. The flow is: Information → Interleaved (c′) → U-vector (Frozen/Info) → Polar Transform → Codeword (d).
Mathematical foundation1. Mother code size NGiven payload length K (information bits) and rate-matching length E, 3GPP selects the mother code size N = 2n (5 ≤ n ≤ 9). The rule uses n1 from E (and a threshold), n2 from K, and clamps to the allowed range. N is the length of the U-vector and the codeword before rate matching. 2. Interleaving (PIIL)The block interleaver (Table 5.3.1.1-1, PIIL_MAX) shuffles the K information bits into the sequence c′. The mapping is defined by the 3GPP table: for each output position, a source index is chosen from the last K entries of the sequence. The interleaver visualization shows these "strings" from input to output. 3. Sub-channel mapping (Q0Nmax)The reliability sequence Q0Nmax (Table 5.3.1.2-1) orders sub-channels by reliability. The K most reliable positions are used for information bits; the rest are frozen (set to 0). The heatmap shows reliability (color) and selected indices (blue border). The Master Sequence Explorer shows the full 1024-element table; Step Fwd animates each bit from the table into the u-vector. 4. Polar transform (butterfly)The U-vector u of length N (info bits in selected positions, frozen elsewhere) is multiplied by the polar kernel matrix — the n-fold Kronecker power of the 2×2 Arikan kernel F: d = u · GN, GN = F⊗n, F = [1 0; 1 1]
This is implemented as a butterfly network: at each stage, pairs of bits are combined with XOR, uj ← uj ⊕ uj+step. The diagram shows input nodes (blue = info, grey = frozen), XOR nodes, and output codeword d. The Math Inspector displays the active XOR equation for the current step. SimulationThe interactive simulator is below. Use the controls to explore the concepts described above.
1. Mother Code
2. Interleaving
3. Sub-channel Mapping
4. Polar Transform
5. Output
Code rate K/E
0.370
Reliability heatmap (Q0Nmax) — Selected info bits (blue border)
Info bit
Frozen bit
Set K and E, then click Generate Random Bits & Run. Mother code size N is computed per 3GPP. 3GPP Interleaver Table (PIIL_MAX, TS 38.212 Table 5.3.1.1-1)
Interleaver mapping: input index → output position (c → c′)
Sub-channel mapping: the K most reliable positions (from Q0Nmax) carry information; others are frozen (0). Think of it as a Physical Mailbox system: Rank (reliability order) tells you which mailbox is best; you place your Info bits into the K best mailboxes and fill the rest with 0. Step Fwd animates each bit "flying" from the reliability table into its physical u-vector slot. 3GPP Master Sequence Explorer (Q0,Nmax)
Scanning Master Table for indices < 128…
Table 5.3.1.2-1 (Q0Nmax, filtered for N) — Rank = reliability order; highlight follows Step
Table has N rows (Rank 0 to N−1). Scroll down to see Info rows (last K rows).
U-vector (by u[] index)
Butterfly diagram: U-vector (blue = info, grey = frozen) → XOR stages → Codeword d
Polar Transform Evolution
Stage
7 / 7
XOR
1 / 64
Use Stage ± to select the stage; XOR ± or Step Bwd/Fwd to show each XOR (⊕) within that stage. Run animates through the XORs. GN = F⊗n: row i = basis for u[i]
Color code
Black: matrix entry 0
White: 1 in frozen row
Blue: 1 in info row
Codeword d (output)
UsageUse this simulation to explore 3GPP NR Polar Coding (TS 38.212):
Try this: start with K=40, E=108 for N=128 and a readable butterfly. The pipeline is: Information → Interleaved (c′) → U-vector (Frozen/Info) → Polar Transform → Codeword (d).
Parameters
Limitations
|
|||||||