Skip to content

v1.0.0: Channel Coding, OFDM & Information Theory: From Modulation Toolkit to Full Comms Stack

Choose a tag to compare

@MarvinElling MarvinElling released this 21 Jul 16:12
· 16 commits to main since this release

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 + custom CRCConfig),
    HammingCode, generic CyclicCode, BCHCode, ReedSolomonCode — error decoding
    via Berlekamp-Massey/Chien search/Forney, plus a separate erasures-only decoder
    correcting up to n-k erasures (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 Modulator engine — 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; the QPSK_Modulator list-vs-array bug is fixed.
  • raised_cosine_filter / root_raised_cosine_filter pulse shaping, drop-in
    compatible with IQWaveform.
  • zf_equalizer / mmse_equalizer linear FIR channel equalizers.
  • gardner_timing_error, estimate_cfo_mth_power, costas_loop_bpsk
    synchronization primitives.

OFDM

  • OFDMModulator / OFDMDemodulator with configurable active subcarriers and
    cyclic prefix.
  • papr, papr_db, papr_ccdf for 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_decode and
    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 new FiniteField base; new GF2m
    (GF(2^m)) via vectorized log/antilog tables — the algebraic foundation for
    BCH/Reed-Solomon.

Fixed

  • Three stale CommPy → commpy imports (from an earlier package rename) that
    broke PrimeField, the test suite, and IQWaveform's demo block.
  • QPSK_Modulator's list-vs-array equality bug (silently produced wrong/empty
    output for ndarray/tuple input).
  • commpy.__version__ now actually exists (previously documented but absent).

Infrastructure

  • CI now runs ruff, mypy --strict, and pytest on every push/PR across
    Python 3.10–3.12, including a dedicated job for the Numba-absent fallback path.
  • scipy is now a hard dependency; numba is an optional commpy[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