TXNEARESTbit 1–bit 2–1s = rng.choice([1,-1], (200,2))2n = rng.normal(0, 0.3, (200,2))3r = s + n4d = np.where(r >= 0, 1, -1)5wrong = (d != s).any(axis=1)sr00
-2-1012-101I (V)Q (V)CONSTELLATION00101101rsend 00: s = (1, 1)r = (0.84, 1.24)n = (−0.16, 0.24) Vnearest: 00 (0.29 V)-2-101200.511.5noise n (V)density (1/V)NOISE VALUES±σ±σ: 68.27 %, here 70 %mean 0 · σ = 0.3 Vσ 0.3 → 0.6 V: wider, lower
Coloured parts: what the current step is about; everything else rests in whiteBlocks: transmitter, noise source and summing dot, nearest-point decider, two bit cells and a Python code cardPlots: the constellation (ideal points, received points, decision boundaries) and the noise histogram with its bell curveThe token carries the symbol (s, then r after the noise); the points slide out as the noise growsQPSK points at (±1, ±1) V in Gaussian noise of σ = 0.3 V (SNR 10.5 dB) and σ = 0.6 V (SNR 4.4 dB). The receiver picks the nearest point. SNR here is per symbol: Es over the total noise power on I and Q. The next lesson rewrites it per bit as Eb/N0 and plots the bit error rate against it.

A point in noise

  1. QPSK sends one of four points per symbol: I and Q are each +1 or −1 volt. Each point carries two bits: the first gives the sign of I, the second the sign of Q. To send 00, it sends s = (1, 1).

What the noise is

Clouds and SNR

Deciding

In code

The working

# step 1/10 · send

QPSK (4-QAM), from the QAM lesson

point  bits   I     Q
  A     00   +1 V  +1 V
  B     10   −1 V  +1 V
  C     11   −1 V  −1 V
  D     01   +1 V  −1 V

Gray labels: neighbours differ in one bit
send 00  ->  s = (1, 1)

The amplitude 1 V and the noise σ = 0.3 V and 0.6 V are chosen example values. The 200 symbols are one draw from a seeded random generator; the error rates quoted beside them are exact averages from the Gaussian Q-function. Every number in the figure is computed from this model. Nearest-point decisions are the best possible (fewest symbol errors) when every point is equally likely and the noise is Gaussian with the same σ on I and Q. With unequal odds or other noise, the best rule shifts.