spectra-fourier: v12 — the Coding lab (convolutional codes + Viterbi + coding gain)#588
Merged
Merged
Conversation
…+ coding gain)
Adds a complete forward-error-correction pillar (the 17th mode) on top of the
Modem's channel:
- src/lib/fec.ts — from-scratch convolutional encoder over an octal-generator
rate-1/n trellis (five textbook codes, K=3 (7,5) … K=7 (171,133) and the
rate-1/3 (171,133,165)); a single add-compare-select Viterbi core with hard
(Hamming) and soft (squared-Euclidean) branch metrics, full traceback, and
exposed per-step survivor metrics + back pointers for the animation;
rate-compatible puncturing (2/3, 3/4, 5/6) with erasure de-puncturing; a
weight-bounded DP that enumerates every first-return-to-zero error event into
the code's distance spectrum {d, a_d, c_d}, giving d_free and the soft/hard
union bounds; and an end-to-end Monte-Carlo coded link.
- src/modes/Coding.tsx — three tabs: a live animated Viterbi trellis (survivor
sweep, per-node metrics, ML path vs true path), the coding-gain plot
(uncoded/hard/soft measured dots + union bounds + distance-spectrum bars +
gain readouts), and a message demo (same text through the same noise, shredded
uncoded vs. perfectly repaired coded, character-diffed). All deep-linkable.
- 8 new self-tests (51-58): published d_free for all five codes + the exact
(7,5) spectrum, noiseless hard/soft round-trips, single-error correction,
soft <= hard < uncoded with measured <= union bound, a >=10x soft coding gain,
exact puncture rates + de-puncture round-trip, a punctured link beating its
channel BER, and text<->bits round-trip. All 90 self-tests green.
The (171,133) trellis re-derives d_free = 10 with a_10 = 11 (the published
value). lint + tsc + vite build pass; verified live in a headless browser.
No coding libraries — every generator, trellis, metric and bound is hand-built.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B7NSkgG4x7CkmmwMKPVzRi
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.
Substantially improves the Claude-authored Spectra — Fourier Lab (
projects/spectra-fourier-7k9d) by adding a complete, from-scratch forward-error-correction pillar — its 17th mode, Coding — built on the existing Modem channel. Every generator, trellis, decoder metric and error bound is hand-written; no coding libraries.What's new
src/lib/fec.ts— the FEC engine{d, aᵈ, cᵈ}, enumerated by a weight-bounded DP over first-return-to-zero error events, givingd_freeand the closed-form soft/hard union bounds.src/modes/Coding.tsx— the UI (three deep-linkable tabs)Verification
d_freefor all five codes + the exact (7,5) spectrum, noiseless hard/soft round-trips, single-error correction,soft ≤ hard < uncodedwithmeasured ≤ union bound, a ≥10× soft coding gain, exact puncture rates + de-puncture round-trip, a punctured link beating its channel BER, and text↔bits round-trips.node scripts/verify-project.mjs spectra-fourier-7k9dpasses (scope + conformance +pnpm lint+pnpm build); verified live in a headless browser (all three tabs render, zero console errors, a 2 dB message repaired from 5 uncoded bit errors to 0).All changes live inside the single
projects/spectra-fourier-7k9d/folder (Golden Rule).JOURNAL.md,project.jsonand the About page are updated; the journal adds a v12 plan, a session-log entry, and a fresh backlog (BCJR/MAP, turbo codes, RSC, QAM-LLR coding, traceback-depth, sequential decoding, block codes, exact punctured spectra, interleaving, an LDPC teaser).🤖 Generated with Claude Code
https://claude.ai/code/session_01B7NSkgG4x7CkmmwMKPVzRi
Generated by Claude Code