Repository navigation
v1.0.0: Channel Coding, OFDM & Information Theory: From Modulation Toolkit to Full Comms Stack
CommPy grows from a small modulation/channel-model toolkit into a comprehensive
communications-engineering library: forward error correction, a generic PHY layer,
OFDM, information theory, and queuing theory — all vectorized on NumPy/SciPy, with
an optional Numba fast path for the one inherently sequential hot loop (Viterbi
decoding).
No breaking changes to the public API. Three imports broken since an earlier
package rename are fixed as part of this release.
Highlights
Channel coding (FEC)
- Block codes:
CRC(CRC-8/16-XMODEM/32 presets + customCRCConfig),
HammingCode, genericCyclicCode,BCHCode,ReedSolomonCode— error decoding
via Berlekamp-Massey/Chien search/Forney, plus a separate erasures-only decoder
correcting up ton-kerasures (double the error-only capability). - Convolutional codes:
Trellis,ConvolutionalEncoder,viterbi_decode
(hard- and soft-decision, zero-tail termination, optional Numba JIT acceleration). - Interleaving:
BlockInterleaver,ConvolutionalInterleaver(Ramsey type-II).
Modulation & PHY
- A generic, Gray-coded
Modulatorengine —MPSKModulator,MQAMModulator,
MPAMModulator— with vectorized hard-decision demodulation and soft-decision
(LLR) output for feeding straight into Viterbi. - Original per-scheme classes (
OOK_Modulator,BPSK_Modulator, etc.) kept for
backward compatibility; theQPSK_Modulatorlist-vs-array bug is fixed. raised_cosine_filter/root_raised_cosine_filterpulse shaping, drop-in
compatible withIQWaveform.zf_equalizer/mmse_equalizerlinear FIR channel equalizers.gardner_timing_error,estimate_cfo_mth_power,costas_loop_bpsk
synchronization primitives.
OFDM
OFDMModulator/OFDMDemodulatorwith configurable active subcarriers and
cyclic prefix.papr,papr_db,papr_ccdffor peak-to-average power ratio analysis.
Information theory
binary_entropy,mutual_information,channel_capacity_bsc,
channel_capacity_awgn,channel_capacity_dmc(Blahut-Arimoto).huffman_codes/huffman_encode/huffman_decodeand
arithmetic_encode/arithmetic_decode(exact-rational arithmetic coding).rate_distortion_binary(closed-form binary rate-distortion function).
Networking
MM1Queue,MM1KQueue,MMcQueue— closed-form M/M/1-family queuing models.
Galois fields
PrimeField(GF(p)) generalized onto a newFiniteFieldbase; newGF2m
(GF(2^m)) via vectorized log/antilog tables — the algebraic foundation for
BCH/Reed-Solomon.
Fixed
- Three stale
CommPy→commpyimports (from an earlier package rename) that
brokePrimeField, the test suite, andIQWaveform's demo block. QPSK_Modulator's list-vs-array equality bug (silently produced wrong/empty
output forndarray/tupleinput).commpy.__version__now actually exists (previously documented but absent).
Infrastructure
- CI now runs
ruff,mypy --strict, andpyteston every push/PR across
Python 3.10–3.12, including a dedicated job for the Numba-absent fallback path. scipyis now a hard dependency;numbais an optionalcommpy[fast]extra.- Test suite grew from 3 tests to 324, including exhaustive brute-force
cross-validation for BCH/Reed-Solomon decoding and Viterbi-vs-maximum-likelihood
checks. - New
examples/directory: 8 runnable, tested scripts, including a full-chain
capstone (Huffman → convolutional code → BPSK → multipath channel → ZF
equalization → soft-decision Viterbi → decompression).
Stats
- Source: ~760 → ~3,750 lines
- Tests: 3 → 324 (all passing)
- Public API surface: 12 → ~65 exported names
Full changelog: see docs/CHANGELOG.md