I and Q: two carriers in one channel
لم يُترجم بعد؛ يُعرض باللغة الإنجليزية
عن هذا الدرس
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.
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?
اقرأ الدرس خطوة بخطوة
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?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"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 twiceAdd 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 oneReceiver: 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 phaseWhy 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 QA 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)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)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 0One 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
أسئلة سريعة: 5
اختر إجابة واحدة لكل سؤال. يمكنك تغيير اختياراتك قبل التحقق منها.
01Why can I and Q share the same carrier frequency without the receiver mixing them up?
The two carriers are orthogonal: the mean of cos(ωt)·sin(ωt) over a whole period is zero. After multiplying by cos, the Q part becomes only ripple at 2fc, which the low-pass filter removes.
02I = 0.6 V and Q = 0.8 V. What are the amplitude and phase of s(t) = I·cos(ωt) − Q·sin(ωt)?
A = √(0.6² + 0.8²) = 1.0 V and φ = atan2(0.8, 0.6) = 53.1°, so s(t) = 1.0·cos(ωt + 53.1°).
03The receiver multiplies s(t) by 2·cos(2π·fc·t) with fc = 2 kHz. At what frequency is the ripple the low-pass filter must remove?
2·cos·cos = 1 + cos(2·2π·fc·t) and 2·sin·cos = sin(2·2π·fc·t): the ripple is at 2fc = 4 kHz, while the wanted level I sits at 0 Hz.
04The receiver's oscillator is 90° out of step with the sender's. What comes out of the I and Q filters?
A phase error θ turns every point: I' = I·cosθ + Q·sinθ and Q' = Q·cosθ − I·sinθ. With θ = 90°, I' = Q and Q' = −I, so the two numbers swap.
05In Python with numpy, which line builds s(t) for the point I + jQ = 0.6 + 0.8j?
Re{(I + jQ)·e^(jωt)} = I·cos(ωt) − Q·sin(ωt). np.abs would give the constant amplitude 1.0, and the other two are not real I/Q signals of this form.
المسرد
- Carrier
- A sine wave at a fixed frequency fc that a message is put onto so it can travel in a chosen band.
- In-phase (I) and quadrature (Q)
- The parts of a signal riding on cos(2π·fc·t) and on the carrier shifted by 90°, −sin(2π·fc·t).
- Quadrature
- Being 90° (a quarter period) apart. Two carriers in quadrature are orthogonal: their product averages to zero over a period.
- Mixer
- A block that multiplies two signals. Multiplying by a carrier moves a signal up to fc, or back down from it.
- Low-pass filter
- A filter that keeps slow changes and removes fast ones; here it removes the 2fc ripple and keeps the level I or Q.
- Constellation
- A plot of each (I, Q) pair as a point; distance from the centre is amplitude, angle is phase.
- Phase error
- The angle by which the receiver's oscillator is out of step with the sender's; it turns every received point.
- Complex baseband
- Writing the pair as one complex number x = I + jQ, so s(t) = Re{x·e^(j2π·fc·t)}.
الملاحظات والمصادر
- fc = 2 kHz and the two symbols are chosen so every number is easy to check; real radios put I and Q on carriers of MHz to GHz. Every curve and value in the figure is computed from this model by simulating the signals at 200 kHz.
- Books differ on the sign of the Q term: some write s(t) = I·cos + Q·sin. It only decides which way the Q carrier is shifted; the receiver uses the matching sign.
- The low-pass filter here is a moving average over one carrier period, chosen because it removes the 2fc ripple exactly. Real receivers use sharper low-pass filters and the matched filter from the lesson on it.
- The motion is slowed down a great deal: the oscillator hands really turn 2000 times a second.
- J. G. Proakis, M. Salehi, Fundamentals of Communication Systems, 2nd ed., Pearson (§3.4.2 quadrature-carrier multiplexing, §8.7 QAM, §8.8 PLL and Costas loop)
- A. V. Oppenheim, A. S. Willsky, S. H. Nawab, Signals and Systems, 2nd ed., Pearson (ch. 8: communication systems, sinusoidal amplitude modulation and demodulation)
- MIT OpenCourseWare 6.02 (Fall 2012), notes ch. 14: Modulation and Demodulation (§14.4 quadrature demodulation and phase error)
- MIT OpenCourseWare 6.02 Introduction to EECS II: Digital Communication Systems, readings
- MIT OpenCourseWare 6.450 Principles of Digital Communications I (R. Gallager, L. Zheng), lecture notes ch. 6: channels, modulation and demodulation
- Quadrature amplitude modulation (Wikipedia): two carriers 90° apart, demodulation by multiplying and low-pass filtering, crosstalk when clock phases drift
- In-phase and quadrature components (Wikipedia): A·cos(ωt + φ) = A·cosφ·cos ωt − A·sinφ·sin ωt
- Costas loop (Wikipedia): a PLL-based circuit for carrier recovery with I and Q arms
- NumPy documentation: numpy.exp (complex arguments)
- NumPy documentation: numpy.real
اختبار يتاح بعد الخطوة الأخيرة.