Phase-shift keying: BPSK and QPSK
لم يُترجم بعد؛ يُعرض باللغة الإنجليزية
عن هذا الدرس
Phase-shift keying puts bits on a radio carrier by choosing where in its cycle the wave starts. Follow the bits 1 0 1 1 0 0 0 1 through a transmitter and a receiver: BPSK sends one bit per 1 ms symbol as a 3000 Hz carrier times +1 or −1, and a correlator (multiply by the carrier, then integrate) reads each bit back from its sign. Then QPSK puts a second bit on the sine, which the cosine correlator cannot see, and sends all eight bits in the same 4 ms. You will read BPSK and QPSK constellation diagrams, see why Gray coding helps, and build BPSK and its receiver in Python with numpy. Builds on the lessons "I and Q: two carriers in one channel" and "ASK and FSK" in this module, and goes deeper than the Hardware lesson on radio-frequency basics and the Networking lesson on wireless basics.
The carrier: a steady wave
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.
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)اقرأ الدرس خطوة بخطوة
The carrier: a steady wave
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.
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)BPSK: the bit picks the phase
Binary PSK sends one bit per symbol. Bit 1 sends the carrier as it is: phase 0°. Bit 0 sends it half a cycle later: phase 180°. Each symbol lasts T = 1 ms, which is 3 carrier cycles here.
symbol rate 1000 symbols/s, T = 1 ms cycles per symbol fc·T = 3 bit 1 -> s(t) = A·cos(2π·fc·t + 0°) bit 0 -> s(t) = A·cos(2π·fc·t + 180°) bits 1 0 1 1 phase 0° 180° 0° 0° 1 bit per symbol -> 1000 bit/sA phase flip is a sign flip
Shifting a cosine by half a cycle turns it upside down: cos(ωt + π) = −cos(ωt). So BPSK is the carrier times +1 or −1. A mixer is a multiplier; where the bit changes, the wave jumps.
ω = 2π·fc (angular frequency, rad/s) cos(ωt + π) = −cos(ωt) so s(t) = a·A·cos(ωt), a = 2b − 1 bit 1 -> a = +1 bit 0 -> a = −1 mixer = multiplier: carrier × a see t = 1 ms (1 -> 0) and t = 2 ms (0 -> 1): the wave reverses at the boundaryTwo points on a line
Draw each symbol as a point: how much cosine it holds. BPSK has two points, +1 and −1, on the I axis (I for in-phase, the cosine). This picture is a constellation diagram. Its two points are 2.0 apart.
constellation diagram x axis I (amount of cosine) y axis Q (amount of −sin, used later) BPSK points bit 1 -> (I, Q) = (+1, 0) bit 0 -> (I, Q) = (−1, 0) distance between them: 2.0 (further apart = harder for noise to confuse)Multiply by the carrier, then add up
The receiver multiplies what arrives by its own copy of the carrier. For bit 1 that gives cos², never negative; for bit 0, never positive. It then adds up (integrates) over the symbol. Multiply-then-integrate is a correlator.
z(t) = (2/T)·∫ s(τ)·cos(ωτ) dτ from the symbol start to t bit 1: s·cos = A·cos²(ωt) >= 0 -> z climbs bit 0: s·cos = −A·cos²(ωt) <= 0 -> z falls cos² = (1 + cos 2ωt)/2: average 1/2, so after a whole symbol z = ±A the receiver's carrier must be in phase (coherent detection)Decide by the sign
At the end of each symbol the correlator holds +1 or −1, then resets. Positive means 1, negative means 0. Noise would have to push the result past zero, a whole 1.0 away, to flip a bit.
end of symbol k: z = 1.00, −1.00, 1.00, 1.00 decision: z > 0 -> 1, z < 0 -> 0 bits out: 1 0 1 1 the dot on the constellation is (z, 0): it runs from 0 out to its point margin to the threshold (0): 1.0 half the distance between the pointsThe sine is invisible to the cosine
Now feed the cosine correlator −sin(ωt), the carrier shifted 90°. Over whole cycles cos·sin adds up to exactly 0. So a second bit stream can ride on the sine without disturbing the first. See the lesson “I and Q: two carriers in one channel”.
(2/T)·∫ −sin(ωt)·cos(ωt) dt = −(1/T)·∫ sin(2ωt) dt = 0 over a symbol, since fc·T = 3 is whole largest wiggle inside the symbol: 0.053 value at the end: 0.000 cos and sin are orthogonal: the I branch never sees the Q branchQPSK: two bits per symbol
Quadrature PSK sends two bits per symbol. The first bit sets the sign of the cosine part (I), the second the sign of the −sin part (Q), each 0.71 V. Added, they make one cosine with one of four phases.
I = (2·b1 − 1)/√2, Q = (2·b2 − 1)/√2 s(t) = A·(I·cos ωt − Q·sin ωt) = A·cos(ωt + φ), φ = atan2(Q, I) pair I Q phase 10 0.71 −0.71 315° 11 0.71 0.71 45° 00 −0.71 −0.71 225° 01 −0.71 0.71 135° 2 bits per symbol -> 2000 bit/sFour points on a circle
QPSK's constellation has four points, all at radius 1. Going round, 11, 01, 00, 10, neighbours differ in one bit only: Gray coding. A small noise error that lands on a neighbour costs one bit, not two.
points (I, Q) = (±0.71, ±0.71) radius √(I² + Q²) = 1 (same power as BPSK) 45° 11 135° 01 225° 00 315° 10 neighbours 1.41 apart, one bit different (Gray code)Two correlators, twice the bits
A cosine correlator reads I and a −sin correlator reads Q, at once. Eight bits arrive in 4 ms, not four: same symbol rate and bandwidth (range of frequencies used), twice the bit rate. At equal energy per bit, errors are as rare as BPSK.
end of symbol k: z_I = 0.71, 0.71, −0.71, −0.71 z_Q = −0.71, 0.71, −0.71, 0.71 signs -> bits 1 0 1 1 0 0 0 1 bit error rate in white noise (Gray QPSK = BPSK): Pb = Q(√(2·Eb/N0)) Eb = energy per bit, N0 = noise level BPSK: GPS satellites (C/A code) BPSK: Wi-Fi 802.11g at 6 and 9 Mbit/sPSK in Python
With numpy, np.outer builds one row of carrier per symbol, already times +1 or −1: that is BPSK. The last line multiplies by the carrier and averages each row, the correlator. Out come +1, −1, +1, +1: bits 1 0 1 1.
import numpy as np b = np.array([1, 0, 1, 1]) t = np.arange(48) / 48000 c = np.cos(2*np.pi*3000*t) s = np.outer(2*b - 1, c) y = 2 * (s * c).mean(axis=1) >>> s.shape (4, 48) # 4 symbols, 48 samples each >>> y array([ 1., -1., 1., 1.]) 48 000 samples/s, 1 ms symbols, 3 kHz carrier 2 × mean = (2/T)·∫ ... dt (Python 3 with numpy)
أسئلة سريعة: 5
اختر إجابة واحدة لكل سؤال. يمكنك تغيير اختياراتك قبل التحقق منها.
01In BPSK, how does the transmitted wave for bit 0 differ from the wave for bit 1?
BPSK uses the phases 0° and 180°. Since cos(ωt + π) = −cos(ωt), bit 0 sends the carrier times −1. Amplitude and frequency stay the same.
02A correlator multiplies a BPSK symbol by cos(ωt) and computes (2/T)·∫ over the symbol. The symbol is −A·cos(ωt), with a whole number of cycles in T. What comes out?
The product is −A·cos²(ωt), which averages −A/2 over whole cycles; times 2 gives −A. The sign is negative, so the receiver decides bit 0.
03Why can QPSK carry a second bit on the sine without disturbing the bit on the cosine?
cos and sin at the same frequency are orthogonal: (2/T)·∫ cos(ωt)·sin(ωt) dt = 0 when T holds whole cycles. In the figure the cosine correlator fed a pure sine wiggles by at most 0.053 and ends at 0.
04QPSK uses the Gray-coded points 11 (45°), 01 (135°), 00 (225°) and 10 (315°). Noise moves a 11 symbol to its neighbour at 135°. How many bits are wrong?
11 is decided as 01: only the first bit changed. Gray coding makes every pair of neighbours differ in exactly one bit, so the most likely errors cost one bit.
05Both schemes send 1000 symbols per second. How do QPSK and BPSK compare?
Same symbol rate (and the same pulse shape) means the same bandwidth. QPSK carries 2 bits per symbol, so 2000 bit/s instead of 1000. For the same energy per bit, Gray QPSK has the same bit error rate, Q(√(2Eb/N0)), as BPSK.
المسرد
- Carrier
- A steady sine wave at the radio frequency fc; modulation changes its amplitude, frequency or phase to carry data.
- Phase
- Where in its cycle a wave is at a given instant, in degrees or radians. A 180° shift turns a cosine upside down.
- Phase-shift keying (PSK)
- Sending data by choosing one of a few carrier phases for each symbol. BPSK uses 2 phases (1 bit per symbol), QPSK uses 4 (2 bits).
- Symbol
- One chunk of the transmitted signal, lasting T seconds, that carries a fixed number of bits.
- Mixer
- A multiplier: it multiplies two signals, for example the carrier by +1 or −1, or the received signal by the receiver's own carrier.
- Correlator
- Multiply the received signal by a reference wave, then integrate over the symbol. Its output at the end of the symbol is used to decide the bits.
- Bandwidth
- The range of frequencies a signal occupies. With the same pulse shape it grows with the symbol rate, not with the bits per symbol.
- I and Q
- In-phase (cosine) and quadrature (−sine here) parts of a signal. They are orthogonal, so each can carry its own data.
- Constellation diagram
- A plot of the symbols as points (I, Q). BPSK has 2 points on a line, QPSK 4 points on a circle.
- Gray coding
- Labelling neighbouring constellation points so they differ in only one bit, so the most likely errors flip a single bit.
الملاحظات والمصادر
- 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.
- 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.
- J. G. Proakis, Digital Communications, 3rd ed., McGraw-Hill, 1995: PSK signal space, correlation receiver, error rates (Internet Archive record)
- S. Haykin, Communication Systems, 4th ed., Wiley, 2001: coherent BPSK and QPSK (Internet Archive record)
- MIT OpenCourseWare 6.02, Digital Communication Systems (Balakrishnan, Verghese, Fall 2012), notes ch. 14: Modulation and Demodulation
- MIT OpenCourseWare 6.02 readings (all chapters)
- MIT OpenCourseWare 6.450, Principles of Digital Communications I (Gallager, Zheng, Fall 2006): PAM and QAM, constellations, detection
- Phase-shift keying (Wikipedia): BPSK phases 0 and π, Gray-coded QPSK, BER = Q(√(2Eb/N0)), Wi-Fi uses
- GPS signals (Wikipedia): the C/A code is sent on L1 by BPSK at 1.023 Mchip/s
- NumPy documentation: numpy.outer
- NumPy documentation: numpy.cos (angles in radians)
اختبار يتاح بعد الخطوة الأخيرة.