S8 · Lesson 50 · Fading lab
Simulating BPSK with maximal-ratio combining over Rayleigh fading, outage probability with diversity, Clarke's Doppler channel with its autocorrelation and level crossings, and Alamouti transmit diversity
The formulas of lessons 43 to 46 describe fading channels through their statistics: an exponential distribution of power, a Bessel-function autocorrelation, a gamma distribution after combining. In this lab you'll generate fading channels sample by sample and check those statistics directly, then measure what diversity buys: error rates that fall as the SNR to the power L, outages that vanish, and Alamouti's trick of getting two-antenna diversity from the transmitter side with nothing to feed back.
- The curves are the outage probability at rate R of a Rayleigh channel with L independent branches combined: with .
- Each extra branch steepens the curve: at high SNR the outage falls as .
- At 20 dB and 2 bit/s/Hz, one branch is out 3% of the time, two branches 0.04%, four less than one in ten million.
Predict
A base station can either receive with two antennas (MRC) or transmit from two antennas with the Alamouti code, at the same total power. How do they compare?
Both make the decision statistic depend on , so both give diversity order two. But Alamouti must split the power between its two antennas without knowing the channel, while two receive antennas each collect the full transmitted power. Alamouti's error curve is the MRC curve shifted 3 dB to the right.
Name it
What the lab computes
- Rayleigh gains: with X and Y standard Gaussian, so . BPSK with MRC decides on , with exact error probability (lesson 44) , .
- Outage: the combined gain has a gamma distribution, giving the formula in the plot.
- Clarke's channel as a sum of M sinusoids with arrival angles and random phases :
Its autocorrelation approaches , and its envelope crosses a level ρ (relative to rms) upward times a second.
- Alamouti: send , then , each antenna at half power; combine and .
Check
Write mrc_ber(EbN0_db, L, n, seed): BPSK over L independent Rayleigh branches, each with average Eb/N0 as given, combined by MRC; return the bit error rate over n bits (random.Random(seed)).
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Write outage_mc(R, snr_db, L, n, seed): the fraction of n channel draws in which for L independent Rayleigh branches.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Write clarke(fd, fs, N, M, seed): N samples of Clarke's sum-of-sinusoids channel with arrival angles and phases from random.Random(seed), and autocorr(h, lag): the time-averaged divided by the average power.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Check
Write alamouti_ber(EbN0_db, n, seed): BPSK sent with the Alamouti code from two antennas, each at half power, to one receive antenna; independent Rayleigh gains per symbol pair; return the bit error rate over n bits.
Python 3.14 with numpy and matplotlib, running in your browser. Tab indents; press Esc and then Tab to move on.
Explain why
Why does diversity change the slope of the error-rate curve, while more transmit power only shifts along it?
On a Rayleigh channel, errors come almost entirely from deep fades, and the chance of a fade deep enough to cause an error falls only in proportion to the inverse of the average SNR. More power pushes every fade up equally, so it shifts the curve but leaves that inverse dependence alone. With L independently fading branches, an error needs all of them to be deep at once, and since they're independent the probabilities multiply, giving a dependence on the SNR to the minus L. That steeper slope is why a second antenna can be worth ten or more decibels of power at low error rates.