ENع
→I and Q
الدرس 60 · Digital modulation

I and Q: two carriers in one channel

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

18 دقيقة10 خطوات5 أسئلةAdvanced
عن هذا الدرس

A cosine and a sine at the same frequency are 90° apart, and over every carrier period they average to zero against each other. That lets one channel carry two numbers at once: I on cos(2π·fc·t) and Q on −sin(2π·fc·t). Follow two symbols, (0.60, 0.80) V and (−0.40, 0.30) V on a 2 kHz carrier, through the mixers and adder of a transmitter, then through the two mixers and low-pass filters of a receiver that pulls them apart again. You will see why a receiver's oscillator must stay in step, and write the pair as one complex number in Python with numpy. Builds on the lesson on carriers and mixing (DSB-SC), the Circuits lesson on phasors and the Maths lesson on Euler's formula.

ستتعلّم

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

شكل 60 · تفاعلي
01 / 10

Two numbers, one channel

We want to send two numbers at the same time over one radio channel: I = 0.60 V and Q = 0.80 V for 2 ms, then I = −0.40 V and Q = 0.30 V. Can one carrier frequency carry both?

symbol 0  (0 to 2 ms):  I = 0.60 V,  Q = 0.80 V
symbol 1  (2 to 4 ms):  I = −0.40 V,  Q = 0.30 V

one channel: one carrier frequency fc = 2 kHz
(a slow example; real radios use MHz to GHz,
 the maths is the same)

question: can one frequency carry two numbers
and still let the receiver pull them apart?
جارٍ تحميل الرسم…
أو ← →
اقرأ الدرس خطوة بخطوة
  1. Two numbers, one channel

    We want to send two numbers at the same time over one radio channel: I = 0.60 V and Q = 0.80 V for 2 ms, then I = −0.40 V and Q = 0.30 V. Can one carrier frequency carry both?

    symbol 0  (0 to 2 ms):  I = 0.60 V,  Q = 0.80 V
    symbol 1  (2 to 4 ms):  I = −0.40 V,  Q = 0.30 V
    
    one channel: one carrier frequency fc = 2 kHz
    (a slow example; real radios use MHz to GHz,
     the maths is the same)
    
    question: can one frequency carry two numbers
    and still let the receiver pull them apart?
  2. Two carriers a quarter turn apart

    One oscillator makes cos(2π·fc·t) at fc = 2 kHz. A 90° phase shifter also makes −sin(2π·fc·t): the same wave, a quarter period (0.125 ms) earlier. The two are "in quadrature".

    fc = 2 kHz  ->  period Tc = 1/fc = 0.5 ms
    
    I carrier:  cos(2π·fc·t)
    Q carrier: −sin(2π·fc·t) = cos(2π·fc·t + 90°)
               a quarter period = 0.125 ms ahead
    
    the dial: two hands 90° apart turning at fc
    (I hand blue, Q hand pink; slowed down)
    phasors: see Circuits, "Phasors"
  3. Each number rides its own carrier

    A mixer multiplies its two inputs. The I mixer makes I·cos(2π·fc·t), the Q mixer makes −Q·sin(2π·fc·t). Each product is a carrier whose size and sign follow its number, and change when the symbol changes.

    I arm:  I(t)·cos(2π·fc·t)
            peak 0.60 V, then −0.40 V (sign flips)
    Q arm: −Q(t)·sin(2π·fc·t)
            peak 0.80 V, then 0.30 V
    
    this is the DSB-SC mixing from the lesson
    "Carriers and mixing", done twice
  4. Add them: one signal on the channel

    The adder sums both products into s(t) = I·cos(2π·fc·t) − Q·sin(2π·fc·t), sent over the one channel. It is still a single 2 kHz wave; the two numbers set its size and its timing (phase).

    s(t) = I·cos(2π·fc·t) − Q·sin(2π·fc·t)
    
    same as  A·cos(2π·fc·t + φ)
      A = √(I² + Q²)     (size)
      φ = atan2(Q, I)    (phase)
    
    both arms share the band around fc:
    two numbers in the bandwidth of one
  5. Receiver: multiply by the same carriers

    The receiver splits s(t) into two arms. Its own oscillator, in step with the sender's, gives 2·cos and −2·sin. Each product wobbles at 2·fc = 4 kHz around a steady level.

    I arm:  pI(t) =  2·s(t)·cos(2π·fc·t)
    Q arm:  pQ(t) = −2·s(t)·sin(2π·fc·t)
    
    the factor 2 makes the level come out
    as I and Q exactly, not I/2 and Q/2
    
    the receiver oscillator must match the
    sender's frequency and phase
  6. Why the other number drops out

    Trigonometry: 2·cos·cos = 1 + cos(2·2πfc·t), but 2·sin·cos = sin(2·2πfc·t). So pI = I + ripple at 4 kHz. Q only adds ripple, which averages to zero over every carrier period.

    pI = 2(I·cos − Q·sin)·cos
       = I·(1 + cos 2ωt) − Q·sin 2ωt
       = I  +  ripple at 2fc
    pQ = −2(I·cos − Q·sin)·sin
       = Q  −  Q·cos 2ωt − I·sin 2ωt
       = Q  +  ripple at 2fc
    (ω = 2π·fc)
    
    dashed lines: the steady levels I and Q
  7. A low-pass filter keeps the level

    A low-pass filter removes the 4 kHz ripple. Here it averages the last 0.5 ms, one carrier period, which cancels that ripple exactly. Out come I = 0.60 and Q = 0.80 V, then −0.40 and 0.30 V.

    filter: average of the last L = 100 samples
      (sampled at 200 kHz: 100 × 5 µs = 0.5 ms)
      y[n] = (1/L)·(p[n] + p[n−1] + ... + p[n−L+1])
    
    4 kHz ripple: 2 whole periods in 0.5 ms
      -> its average is exactly 0
    
    after a symbol change the output takes
    0.5 ms to settle (the ramps)
  8. Each pair is a point: the constellation

    Draw each pair (I, Q) as a point. Its distance from the centre is the wave's amplitude (1.00 V, then 0.50 V); its angle is the phase (53.1°, then 143.1°). This picture is a constellation.

    point 0: (0.60, 0.80)
      A = √(0.6² + 0.8²) = 1.00 V
      φ = atan2(0.8, 0.6) = 53.1°
    point 1: (−0.40, 0.30)
      A = √(0.4² + 0.3²) = 0.50 V
      φ = atan2(0.3, −0.4) = 143.1°
    
    choosing points from a fixed set is how
    PSK and QAM send bits (next lessons)
  9. Out of step: the points turn

    If the receiver's oscillator is 30° out of step, every point turns by 30°: (0.60, 0.80) comes out as (0.92, 0.39). I and Q leak into each other. Real receivers lock their phase with a loop.

    receiver uses cos(ωt + θ), θ = 30°
    
    I' = I·cosθ + Q·sinθ
    Q' = Q·cosθ − I·sinθ
    
    (0.60, 0.80)  ->  (0.92, 0.39)
    (−0.40, 0.30)  ->  (−0.20, 0.46)
    
    θ = 90° would swap them completely.
    fix: carrier recovery, a phase-locked loop
    (e.g. a Costas loop) keeps θ near 0
  10. One complex number per point

    Engineers write each pair as one complex number, x = I + jQ. Then s(t) = Re{x·e^(j2πfc·t)}. In Python with numpy: s = np.real((0.6+0.8j)*np.exp(2j*np.pi*fc*t)).

    import numpy as np            # Python 3
    fc = 2000                     # Hz
    t  = np.arange(400) / 200e3   # 2 ms, 5 µs steps
    x  = 0.6 + 0.8j               # I + jQ
    s  = np.real(x * np.exp(2j*np.pi*fc*t))
    
    # same as 0.6*cos(...) - 0.8*sin(...)
    # receiver: average of 2*s*exp(-2j*pi*fc*t)
    # over whole periods gives back x
    >>> np.round(np.mean(2*s*np.exp(-2j*np.pi*fc*t)), 6)
    np.complex128(0.6+0.8j)    # numpy 2

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