Exercises
ex-sp-ch23-01
EasyImplement ZF detection for a 2x2 MIMO system with BPSK and verify that it correctly recovers the transmitted symbols in a noise-free case.
Implementation
H = np.array([[1, 0.5], [0.3, 1]], dtype=complex)
x = np.array([1, -1], dtype=complex)
y = H @ x
x_hat = np.linalg.pinv(H) @ y
print(f"Recovered: {np.sign(np.real(x_hat))}")
ex-sp-ch23-02
EasyCompute the SVD of a 4x4 MIMO channel and verify that and are unitary.
Implementation
H = (np.random.randn(4,4) + 1j*np.random.randn(4,4)) / np.sqrt(2)
U, S, Vh = np.linalg.svd(H)
print(f"U unitary: {np.allclose(U @ U.conj().T, np.eye(4))}")
print(f"V unitary: {np.allclose(Vh @ Vh.conj().T, np.eye(4))}")
ex-sp-ch23-03
EasyImplement ML detection for a 2x2 MIMO system with BPSK ( candidates).
Implementation
from itertools import product
const = np.array([1, -1], dtype=complex)
best_x, best_d = None, np.inf
for x_cand in product(const, repeat=2):
x_vec = np.array(x_cand)
d = np.sum(np.abs(y - H @ x_vec)**2)
if d < best_d: best_d, best_x = d, x_vec
ex-sp-ch23-04
EasyShow that for a diagonal channel , ZF detection is equivalent to per-element division.
Proof
For diagonal , , so ZF reduces to .
ex-sp-ch23-05
EasyCompute the condition number of 1000 random 4x4 MIMO channels and plot the histogram.
Implementation
conds = [np.linalg.cond((np.random.randn(4,4)+1j*np.random.randn(4,4))/np.sqrt(2)) for _ in range(1000)]
ex-sp-ch23-06
MediumSimulate 2x2 MIMO BER for ZF, MMSE, and ML detectors with QPSK over 10000 channel realizations. Plot BER vs .
Implementation
# See code supplement ch23/python/mimo_detection.py
ex-sp-ch23-07
MediumImplement V-BLAST with ordered SIC for a 4x4 MIMO system. Compare BER with ZF and MMSE.
Implementation
# See code supplement ch23/python/mimo_detection.py
ex-sp-ch23-08
MediumImplement SVD precoding with water-filling for a 4x4 MIMO channel. Compare capacity with equal power allocation.
Implementation
# See code supplement ch23/python/mimo_precoding.py
ex-sp-ch23-09
MediumImplement ZF precoding for a 4x2 multi-user MIMO downlink (4 BS antennas, 2 single-antenna users). Show zero inter-user interference.
Implementation
H = (np.random.randn(2,4) + 1j*np.random.randn(2,4)) / np.sqrt(2)
W = H.conj().T @ np.linalg.inv(H @ H.conj().T)
W /= np.linalg.norm(W, axis=0, keepdims=True)
# H @ W should be diagonal
print(np.abs(H @ W).round(3))
ex-sp-ch23-10
MediumSimulate massive MIMO with antennas and users. Show that conjugate BF BER improves with and approaches ZF.
Implementation
# See code supplement ch23/python/massive_mimo.py
ex-sp-ch23-11
HardImplement a sphere decoder for 4x4 MIMO with QPSK. Compare its BER with ML and ZF, and measure the average number of nodes visited.
Approach
Use QR decomposition and tree search with Schnorr-Euchner enumeration.
ex-sp-ch23-12
HardSimulate the effect of imperfect CSI on ZF precoding. Model channel estimation error as and show the BER floor.
Approach
The residual interference from imperfect CSI creates a BER floor that depends on .
ex-sp-ch23-13
HardImplement regularized ZF (RZF) precoding for multi-user MIMO: . Find the optimal that maximizes sum rate.
Approach
Sweep from 0 to and compute sum rate for each.
ex-sp-ch23-14
HardSimulate pilot contamination in massive MIMO: two cells with antennas each, users per cell, sharing the same pilot sequences. Show the SINR floor.
Approach
The estimated channel includes contributions from both cells' users, creating permanent inter-cell interference.
ex-sp-ch23-15
ChallengeImplement MIMO-OFDM with per-subcarrier ZF detection for a 2x2 system over a frequency-selective channel. Compare with single-antenna OFDM.
Approach
At each subcarrier , the 2x2 channel is obtained from the FFT of each antenna pair's channel impulse response.
ex-sp-ch23-16
ChallengeImplement the diversity-multiplexing trade-off (DMT) simulation: show that a 2x2 MIMO system can achieve diversity order 4 (Alamouti) or multiplexing gain 2 (V-BLAST), but not both simultaneously.
Approach
Implement Alamouti STBC for full diversity and V-BLAST for full multiplexing. Plot BER slope and rate to visualize the trade-off.