Skip to content

Releases

v1.2.0: MIMO, AI-for-wireless & MCP server

Choose a tag to compare

@MarvinElling MarvinElling released this 02 Aug 17:52
eded8a1

CommPy 1.2.0 adds multiple-antenna MIMO support, an optional deep-learning
layer (commpy.ml), and an optional MCP server exposing CommPy to AI agents.
No breaking changes to the public API.

What's new

MIMO — i.i.d. Rayleigh channel (rayleigh_channel_matrix, mimo_awgn),
Alamouti space-time block coding (alamouti_encode/alamouti_decode),
spatial-multiplexing detectors (zf_detector, mmse_detector, ml_detector,
kbest_detector), and MIMO capacity (mimo_capacity, ergodic_mimo_capacity).

AI-for-wireless (optional, commpy[ml]) — a PyTorch layer under commpy.ml:
a differentiable AWGN channel, an end-to-end learned Autoencoder, a
NeuralDemapper, and a trainable NeuralMinSumDecoder for LDPC. Not imported by
default, so the base install stays NumPy/SciPy-only.

MCP server (optional, commpy[mcp]) — a commpy-mcp Model Context Protocol
server: capability listing, channel capacity, and uncoded/coded BER sweeps.

Docs & tooling — a Gallery page with generated figures, an opt-in benchmark
suite, fixed doc links, and a quickstart notebook covering the modern codes.

Install

pip install --upgrade commpy          # base
pip install --upgrade "commpy[ml]"    # + PyTorch AI layer
pip install --upgrade "commpy[mcp]"   # + MCP server

Full changelog: v1.1.0...v1.2.0

v1.1.0: LDPC, Polar & Turbo codes

Choose a tag to compare

@MarvinElling MarvinElling released this 26 Jul 20:48

Highlights

CommPy 1.1.0 adds the three modern standard forward-error-correcting codes —
LDPC, polar, and turbo — that underpin 5G-NR, LTE, Wi-Fi and DVB. All
three decode directly from the soft-decision LLRs produced by
Modulator.soft_demodulate, and the new simulate_coded_ber turns a
coding-gain waterfall into a one-liner.

No breaking changes to the public API (commpy.*).

import numpy as np
from commpy import PolarCode, CRC, MPSKModulator, Channels

mod  = MPSKModulator(2)                                   # BPSK
code = PolarCode(block_length=128, k=64, crc=CRC.crc8())  # CRC-aided SCL (5G-style)

message = np.random.randint(0, 2, code.k)
rx  = Channels.awgn(mod.modulate(code.encode(message)), snr_db=2.0)
llr = mod.soft_demodulate(rx, noise_var=10 ** -0.2)
decoded, codeword, _ = code.decode(llr, list_size=8)

Added

Channel coding (FEC)

  • LDPC — LDPCCode with vectorized belief propagation (sum-product &
    normalized min-sum), Gallager (from_gallager) and quasi-cyclic
    (from_base_graph) constructions, a systematic GF(2) generator that tolerates
    rank-deficient parity-check matrices, and a ready rate-½ QC code.
  • Polar — PolarCode with successive-cancellation (SC) and CRC-aided
    SC-list (CA-SCL) decoding (reuses the CRC class), Bhattacharyya /
    Gaussian-approximation frozen-set construction, and exact log-domain path
    metrics verified equal to maximum-likelihood decoding.
  • Turbo — TurboCode, a rate-⅓ parallel-concatenated code with
    recursive-systematic constituent encoders and iterative log-MAP (BCJR)
    decoding through an interleaver.

Simulation

  • simulate_coded_ber — Monte-Carlo BER sweep for any soft-input code
    (modulate → channel → soft_demodulate → decode); the coded counterpart of
    simulate_ber.

Changed

  • plot_waterfall clamps confidence-interval error bars at 0, so the very small
    error rates typical of coded curves no longer trip a matplotlib error.

Examples

  • ldpc_coding_gain_demo.py, polar_scl_demo.py, turbo_coding_gain_demo.py

Install

pip install --upgrade commpy

Full changelog: v1.0.0...v1.1.0

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

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

v0.1.2

Choose a tag to compare

@MarvinElling MarvinElling released this 08 Dec 15:48
new version

v0.1.1

Choose a tag to compare

@MarvinElling MarvinElling released this 08 Dec 09:37
update toml

v0.1.0

Choose a tag to compare

@MarvinElling MarvinElling released this 04 Dec 18:31
fix cicd