Gallery¶
A visual tour of what CommPy produces. Every figure here is generated by a
runnable script in examples/.
Coding gain over AWGN¶
Forward error correction buys "coding gain": at a given SNR the coded bit-error rate sits well below the uncoded curve. Here a rate-½ LDPC code (belief-propagation decoding) over BPSK on an AWGN channel — roughly two orders of magnitude lower BER than uncoded by 3 dB.

Reproduce and explore:
from commpy import LDPCCode, MPSKModulator, Channels, simulate_coded_ber, plot_waterfall
code = LDPCCode.from_gallager(n=96, w_c=3, w_r=6)
result = simulate_coded_ber(code, MPSKModulator(2), Channels.awgn, [0, 1, 2, 3, 4, 5])
plot_waterfall(result)
See examples/ldpc_coding_gain_demo.py,
polar_scl_demo.py,
and turbo_coding_gain_demo.py.
A constellation learned from scratch¶
With the optional AI-for-wireless layer (pip install "commpy[ml]"), an
autoencoder learns a transmitter and receiver end-to-end by training through a
differentiable channel. Below is the 16-point constellation it discovers for
one complex channel use at 15 dB — no constellation was ever specified.
