Generating Fading Channels

Why Channel Generation Is a Core Simulation Skill

Every wireless link-level simulation begins with generating channel realizations. A single-tap Rayleigh coefficient models flat fading; a Ricean coefficient adds a line-of-sight component; a MIMO matrix with Kronecker correlation models realistic antenna arrays. Time-varying channels require Jakes' model or 3GPP spatial channel models.

Getting the channel statistics wrong invalidates everything downstream: BER curves, capacity results, and beamforming gains. This section teaches you to generate all these channels correctly in NumPy.

Definition:

Rayleigh Fading Channel

A Rayleigh fading channel coefficient is:

h∼CN(0,Οƒ2)h \sim \mathcal{CN}(0, \sigma^2)

The envelope ∣h∣|h| follows a Rayleigh distribution with parameter Οƒ\sigma, and the power ∣h∣2|h|^2 follows an exponential distribution with mean Οƒ2\sigma^2.

rng = np.random.default_rng(42)
N = 100000
h = (rng.standard_normal(N) + 1j * rng.standard_normal(N)) \
    * np.sqrt(sigma2 / 2)

The Rayleigh model applies when there is no dominant line-of-sight path and many scattered multipath components contribute to the signal.

Definition:

Ricean Fading Channel

A Ricean fading channel with KK-factor KK is:

h=KK+1 hLOS+1K+1 hNLOSh = \sqrt{\frac{K}{K+1}}\,h_{\mathrm{LOS}} + \sqrt{\frac{1}{K+1}}\,h_{\mathrm{NLOS}}

where hLOS=ejΟ•h_{\mathrm{LOS}} = e^{j\phi} is the deterministic LOS component and hNLOS∼CN(0,1)h_{\mathrm{NLOS}} \sim \mathcal{CN}(0, 1).

The envelope ∣h∣|h| follows a Rice distribution. When K=0K = 0, Ricean reduces to Rayleigh; as Kβ†’βˆžK \to \infty, the channel becomes AWGN.

def rice_channel(K, N, rng):
    h_los = np.exp(1j * rng.uniform(0, 2*np.pi))
    h_nlos = (rng.standard_normal(N)
              + 1j * rng.standard_normal(N)) / np.sqrt(2)
    return np.sqrt(K/(K+1)) * h_los \
         + np.sqrt(1/(K+1)) * h_nlos

The KK-factor is typically 0-20 dB. Indoor environments with a clear LOS path have Kβ‰ˆ6K \approx 6-1010 dB; dense urban NLOS has Kβ‰ˆ0K \approx 0 (Rayleigh).

Definition:

Nakagami-mm Fading

The Nakagami-mm distribution generalizes Rayleigh (m=1m=1) and approximates Rice. The envelope PDF is:

f∣h∣(r)=2mmr2mβˆ’1Ξ“(m)Ξ©mexp⁑ ⁣(βˆ’mr2Ξ©),rβ‰₯0f_{|h|}(r) = \frac{2m^m r^{2m-1}}{\Gamma(m)\Omega^m} \exp\!\left(-\frac{mr^2}{\Omega}\right), \quad r \ge 0

where Ξ©=E[∣h∣2]\Omega = E[|h|^2] and mβ‰₯1/2m \ge 1/2.

from scipy.stats import nakagami
m = 2.0
samples = nakagami.rvs(m, scale=np.sqrt(omega), size=N)

The power ∣h∣2|h|^2 follows a Gamma distribution: ∣h∣2βˆΌΞ“(m,Ξ©/m)|h|^2 \sim \Gamma(m, \Omega/m).

Definition:

Kronecker MIMO Channel Model

For an NrΓ—NtN_r \times N_t MIMO system, the Kronecker model generates:

H=Rr1/2Hw(Rt1/2)T\mathbf{H} = \mathbf{R}_r^{1/2} \mathbf{H}_w (\mathbf{R}_t^{1/2})^T

where Hw\mathbf{H}_w has i.i.d. CN(0,1)\mathcal{CN}(0,1) entries, Rr∈CNrΓ—Nr\mathbf{R}_r \in \mathbb{C}^{N_r \times N_r} is the receive correlation, and Rt∈CNtΓ—Nt\mathbf{R}_t \in \mathbb{C}^{N_t \times N_t} is the transmit correlation.

def kronecker_mimo(Rr, Rt, rng):
    Nr, Nt = Rr.shape[0], Rt.shape[0]
    Lr = np.linalg.cholesky(Rr)
    Lt = np.linalg.cholesky(Rt)
    Hw = (rng.standard_normal((Nr, Nt))
          + 1j * rng.standard_normal((Nr, Nt))) / np.sqrt(2)
    return Lr @ Hw @ Lt.T

The Kronecker model assumes separable transmit and receive correlations. This is a good approximation for moderate antenna spacing but breaks down for closely spaced or very large arrays.

Definition:

Jakes' Model for Time-Varying Channels

For a mobile terminal moving at velocity vv, the maximum Doppler frequency is fd=vfc/cf_d = v f_c / c and the channel autocorrelation is:

Rh(Ο„)=J0(2Ο€fdΟ„)R_h(\tau) = J_0(2\pi f_d \tau)

where J0J_0 is the zeroth-order Bessel function. To generate time-correlated samples at sampling rate fsf_s:

  1. Build the autocorrelation matrix [R]ij=J0(2Ο€fd∣iβˆ’j∣/fs)[\mathbf{R}]_{ij} = J_0(2\pi f_d |i-j|/f_s)
  2. Apply Cholesky: h=Lz\mathbf{h} = \mathbf{L}\mathbf{z}

Alternatively, filter white noise through the Doppler spectrum:

Sh(f)=1Ο€fd1βˆ’(f/fd)2,∣fβˆ£β‰€fdS_h(f) = \frac{1}{\pi f_d \sqrt{1 - (f/f_d)^2}}, \quad |f| \le f_d

from scipy.special import j0
R = j0(2 * np.pi * fd * np.abs(
    np.arange(N)[:, None] - np.arange(N)[None, :]) / fs)

Definition:

3GPP Spatial Channel Model (Overview)

The 3GPP defines standardized channel models (TR 38.901) with:

  • Delay profiles: TDL-A through TDL-E (tapped delay line models)
  • Cluster-based: each cluster has a delay, angle of arrival/departure, and power
  • Large-scale parameters: path loss, shadow fading, KK-factor, delay spread, angular spread

For Python simulation, the key steps are:

  1. Select a TDL model (e.g., TDL-A for NLOS)
  2. Scale delays by desired delay spread
  3. Generate per-tap Rayleigh or Ricean coefficients
  4. Apply Doppler filtering per tap
# TDL-A model (simplified)
tdl_a_delays = np.array([0, 30, 70, 90, 110, 190, 410]) * 1e-9
tdl_a_powers_db = np.array([0, -1, -2, -3, -8, -17.2, -20.8])
tdl_a_powers = 10 ** (tdl_a_powers_db / 10)
tdl_a_powers /= tdl_a_powers.sum()  # normalize

Theorem: Envelope and Power of Complex Gaussian

If h∼CN(0,Οƒ2)h \sim \mathcal{CN}(0, \sigma^2), then:

  1. Envelope: ∣h∣∼Rayleigh(Οƒ/2)|h| \sim \mathrm{Rayleigh}(\sigma/\sqrt{2}) with f∣h∣(r)=2rΟƒ2exp⁑(βˆ’r2/Οƒ2)f_{|h|}(r) = \frac{2r}{\sigma^2}\exp(-r^2/\sigma^2)

  2. Power: ∣h∣2∼Exp(Οƒ2)|h|^2 \sim \mathrm{Exp}(\sigma^2) with f∣h∣2(p)=1Οƒ2exp⁑(βˆ’p/Οƒ2)f_{|h|^2}(p) = \frac{1}{\sigma^2}\exp(-p/\sigma^2)

  3. Phase: ∠h∼Uniform(0,2Ο€)\angle h \sim \mathrm{Uniform}(0, 2\pi), independent of ∣h∣|h|

A complex Gaussian in polar coordinates (r,ΞΈ)(r, \theta) separates into independent Rayleigh amplitude and uniform phase β€” the "circular symmetry" that gives CSCG its name.

Theorem: Kronecker Model Covariance Structure

For H=Rr1/2Hw(Rt1/2)T\mathbf{H} = \mathbf{R}_r^{1/2}\mathbf{H}_w(\mathbf{R}_t^{1/2})^T, the vectorized channel vec(H)\mathrm{vec}(\mathbf{H}) has covariance:

E[vec(H) vec(H)H]=Rtβˆ—βŠ—RrE[\mathrm{vec}(\mathbf{H})\,\mathrm{vec}(\mathbf{H})^H] = \mathbf{R}_t^* \otimes \mathbf{R}_r

The channel's spatial correlation is the Kronecker product of the transmit and receive correlation matrices.

The Kronecker structure means that antenna correlations at the transmitter and receiver are separable β€” knowing Rt\mathbf{R}_t and Rr\mathbf{R}_r fully specifies the MIMO spatial correlation.

Theorem: Clarke-Jakes Autocorrelation

For a 2D isotropic scattering environment with maximum Doppler frequency fdf_d, the channel autocorrelation function is:

Rh(Ξ”t)=J0(2Ο€fdΞ”t)R_h(\Delta t) = J_0(2\pi f_d \Delta t)

The coherence time, defined as the time lag where ∣Rh(Ξ”t)∣=0.5|R_h(\Delta t)| = 0.5, is approximately:

Tcβ‰ˆ0.423fdT_c \approx \frac{0.423}{f_d}

J0J_0 starts at 1 and oscillates with decreasing amplitude. Faster movement (larger fdf_d) means faster decorrelation β€” the channel changes more rapidly.

Example: Generating and Validating Rayleigh and Rice Channels

Generate 100000 Rayleigh and Ricean channel samples, verify their envelope distributions, and compare the theoretical and empirical outage probabilities.

Example: Generating Correlated 4x4 MIMO Channels

Generate 1000 realizations of a 4Γ—44 \times 4 MIMO channel with exponential correlation at both transmit and receive arrays.

Example: Generating a Time-Varying Rayleigh Channel (Jakes)

Generate a time-varying Rayleigh channel for a mobile at 60 km/h at 2 GHz carrier, sampled at 1 kHz, and verify the autocorrelation.

Fading Channel Generator

Generate Rayleigh, Ricean, and Nakagami fading channels and visualize the envelope distribution, power distribution, and time series.

Parameters

Fading Channel Generation

python
Rayleigh, Rice, Nakagami, Kronecker MIMO, Jakes model.
# Code from: ch09/python/fading_channels.py
# Load from backend supplements endpoint

Quick Check

What distribution does ∣h∣2|h|^2 follow when h∼CN(0,1)h \sim \mathcal{CN}(0, 1)?

Rayleigh

Exponential with mean 1

Chi-squared with 2 degrees of freedom

Gaussian

Common Mistake: Wrong Transpose in Kronecker Model

Mistake:

Writing H = Lr @ Hw @ Lt instead of H = Lr @ Hw @ Lt.T. This applies the wrong correlation structure and produces incorrect channel statistics.

Correction:

The Kronecker model is H=LrHwLtT\mathbf{H} = \mathbf{L}_r \mathbf{H}_w \mathbf{L}_t^T. For complex channels with Hermitian correlation, use Lt.conj().T.

Key Takeaway

Always validate your channel generator against known statistics before using it in a simulation. Check: (1) the envelope distribution matches theory, (2) the mean power is correct, (3) the spatial correlation matches the target R\mathbf{R}, and (4) the temporal autocorrelation matches J0(2Ο€fdΟ„)J_0(2\pi f_d \tau) for Jakes.

Why This Matters: Channel Models Drive System Design

The channel model determines the performance limits of any wireless system. Rayleigh fading sets the baseline diversity order (error probability decays as SNRβˆ’1\mathrm{SNR}^{-1}). Ricean fading with high KK approaches AWGN. Correlated MIMO channels reduce the multiplexing gain below the i.i.d. case. Understanding these models is essential before studying MIMO detection and beamforming.

Historical Note: William C. Jakes and the Mobile Radio Channel

1974

William C. Jakes of Bell Labs published "Microwave Mobile Communications" in 1974, establishing the mathematical framework for mobile radio channels. His model of isotropic scattering leading to the J0J_0 autocorrelation and the classical Doppler spectrum remains the foundation of all mobile channel simulators, including 3GPP models.

Rayleigh Fading

A fading model where the channel coefficient is CN(0,Οƒ2)\mathcal{CN}(0,\sigma^2), applicable when there is no line-of-sight path.

Related: Ricean Fading

Ricean Fading

A fading model with a deterministic LOS component plus scattered components, parameterized by the KK-factor.

Related: Rayleigh Fading

K-factor

Ratio of LOS power to scattered power in Ricean fading: K=∣hLOS∣2/E[∣hNLOS∣2]K = |h_{\mathrm{LOS}}|^2 / E[|h_{\mathrm{NLOS}}|^2].

Doppler Spread

Maximum Doppler frequency fd=vfc/cf_d = v f_c / c caused by relative motion between transmitter and receiver.

Kronecker Channel Model

A MIMO channel model where the spatial correlation separates as Rtβˆ—βŠ—Rr\mathbf{R}_t^* \otimes \mathbf{R}_r, generated via H=Rr1/2Hw(Rt1/2)T\mathbf{H} = \mathbf{R}_r^{1/2}\mathbf{H}_w(\mathbf{R}_t^{1/2})^T.