QAM and constellation diagrams
About this lesson
Quadrature amplitude modulation (QAM) puts several bits on one burst of carrier by setting two numbers at once: how much cos and how much sin. Follow 16 bits through a 16-QAM transmitter: four bits become one dot on a constellation diagram, two mixers and an adder turn the dot into a wave with a set amplitude and phase, and a receiver gets the dot back, even with noise, by picking the nearest point. It builds on the PSK lesson (QPSK is 4-QAM) and the lesson on I and Q, and you will write the mapper in Python with numpy.
Four bits make one symbol
16-QAM has 16 different symbols, and 2⁴ = 16, so each symbol carries 4 bits. The bit buffer hands the mapper its first four bits: 1011. Our message is 16 bits, so it needs 4 symbols.
message 1011 0001 1101 0110 (16 bits) 16-QAM: M = 16 symbols bits per symbol = log2(16) = 4 symbols needed = 16 / 4 = 4 symbol 0 = 1011
Read the lesson step by step
Four bits make one symbol
16-QAM has 16 different symbols, and 2⁴ = 16, so each symbol carries 4 bits. The bit buffer hands the mapper its first four bits: 1011. Our message is 16 bits, so it needs 4 symbols.
message 1011 0001 1101 0110 (16 bits) 16-QAM: M = 16 symbols bits per symbol = log2(16) = 4 symbols needed = 16 / 4 = 4 symbol 0 = 1011Two bits for I, two bits for Q
The mapper splits the bits: the first pair picks a level called I, the second a level called Q, each from −3, −1, +1, +3. The table is a Gray code: neighbouring levels differ in one bit. 1011 gives I = +3, Q = +1.
Gray table (one axis) 00 -> −3 01 -> −1 11 -> +1 10 -> +3 neighbours differ in exactly one bit 1011: 10 -> I = +3 11 -> Q = +1 formula: level = (2h − 1)(3 − 2l)The constellation diagram
Draw I across and Q up. Each symbol is one dot, so 16-QAM is a 4 × 4 grid of 16 dots, each labelled with its bits. This map is a constellation diagram. Our symbol 1011 is the dot at (+3, +1).
constellation diagram horizontal axis: I (in-phase) vertical axis: Q (quadrature) one dot per symbol, labelled with its bits as a complex number: s = I + jQ 1011 -> +3+1j side by side, dots differ in one bit (Gray)Two carriers, 90° apart
The oscillator makes a carrier cos(2π·fc·t) and, shifted a quarter cycle (90°), −sin(2π·fc·t). Over one symbol their product averages to zero: they are orthogonal, so each can carry its own number without disturbing the other.
example: fc = 2000 Hz, symbol time T = 1 ms -> 2 carrier cycles per symbol (real radios: MHz or GHz carriers) orthogonal over one symbol: (2/T)∫ cos·cos dt = 1 (2/T)∫ sin·sin dt = 1 (2/T)∫ cos·sin dt = 0 (needs fc·T a whole number, as here)Mixers scale each carrier
The I level goes to one mixer, the Q level to the other. A mixer multiplies: the top branch makes I·cos(2π·fc·t), the bottom one Q·(−sin(2π·fc·t)). For 1011: 3·cos and 1·(−sin).
I branch: I · cos(2π·fc·t) = 3 · cos(...) Q branch: Q · (−sin(2π·fc·t)) = 1 · (−sin(...)) plot: I(t) and Q(t) hold their level for the whole symbol (1 ms)One wave: amplitude and phase
The adder sums both branches: s(t) = I·cos − Q·sin. That is one cosine with amplitude √(3² + 1²) = 3.16 and phase 18.4°. On the diagram: the dot's distance from the centre and its angle.
s(t) = I·cos(2π·fc·t) − Q·sin(2π·fc·t) = A·cos(2π·fc·t + φ) A = √(I² + Q²) = √(9 + 1) = 3.16 φ = atan2(Q, I) = atan2(1, 3) = 18.4° QAM changes amplitude AND phase (PSK changes only the phase)A new point every symbol
Every 1 ms the mapper takes four new bits and the dot jumps to a new point. The wave jumps with it, in amplitude and phase. 1000 symbols a second × 4 bits = 4000 bits a second.
symbol bits I + jQ A φ 0 1011 +3+1j 3.16 18.4° 1 0001 −3−1j 3.16 -161.6° 2 1101 +1−1j 1.41 -45.0° 3 0110 −1+3j 3.16 108.4° symbol rate 1000 symbols/s (1 per 1 ms) bit rate = 1000 × 4 = 4000 bit/sThe receiver finds I and Q
The receiver multiplies s(t) by the same two carriers and averages over one symbol. Orthogonality kills the other branch, so out come I and Q again: (+3, +1), then (−3, −1), (+1, −1), (−1, +3).
I = (2/T)∫ s(t)·cos(2π·fc·t) dt Q = (2/T)∫ s(t)·(−sin(2π·fc·t)) dt (over one symbol) computed from the drawn s(t): symbol 0: I = 3.00, Q = 1.00 -> 1011 symbol 1: I = −3.00, Q = −1.00 -> 0001 symbol 2: I = 1.00, Q = −1.00 -> 1101 symbol 3: I = −1.00, Q = 3.00 -> 0110Noise: pick the nearest point
Noise in the channel nudges every received point, so each lands in a small cloud. The receiver picks the nearest dot: the dashed lines split the plane into 16 squares. Here 3 of 128 noisy points crossed a line: errors.
received = sent + noise noise: σ = 0.45 per axis (Gaussian) Es/N0 = 10 / (2 × 0.45²) = 13.9 dB decision lines at −2, 0, +2 on each axis our 4 symbols, received -> decided (2.40, 0.86) -> 1011 (−2.79, −0.60) -> 0001 (0.59, −0.87) -> 1101 (−0.52, 3.27) -> 0110 cloud: 3 of 128 in the wrong square Gray code: a step into a side neighbour flips just one bitMore points, closer together
64-QAM packs 64 dots (6 bits each) into the same average power, so neighbours sit about half as far apart: 0.98 instead of 2.00. More bits per symbol, but it needs a cleaner channel. Wi-Fi 6 goes to 1024-QAM.
same average power (Es = 10): M bits nearest-neighbour distance 4 2 4.47 16 4 2.00 64 6 0.98 d_min = 2·√(3·Es / (2(M − 1))) Wi-Fi 6 (802.11ax): up to 1024-QAM, 10 bits Wi-Fi 7 (802.11be): up to 4096-QAM, 12 bits QPSK (PSK lesson) is the same as 4-QAM16-QAM mapping in Python
With numpy the whole mapper is a few lines. reshape groups the bits in fours (−1 means: work out how many rows). Each level line is the Gray table as a formula. The result is one complex number per symbol.
import numpy as np bits = [1,0,1,1, 0,0,0,1, 1,1,0,1, 0,1,1,0] b = np.reshape(bits, (-1, 4)) I = (2*b[:,0]-1)*(3-2*b[:,1]) Q = (2*b[:,2]-1)*(3-2*b[:,3]) s = I + 1j*Q >>> s array([ 3.+1.j, -3.-1.j, 1.-1.j, -1.+3.j]) (Python 3 with numpy)
5 quick questions
Choose one answer per question. You can change your choices before checking them.
01How many bits does one 64-QAM symbol carry?
64 different symbols can label 2⁶ = 64 bit patterns, so each symbol carries log2(64) = 6 bits.
02With the Gray table 00 → −3, 01 → −1, 11 → +1, 10 → +3, which level does the bit pair 01 give?
01 is the second row of the table: −1. Note the order 00, 01, 11, 10: each neighbour differs in one bit.
03A symbol has I = +1 and Q = −1. What carrier does it send?
A = √(1² + 1²) = 1.41 and φ = atan2(−1, 1) = −45°: the dot's distance from the centre and its angle.
04The receiver measures (I, Q) = (2.4, −0.7) on the 16-QAM grid of this lesson. Which bits does it decide?
The nearest point is (+3, −1): 2.4 is above the boundary at +2 and −0.7 lies between −2 and 0. +3 is 10 and −1 is 01, so the bits are 1001.
05Why does 64-QAM need a cleaner channel than 16-QAM at the same transmit power?
At the same average power the nearest-neighbour distance drops from 2.00 to 0.98, so smaller noise is enough to cross a decision line.
Glossary
- QAM (quadrature amplitude modulation)
- Sending two numbers per symbol, I and Q, as the amounts of a cosine and a sine carrier at the same frequency; together they set the wave's amplitude and phase.
- Symbol
- One burst of the modulated wave that stands for a group of bits; 16-QAM symbols carry 4 bits each.
- I and Q
- In-phase and quadrature: the amounts of cos(2π·fc·t) and −sin(2π·fc·t) in the signal, also written as one complex number I + jQ.
- Constellation diagram
- A plot with I across and Q up that shows every allowed symbol as a dot, often labelled with its bits.
- Gray code
- An ordering in which neighbouring values differ in exactly one bit, so a small error flips only one bit.
- Orthogonal
- Two signals whose product averages to zero over a symbol, so each can carry its own number without disturbing the other.
- Decision region
- The area of the plane closest to one constellation point; the receiver picks the point whose region the received value lands in.
Notes and sources
- The carrier is a teaching value: 2000 Hz with 1 ms symbols puts just two carrier cycles in each symbol so you can see them. Real radios use carriers of megahertz or gigahertz and many cycles per symbol; the maths is the same. Every curve and number in the figure is computed from this model.
- The Gray table 00 → −3, 01 → −1, 11 → +1, 10 → +3 is the one in the MIT 6.02 notes (ch. 14, Fig. 14-16). Which bit pair goes to I is a choice each standard fixes; here the first two bits pick I.
- The noise is pseudo-random with a fixed seed, so the figure shows the same points every time. Noise, SNR and error rates get their own lessons in the next module.
- MIT OpenCourseWare 6.02 (H. Balakrishnan, G. Verghese), Bits, Signals, and Packets, ch. 14 Modulation and Demodulation (QAM-16, Gray mapping table, quadrature demodulation)
- MIT OpenCourseWare 6.450 Principles of Digital Communications I (R. Gallager, L. Zheng): PAM and QAM modulation
- J. G. Proakis, Digital Communications, 3rd ed., McGraw-Hill, 1995 (Internet Archive record)
- S. Haykin, M. Moher, Communication Systems, 5th ed., Wiley, 2009
- A. V. Oppenheim, A. S. Willsky, S. H. Nawab, Signals and Systems, 2nd ed., Pearson (modulation, ch. 8)
- Quadrature amplitude modulation (Wikipedia): square grids, denser constellations are more susceptible to noise
- Constellation diagram (Wikipedia): I and Q axes, nearest-point decisions, noise clouds
- In-phase and quadrature components (Wikipedia)
- Gray code (Wikipedia): adjacent constellation points differ by one bit
- Wi-Fi 7 (Wikipedia): 4096-QAM carries 12 bits per symbol; Wi-Fi 6 uses 1024-QAM
- NumPy documentation: numpy.reshape (one dimension may be −1)
Quiz Unlocks after the last step.