ENع
→QAM and constellations
الدرس 63 · Digital modulation

QAM and constellation diagrams

لم يُترجم بعد؛ يُعرض باللغة الإنجليزية

16 دقيقة11 خطوة5 أسئلةAdvanced
عن هذا الدرس

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.

ستتعلّم

حدّد ما تشعر بأنك أتقنته. هذا التقييم الذاتي لا يؤثر في درجة الدرس.

شكل 63 · تفاعلي
01 / 11

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
جارٍ تحميل الرسم…
أو ← →
اقرأ الدرس خطوة بخطوة
  1. 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
  2. Two 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)
  3. 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)
  4. 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)
  5. 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)
  6. 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)
  7. 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/s
  8. The 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 -> 0110
  9. Noise: 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 bit
  10. More 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-QAM
  11. 16-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)

اختبار يتاح بعد الخطوة الأخيرة.