b01b10b21b31b40b50b60b71b0–b1–b2–b3–b4–b5–b6–b7–coscos−sin×cos ∫×−sin ∫1b = np.array([1, 0, 1, 1])2t = np.arange(48) / 480003c = np.cos(2*np.pi*3000*t)4s = np.outer(2*b - 1, c)5y = 2 * (s * c).mean(axis=1)11
01234-101t (ms)s (V)TRANSMITTED s(t)1 · 0°0 · 180°1 · 0°1 · 0°10 · 315°11 · 45°00 · 225°01 · 135°c(t) = cos(2π·3000·t)input −sin(2π·3000·t)bit 1: 0° bit 0: 180°cos(ωt + π) = −cos(ωt)2 bits → 1 of 4 phases01234-101t (ms)z (V)CORRELATOR z(t)z_Iz_Qsign at each dump → bitends at 0 · max 0.053I and Q at once-2-1012-101I (cos)Q (−sin)CONSTELLATION10110100102 points, 2.0 apartGray: 1 bit per step
Coloured parts: what the current step is about; everything else rests in whiteBlocks: bits, carrier oscillator, mixers I and Q, channel, correlators, bits received, Python cardPlots: transmitted s(t), correlator outputs z(t), and the constellation (I, Q)Symbol tokens move in slow motion: one symbol per millisecond of signal timeThe bits 1 0 1 1 0 0 0 1 on a 3000 Hz carrier at 1000 symbols a second: BPSK sends the first four as phases 0° or 180°, QPSK sends all eight as four phases in the same time. QPSK keeps each point at radius 1, so a symbol carries the same energy as in BPSK but each bit gets half of it. The rule "QPSK has the same bit error rate as BPSK" holds at the same energy per bit, Eb/N0.

A carrier and its phase

  1. A radio sends bits by changing a carrier: a steady cosine, here c(t) = cos(2π·3000·t). A sine wave has three things to change: amplitude, frequency and phase. ASK and FSK change the first two. Phase-shift keying (PSK) changes the phase.

BPSK: one bit per symbol

Getting the bits back

QPSK: two bits per symbol

In code

The working

# step 1/11 · carrier

carrier  c(t) = A·cos(2π·fc·t)
         A  = 1 V
         fc = 3000 Hz  (period 0.333 ms)

three knobs:
  amplitude  -> ASK
  frequency  -> FSK
  phase      -> PSK   (this lesson)

phase = where in its cycle the wave starts
(a slowed teaching example: real carriers
 run at MHz to GHz)

A slowed teaching example: 1000 symbols a second on a 3000 Hz carrier, 3 cycles per symbol, amplitude 1 V. Real radios put many more cycles in each symbol (GPS sends BPSK at 1.023 million chips a second on a 1575.42 MHz carrier). Every curve is computed from the model. The figure shows a perfect channel: no noise, no delay, and the receiver's carrier exactly in phase with the transmitter's. Noise and the nearest-point decision come in the next module; filtered pulse shapes (instead of the square symbols here) keep the bandwidth small.