S850 of 56
0 XP
  1. Hook
  2. Play
  3. Predict
  4. Name it
  5. Check
  6. Explain

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: 1−e−x∑k=0L−1xk/k! with x=(2R−1)/SNR.
  • Each extra branch steepens the curve: at high SNR the outage falls as SNR−L.
  • 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?

Name it

What the lab computes

  • Rayleigh gains: h=(X+jY)/2 with X and Y standard Gaussian, so E|h|2=1. BPSK with MRC decides on Re∑lhl*yl, with exact error probability (lesson 44) (1−μ2)L∑k=0L−1(L−1+kk)(1+μ2)k, μ=γ¯/(1+γ¯).
  • Outage: the combined gain ∑|hl|2 has a gamma distribution, giving the formula in the plot.
  • Clarke's channel as a sum of M sinusoids with arrival angles αm=2π(m+14)/M and random phases ϕm:
hn=1M∑mej(2πfdcos⁡αmn/fs+ϕm)

Its autocorrelation approaches J0(2πfdτ), and its envelope crosses a level ρ (relative to rms) upward 2πfdρe−ρ2 times a second.

  • Alamouti: send (x1,x2), then (−x2*,x1*), each antenna at half power; combine z1=h1*y1+h2y2* and z2=h2*y1−h1y2*.

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 log2⁡(1+SNR∑l|hl|2)<R 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 2π(m+14)/M and phases from random.Random(seed), and autocorr(h, lag): the time-averaged Rehn+laghn* 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?