EPFL Principles of Digital Communications final project: transmit a 40-character text message through an adversarial server channel and recover it without a single bit error, under a strict energy budget of 1500.
The scheme is M-ary orthogonal signaling using a Hadamard (Walsh) code — each of the M=4096 messages is mapped to one row of a 2¹⁵×2¹⁵ Hadamard matrix, and all codewords are mutually orthogonal.
For every block of two symbols (X₁, X₂), the server secretly picks one of two branches and attenuates the other by √G with G = 10, then adds Gaussian noise to both. The receiver never learns which branch was kept — it has to figure it out from the received signal alone.
The transmitter maps every 2 characters (12 bits, 4096 possibilities) to a single Hadamard codeword of length N = 2¹⁵ = 32768, built as a one-hot vector pushed through a Walsh–Hadamard transform. This turns the problem into orthogonal signaling on a massive codebook, so the receiver only has to find the loudest correlation.
The receiver runs a batched Fast Walsh–Hadamard Transform on the two sub-channels in parallel, combines them with the two possible branch hypotheses, and picks the codeword with the highest score. No matrix is ever materialized — decoding 20 codewords of length 32k is essentially free.
Highlights:
- Fast Walsh–Hadamard transform, fully vectorized and batched — encodes/decodes in
O(N log N)with zero explicit matrices, so memory stays flat asrgrows. - Joint two-branch ML decoder that marginalizes over the channel's hidden branch selection in a single pass.
- Energy-optimal scaling: codeword amplitude is computed analytically from the budget so the signal rides right at the limit of what the server allows.
- Bit-perfect recovery of the 40-character message through the real EPFL server (
iscsrv72.epfl.ch).
PDC_project/
main.py # end-to-end pipeline: encode → send → receive → decode
transmitter.py # Hadamard encoder with k-character packing
receiver.py # batched FWHT ML decoder
utils.py # fast + batched Walsh–Hadamard transforms, alphabet, G
client.py # official EPFL channel client
fake_client.py # local channel simulator for offline testing
test_accuracy.py # BER sweeps across parameters
PDF/ # project description and theory notes
cd PDC_project
echo "your 40-character message goes here........" > message_in.txt
python3 main.pyThe pipeline encodes the message, uploads the waveform to the EPFL server, downloads the noisy response, decodes it, and prints whether the recovered text matches the original.