Exercises

ex-sp-ch09-01

Easy

Use scipy.stats.norm to compute P(X>2)P(|X| > 2) for XN(0,1)X \sim \mathcal{N}(0, 1). Verify by drawing 10610^6 samples and computing the empirical probability.

ex-sp-ch09-02

Easy

Generate 10000 pairs of correlated Gaussian random variables with ρ=0.6\rho = 0.6 using the Cholesky decomposition. Compute the sample correlation and verify it matches the target.

ex-sp-ch09-03

Easy

Write a BPSK BER simulation for a single Eb/N0=8E_b/N_0 = 8 dB point with 10610^6 bits. Compare the simulated BER to the theoretical Pb=Q(2Eb/N0)P_b = Q(\sqrt{2 E_b/N_0}).

ex-sp-ch09-04

Easy

Generate 50000 Rayleigh fading channel coefficients hCN(0,1)h \sim \mathcal{CN}(0, 1). Plot a histogram of h|h| and overlay the theoretical Rayleigh PDF. Verify with a KS test.

ex-sp-ch09-05

Easy

Compute the 95% confidence interval for P^b=0.0023\hat{P}_b = 0.0023 with N=100000N = 100000 bits using both the normal approximation and the Clopper-Pearson exact method.

ex-sp-ch09-06

Medium

Fit Rayleigh, Rice, and Nakagami distributions to synthetic Rice-distributed data (K=3K = 3 dB). Use the KS test to rank the fits. Plot all three fitted PDFs against the histogram.

ex-sp-ch09-07

Medium

Implement a two-sample t-test to compare the mean BER of two MIMO detectors (ZF and MMSE). Run 30 independent trials at Eb/N0=10E_b/N_0 = 10 dB for each detector and test for a significant difference at α=0.05\alpha = 0.05.

ex-sp-ch09-08

Medium

Write a BER simulation with error-count stopping (minimum 100 errors) for BPSK over AWGN. Run for Eb/N0=0,2,4,6,8,10E_b/N_0 = 0, 2, 4, 6, 8, 10 dB. Report BER, error count, total bits, and 95% CI for each point.

ex-sp-ch09-09

Medium

Generate a 2×22 \times 2 Kronecker MIMO channel with ρt=0.3\rho_t = 0.3, ρr=0.8\rho_r = 0.8. Generate 5000 realizations and verify the vectorized channel covariance matches RtRr\mathbf{R}_t^* \otimes \mathbf{R}_r.

ex-sp-ch09-10

Medium

Use antithetic variates to estimate the BER of BPSK at Eb/N0=6E_b/N_0 = 6 dB with N=105N = 10^5 samples. Compare the variance of the estimator with crude Monte Carlo over 100 independent runs.

ex-sp-ch09-11

Medium

Parallelize a BPSK BER simulation across 4 SNR points using concurrent.futures.ProcessPoolExecutor. Use SeedSequence.spawn() for independent random streams.

ex-sp-ch09-12

Hard

Implement importance sampling for BPSK BER estimation at Eb/N0=14E_b/N_0 = 14 dB. Use exponential tilting with shift μ=d\mu = d (decision boundary). With only N=1000N = 1000 IS samples, compare the accuracy to crude MC with N=107N = 10^7 samples.

ex-sp-ch09-13

Hard

Generate a time-varying Rayleigh channel using Jakes' model for a mobile at 120 km/h, carrier frequency 3.5 GHz, sampled at 10 kHz. Plot the channel magnitude (dB) vs time and verify the level crossing rate matches theory: NR=2πfdρeρ2N_R = \sqrt{2\pi} f_d \rho e^{-\rho^2} where ρ\rho is the normalized threshold.

ex-sp-ch09-14

Hard

Simulate BPSK over a Rayleigh fading channel for Eb/N0=0E_b/N_0 = 0 to 3030 dB. Verify the simulated BER matches the theoretical Pb=12(1γˉ1+γˉ)P_b = \frac{1}{2}\left(1 - \sqrt{\frac{\bar{\gamma}}{1+\bar{\gamma}}}\right) where γˉ=Eb/N0\bar{\gamma} = E_b/N_0. Use error-count stopping with kmin=200k_{\min} = 200 errors.

ex-sp-ch09-15

Hard

Implement control variates for estimating the average capacity C=E[log2(1+γh2)]C = E[\log_2(1 + \gamma |h|^2)] of a Rayleigh fading channel. Use h2|h|^2 as the control variate (known mean = 1) and quantify the variance reduction over 1000 independent runs.

ex-sp-ch09-16

Hard

Build a 3GPP TDL-A channel model with 7 taps. Generate 10000 channel impulse response realizations. Compute the power delay profile and verify the per-tap powers match the standard values. Compute the RMS delay spread.

ex-sp-ch09-17

Challenge

Design an adaptive importance sampling scheme for estimating the BER of 16-QAM over AWGN. The challenge: 16-QAM has multiple decision boundaries, so a single shift is suboptimal. Implement a mixture proposal that shifts toward each nearest boundary. Compare convergence with crude MC at Eb/N0=15E_b/N_0 = 15 dB.

ex-sp-ch09-18

Challenge

Build a complete 4×44 \times 4 MIMO link-level simulator with: (a) Kronecker channel model with ρt=ρr=0.5\rho_t = \rho_r = 0.5, (b) ZF and MMSE detection, (c) BPSK modulation, (d) error-count stopping with kmin=100k_{\min} = 100. Plot BER vs SNR for both detectors on the same graph. Include 95% confidence intervals as error bars.