spectra-fourier: add Polar codes mode (channel polarization, SC / SC-list / CA-SCL)#671
Merged
Merged
Conversation
…st/CA-SCL) Twentieth mode for the Spectra DSP lab, completing the FEC pillar with Arıkan's polar codes — the first capacity-achieving codes with an explicit construction and the 5G-NR control-channel code. New from-scratch polar.ts: the u·F^⊗n transform (self-inverse), Bhattacharyya + Gaussian-approximation constructions, recursive SC, Tal–Vardy SC-list via a survivor-remap, and the CRC-aided list decoder, plus BI-AWGN capacity and a Monte-Carlo waterfall. Four-tab Polar.tsx (Polarization / Encoder / Decode / Waterfall). Eight new self-tests (119→127, all green), verified in headless Chromium with zero console errors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a twentieth mode — Polar — to the existing
spectra-fourier-7k9dDSP lab, completing its forward-error-correction pillar with its third and most modern paradigm: Arıkan's channel polarization. Polar codes are the first family proven to achieve the symmetric capacity of any binary-input channel with an explicit, low-complexity construction, and they carry the 5G-NR control channels. Everything is from scratch — no coding libraries.The change is entirely inside
projects/spectra-fourier-7k9d/(Golden Rule ✓).New engine —
src/lib/polar.ts(~640 lines)u·F^⊗nas an in-place GF(2) butterfly that is its own inverse;transformStagessnapshots each stage for the encoder animation.z⁻=2z−z²,z⁺=z²) and the Gaussian approximation of density evolution on BI-AWGN (mean LLR through the Chung–Richardson–Urbanke φ-function with a bisection inverse).channelCapacitiesmaps both onto one [0,1] capacity axis.PM += softplus(−(1−2û)·L), pruned to L via a survivor-map that each recursion frame applies to remap its own state.waterfall.New UI —
src/modes/Polar.tsx(four deep-linkable tabs)Wired into
src/App.tsxnav; styles added tosrc/index.css.Verification
src/lib/selftest.ts: the transform is an involution; SC recovers a clean word; SCL(L=1) ≡ SC bit-for-bit; the CRC self-verifies and catches a flip; BLER SC ≥ SCL(8) ≥ CA-SCL(8) at a fixed SNR; BLER monotone in SNR; BI-AWGN rate-½ Shannon limit ≈ 0.19 dB; the GA φ is a decreasing bijection.JOURNAL.mdandproject.jsonupdated (v16 plan + shipped checklist + session log; card copy bumped to twenty modes with polar tags).🤖 Generated with Claude Code
https://claude.ai/code/session_011n7XWZKS8M3TYCgMT6y4KV
Generated by Claude Code