Simulation Methodology

Why Simulation Methodology Matters

In wireless communications research, simulation results are the primary evidence supporting a paper's claims. Unlike fields where real-world experiments are the gold standard, wireless research relies heavily on Monte Carlo simulation because controlled over-the-air experiments are expensive and difficult to reproduce.

This places an enormous burden on simulation correctness. A subtle bug in noise normalization or an insufficient number of channel realizations can invalidate an entire paper's conclusions. This section covers the methodology that separates trustworthy simulations from unreliable ones.

Definition:

Monte Carlo BER Estimation

The bit error rate (BER) is estimated by transmitting NbitsN_{\text{bits}} bits over NMCN_{\text{MC}} independent channel realizations and counting the total number of bit errors NeN_e:

P^e=NeNbitsβ‹…NMC\hat{P}_e = \frac{N_e}{N_{\text{bits}} \cdot N_{\text{MC}}}

By the law of large numbers, P^eβ†’Pe\hat{P}_e \to P_e as Nbitsβ‹…NMCβ†’βˆžN_{\text{bits}} \cdot N_{\text{MC}} \to \infty.

The key question is: how many trials are enough?

Some papers report block error rate (BLER) instead of BER. The required number of trials differs because BLER counts block events rather than individual bit events.

Rule of Thumb: Minimum Trial Count

To estimate a BER of PeP_e with a relative error of 10% at 95% confidence, you need approximately:

Ntotalβ‰₯100PeN_{\text{total}} \geq \frac{100}{P_e}

total transmitted bits (across all channel realizations). For example:

Target BER Minimum bits Typical NMCN_{\text{MC}} (QPSK, 1024 bits/frame)
10βˆ’210^{-2} 10410^4 10
10βˆ’310^{-3} 10510^5 100
10βˆ’410^{-4} 10610^6 1,000
10βˆ’510^{-5} 10710^7 10,000
10βˆ’610^{-6} 10810^8 100,000

Simulating BER below 10βˆ’510^{-5} by brute-force Monte Carlo is computationally expensive. For very low error rates, importance sampling or analytical bounds are preferred.

Monte Carlo BER Simulation Template

Complexity: O(NMC,maxβ‹…Lβ‹…Cdetect)O(N_{\text{MC,max}} \cdot L \cdot C_{\text{detect}}) per SNR point
Input: SNR range {SNR1,…,SNRM}\{\text{SNR}_{1}, \ldots, \text{SNR}_{M}\},
modulation order MmodM_{\text{mod}}, frame length LL,
channel model, minimum errors Ne,min⁑=100N_{e,\min} = 100,
maximum trials NMC,maxN_{\text{MC,max}}
Output: BER estimates {P^e(SNRm)}\{\hat{P}_e(\text{SNR}_{m})\} with 95% CIs
1. for each SNRm\text{SNR}_{m} do
2. Ne←0\quad N_e \leftarrow 0, Nbits←0N_{\text{bits}} \leftarrow 0, n←0n \leftarrow 0
3. \quad while Ne<Ne,min⁑N_e < N_{e,\min} and n<NMC,maxn < N_{\text{MC,max}} do
4. \quad\quad Generate information bits b∈{0,1}L\mathbf{b} \in \{0,1\}^L
5. \quad\quad Modulate: s=mod(b)\mathbf{s} = \text{mod}(\mathbf{b})
6. \quad\quad Generate channel H∼\mathbf{H} \sim channel model
7. \quad\quad Compute noise variance: Οƒ2=βˆ₯Hsβˆ₯2/(Lβ‹…SNRm)\sigma^2 = \|\mathbf{H}\mathbf{s}\|^2 / (L \cdot \text{SNR}_{m})
8. \quad\quad Generate noise: n∼CN(0,Οƒ2I)\mathbf{n} \sim \mathcal{CN}(\mathbf{0}, \sigma^2 \mathbf{I})
9. \quad\quad Received signal: y=Hs+n\mathbf{y} = \mathbf{H}\mathbf{s} + \mathbf{n}
10. \quad\quad Detect/decode: b^=detect(y,H)\hat{\mathbf{b}} = \text{detect}(\mathbf{y}, \mathbf{H})
11. \quad\quad Ne←Ne+hamming(b,b^)N_e \leftarrow N_e + \text{hamming}(\mathbf{b}, \hat{\mathbf{b}})
12. \quad\quad Nbits←Nbits+LN_{\text{bits}} \leftarrow N_{\text{bits}} + L
13. \quad\quad n←n+1n \leftarrow n + 1
14. \quad end while
15. \quad P^e←Ne/Nbits\hat{P}_e \leftarrow N_e / N_{\text{bits}}
16. \quad CI: P^eΒ±1.96P^e(1βˆ’P^e)/Nbits\hat{P}_e \pm 1.96\sqrt{\hat{P}_e(1 - \hat{P}_e)/N_{\text{bits}}}
17. end for

Line 3 uses a minimum error count stopping criterion. This ensures adequate statistical precision at each SNR point. The loop exits early at high SNR (many errors) and runs longer at low SNR (few errors). Line 7 shows noise normalization relative to the signal β€” see the pitfall below for why this matters.

,

Confidence Intervals for BER Estimates

The estimated BER P^e\hat{P}_e is a random variable. Reporting it without a confidence interval is like reporting a channel estimate without its MSE β€” it hides how trustworthy the number is.

Since each bit decision is approximately a Bernoulli trial with success probability PeP_e, the 95% confidence interval (via the normal approximation to the binomial) is:

P^eΒ±1.96P^e(1βˆ’P^e)Ntotal\hat{P}_e \pm 1.96 \sqrt{\frac{\hat{P}_e (1 - \hat{P}_e)}{N_{\text{total}}}}

where NtotalN_{\text{total}} is the total number of bit decisions.

Example: If P^e=10βˆ’3\hat{P}_e = 10^{-3} from Ntotal=106N_{\text{total}} = 10^6 bits, the 95% CI is 10βˆ’3Β±6.2Γ—10βˆ’510^{-3} \pm 6.2 \times 10^{-5}, i.e., a relative half-width of about 6%. With only 10410^4 bits, the CI balloons to Β±6.2Γ—10βˆ’4\pm 6.2 \times 10^{-4} (62% relative), making the estimate essentially useless.

Monte Carlo BER Convergence Animation

Watch BER estimates accumulate as the number of Monte Carlo trials grows from 10 to 100,000. The estimates scatter wildly at first and gradually converge toward the true BER, with the confidence interval band shrinking as 1/N1/\sqrt{N}.
BPSK at Eb/N0=7E_b/N_0 = 7 dB: BER estimates (blue dots) converge to the true value (green dashed) as trials increase on a log scale.

Monte Carlo BER Convergence

Watch how the BER estimate converges as the number of Monte Carlo trials increases. The shaded region shows the 95% confidence interval shrinking with more trials. Observe that convergence is slow (1/N1/\sqrt{N}) β€” doubling precision requires quadrupling the number of trials.

Parameters
10
5
1

BER Estimation Spread Across Experiments

Run the same BER simulation multiple times and observe how the estimates scatter. Each dot is one independent experiment. At low target BER (e.g., 10βˆ’510^{-5}), the spread is enormous unless the number of trials is very large. This demonstrates why reporting confidence intervals is essential.

Parameters
-3
20

Pitfall: Wrong Noise Normalization

The single most common simulation bug in wireless research is incorrect SNR normalization. The issue arises because "SNR" can mean different things:

Definition Formula When to use
Per-antenna SNR Ptx/Οƒ2P_{\text{tx}} / \sigma^2 SISO, per-antenna analysis
Total receive SNR Ptxβˆ₯hβˆ₯2/Οƒ2P_{\text{tx}} \|\mathbf{h}\|^2 / \sigma^2 After beamforming
Eb/N0E_b/N_0 Es/(N0β‹…log⁑2M)E_s / (N_0 \cdot \log_2 M) BER comparisons
Es/N0E_s/N_0 PtxTs/N0P_{\text{tx}} T_s / N_0 Symbol-level analysis

A typical mistake: defining SNR as P/Οƒ2P/\sigma^2 but normalizing the channel as E[βˆ₯hβˆ₯2]=Nr\mathbb{E}[\|\mathbf{h}\|^2] = N_r (receive antennas). This implicitly gives an NrN_r-fold array gain that inflates performance. The fix: either normalize E[βˆ₯hβˆ₯2]=1\mathbb{E}[\|\mathbf{h}\|^2] = 1 or account for the array gain in the SNR definition.

SNR Normalization Pitfall β€” 3 dB Shift

See how incorrect noise normalization (using variance 2Οƒ22\sigma^2 instead of Οƒ2\sigma^2 for complex noise) shifts the entire BER curve by 3 dB. The correct and incorrect curves are plotted side-by-side for BPSK over AWGN.
BPSK/AWGN BER curves: correct normalization (blue) vs. incorrect with 2Γ—2\times noise variance (red). The 3 dB gap is constant across all Eb/N0E_b/N_0 values.

Correct vs. Incorrect SNR Normalization

Compare BER curves when noise variance is correctly vs. incorrectly normalized in a MIMO system. The incorrect normalization forgets to account for the channel norm, resulting in artificially better performance. Increase NrxN_{\text{rx}} to see how the gap grows with more antennas.

Parameters
2
1

Channel Generation Best Practices

The channel model is the foundation of any wireless simulation. Getting it right requires attention to several details:

Rayleigh fading: Hij∼CN(0,1)\mathbf{H}_{ij} \sim \mathcal{CN}(0, 1) (i.i.d.). Remember that CN(0,1)\mathcal{CN}(0,1) means the real and imaginary parts are each N(0,1/2)\mathcal{N}(0, 1/2), so E[∣Hij∣2]=1\mathbb{E}[|H_{ij}|^2] = 1.

Correlated fading: vec(H)∼CN(0,RrβŠ—Rt)\text{vec}(\mathbf{H}) \sim \mathcal{CN}(\mathbf{0}, \mathbf{R}_{r} \otimes \mathbf{R}_{t}) using the Kronecker model. Generate as H=Rr1/2HwRt1/2\mathbf{H} = \mathbf{R}_{r}^{1/2} \mathbf{H}_{w} \mathbf{R}_{t}^{1/2} where Hw\mathbf{H}_{w} is i.i.d.

Rician fading: H=KR/(KR+1) HΛ‰+1/(KR+1) Hw\mathbf{H} = \sqrt{K_R/(K_R+1)} \, \bar{\mathbf{H}} + \sqrt{1/(K_R+1)} \, \mathbf{H}_{w} where HΛ‰\bar{\mathbf{H}} is the deterministic LoS component and KRK_R is the Rician KK-factor.

Path loss: Always specify whether path loss is included in H\mathbf{H} or handled separately. Mixing conventions across baselines invalidates comparisons.

Pitfall: Insufficient Channel Realizations

A common mistake is using too few independent channel realizations, especially for ergodic rate simulations. Unlike BER (where you can count bit errors), ergodic rate is an expectation:

RΛ‰=EH ⁣[log⁑2det⁑ ⁣(I+PNtΟƒ2HHH)]\bar{R} = \mathbb{E}_{\mathbf{H}}\!\left[\log_2\det\!\left(\mathbf{I} + \frac{P}{N_t \sigma^2} \mathbf{H}\mathbf{H}^{H}\right)\right]

The sample mean converges as O(1/NMC)O(1/\sqrt{N_{\text{MC}}}). For MIMO systems with many antennas, the variance of the rate across realizations can be small (channel hardening), so fewer realizations suffice. But for small MIMO or high-variance channels, 1000+ realizations may be needed.

Check: Run your simulation with NN and 2N2N realizations. If the result changes by more than 1%, you need more samples.

Simulation Parameters Every Paper Should Specify

The following table lists parameters that must appear in every wireless simulation setup. Missing any of these makes the results non-reproducible.

Parameter Example value Why it matters
Number of antennas Nt=64,Nr=1N_t = 64, N_r = 1 Determines array gain, DoF
Number of users K=8K = 8 Affects MUI, scheduling gain
Channel model i.i.d. Rayleigh Determines fading statistics
Channel estimation Perfect / LS / MMSE Major performance impact
SNR definition Eb/N0E_b/N_0 or P/Οƒ2P/\sigma^2 Shifts curves by dB
SNR range βˆ’5-5 to 3030 dB Must cover relevant regime
Modulation / coding QPSK, rate-1/2 LDPC Determines operating point
Frame / block length L=1024L = 1024 symbols Affects coding gain, complexity
Monte Carlo trials NMC=104N_{\text{MC}} = 10^4 Determines statistical reliability
Bandwidth B=20B = 20 MHz Needed for absolute throughput
Carrier frequency f0=3.5f_0 = 3.5 GHz Affects path loss model
Cell radius / deployment 500 m, hexagonal For system-level simulations
Random seed 42 For exact reproducibility

If a paper you are reading omits three or more of these, treat the results with caution.

Quick Check

You want to estimate a BER of approximately 10βˆ’410^{-4} with a relative error of 10% at 95% confidence. Approximately how many total bit decisions do you need?

10310^3

10410^4

10610^6

10810^8

Theorem: Confidence Interval Width for BER Estimation

For a Monte Carlo BER estimate P^e\hat{P}_e from NN independent Bernoulli trials (bit decisions), the 95% confidence interval is:

P^eΒ±z0.025 P^e(1βˆ’P^e)N\hat{P}_e \pm z_{0.025}\,\sqrt{\frac{\hat{P}_e(1 - \hat{P}_e)}{N}}

where z0.025=1.96z_{0.025} = 1.96. The relative half-width of the CI is:

Ξ΄rel=z0.025NP^eβ‰ˆ1.96Ne\delta_{\text{rel}} = \frac{z_{0.025}}{\sqrt{N \hat{P}_e}} \approx \frac{1.96}{\sqrt{N_e}}

where Ne=NP^eN_e = N \hat{P}_e is the number of observed errors. For 10% relative accuracy (Ξ΄rel=0.1\delta_{\text{rel}} = 0.1), we need Neβ‰₯(1.96/0.1)2β‰ˆ384N_e \geq (1.96/0.1)^2 \approx 384 errors β€” the "rule of 100" is a simplified lower bound.

The CI width scales as 1/Ne1/\sqrt{N_e} β€” the number of errors, not the number of bits. This is why simulating low BER is expensive: at Pe=10βˆ’6P_e = 10^{-6}, you need ∼4Γ—108\sim 4 \times 10^8 bits to observe 400 errors.

Theorem: Monte Carlo Convergence Rate

The standard error of any Monte Carlo estimator decreases as:

SE=ΟƒNMC\text{SE} = \frac{\sigma}{\sqrt{N_{\text{MC}}}}

where Οƒ\sigma is the standard deviation of the quantity being estimated and NMCN_{\text{MC}} is the number of independent realizations. To halve the standard error, you must quadruple the number of trials.

For ergodic rate estimation: RΛ‰=E[log⁑2det⁑(I+SNRβ‹…HHH)]\bar{R} = \mathbb{E}[\log_2\det(\mathbf{I} + \text{SNR}\cdot\mathbf{H}\mathbf{H}^{H})], the variance Οƒ2\sigma^2 depends on the channel distribution and decreases with the number of antennas (channel hardening).

The 1/N1/\sqrt{N} convergence is a fundamental property of Monte Carlo methods. It is independent of the dimensionality of the problem β€” unlike deterministic quadrature, which suffers from the curse of dimensionality. This is why Monte Carlo is the dominant numerical method in wireless research.

Theorem: Importance Sampling for Rare Events

When the target BER is very low (Pe<10βˆ’6P_e < 10^{-6}), brute-force Monte Carlo is impractical. Importance sampling changes the simulation distribution to produce more errors:

P^e=1Nβˆ‘i=1N1(errori)β‹…f(ni)g(ni)\hat{P}_e = \frac{1}{N} \sum_{i=1}^{N} \mathbf{1}(\text{error}_i) \cdot \frac{f(\mathbf{n}_i)}{g(\mathbf{n}_i)}

where ff is the original noise distribution and gg is a biased distribution (e.g., noise mean shifted toward the decision boundary). The ratio f/gf/g is the likelihood ratio that corrects for the bias.

With an optimal biasing distribution, the variance reduction factor is Pe/Οƒ^IS2≫1P_e / \hat{\sigma}^2_{\text{IS}} \gg 1, enabling estimation of BER =10βˆ’10= 10^{-10} with only 10410^4--10510^5 trials.

Instead of waiting for rare error events to happen naturally (which requires ∼1/Pe\sim 1/P_e trials), importance sampling forces errors to occur more frequently and then corrects for the bias. The challenge is choosing a good biasing distribution β€” a poor choice can increase variance.

πŸ”§Engineering Note

Simulation Runtime Estimates for Wireless Research

Typical runtimes for common wireless simulations on a modern workstation (8-core CPU, 32 GB RAM) with vectorized NumPy/MATLAB:

Simulation type Parameters Approx. time
SISO BER (BPSK/AWGN) 10710^7 bits, 20 SNR points 2 seconds
4Γ—4 MIMO BER (ZF, Rayleigh) 10510^5 realizations, 15 SNR pts 30 seconds
64Γ—8 MU-MIMO sum rate 10410^4 realizations, 20 SNR pts 5 minutes
OFDM with LDPC (1024 sc) 10410^4 frames, 15 SNR points 30 minutes
System-level (19 cells, 10 UE) 10310^3 drops, 50 TTIs each 2--4 hours

If your simulation takes more than a few hours for a single parameter sweep, profile the code: the bottleneck is almost always a Python loop that should be vectorized, or an unnecessarily large FFT size, or repeated matrix inversions that should be cached.

GPU acceleration (via sionna/JAX): 10--100Γ—\times speedup for batched MIMO operations, making system-level simulations feasible in minutes rather than hours.

Practical Constraints
  • β€’

    BER below 10^{-6} requires importance sampling or semi-analytical methods

  • β€’

    System-level simulations with geometry-based channels (3GPP TR 38.901) are 10-100x slower than i.i.d. Rayleigh

  • β€’

    GPU memory limits batch sizes: typical 8 GB GPU handles ~1000 64Γ—8 MIMO channels simultaneously

πŸ”§Engineering Note

Floating-Point Precision Limits in BER Simulation

IEEE 754 double-precision floating point has a machine epsilon of Ο΅machβ‰ˆ2.2Γ—10βˆ’16\epsilon_{\text{mach}} \approx 2.2 \times 10^{-16}. This limits the precision of BER estimates computed as P^e=Ne/N\hat{P}_e = N_e / N:

  • For N=1015N = 10^{15} and Ne=1N_e = 1: P^e=10βˆ’15\hat{P}_e = 10^{-15}, which is representable but meaningless (1 error is not statistically significant).
  • The Q-function computation Q(x)Q(x) for large xx suffers from cancellation: 1 - erfc(x/sqrt(2))/2 loses precision. Use erfc(x/sqrt(2))/2 directly or scipy.special.erfc.
  • When accumulating error counts across many trials, integer overflow is not a concern with 64-bit integers (max ∼9.2Γ—1018\sim 9.2 \times 10^{18}), but integer counters should be used instead of floating-point accumulators to avoid round-off drift.
Practical Constraints
  • β€’

    Use integer counters for error accumulation, not float

  • β€’

    Use log-domain computation for very small probabilities

  • β€’

    Validate analytical BER against simulation for known cases (BPSK/AWGN) before simulating novel systems

Common Mistake: Off-by-One in Noise Variance per Dimension

Mistake:

Generating noise as n = sigma * randn(N) when Οƒ2=N0\sigma^2 = N_0, forgetting that CN(0,Οƒ2)\mathcal{CN}(0, \sigma^2) means each real and imaginary component has variance Οƒ2/2\sigma^2/2.

Correction:

For complex baseband noise with total variance Οƒ2\sigma^2:

n = sqrt(sigma2/2) * (randn(N) + 1j*randn(N))

This ensures E[∣ni∣2]=Οƒ2\mathbb{E}[|n_i|^2] = \sigma^2. Using sigma * (randn + 1j*randn) gives E[∣ni∣2]=2Οƒ2\mathbb{E}[|n_i|^2] = 2\sigma^2, inflating the noise power by a factor of 2 (3 dB error).

Common Mistake: Evaluating at a Single Channel Realization

Mistake:

Running a BER simulation with a single fading channel realization and reporting the result as the average BER performance.

Correction:

Fading channels are random β€” the BER for any single realization can differ enormously from the average. Always average over many independent channel realizations (NMCβ‰₯1000N_{\text{MC}} \geq 1000 for Rayleigh fading). If reporting outage metrics, the distribution across realizations matters, not just the mean. A single realization is meaningful only if the channel is AWGN or deterministic.

Key Takeaway

The rule of 100: you need β‰₯100/Pe\geq 100/P_e total bits. To estimate BER =10βˆ’4= 10^{-4} with 10% relative accuracy, you need at least 10610^6 total bit decisions (yielding ∼100\sim 100 errors). The CI width scales as 1/Ne1/\sqrt{N_e} β€” the number of errors, not bits. Always report the confidence interval alongside the BER estimate.

Example: Computing a Confidence Interval for BER

A Monte Carlo simulation transmits N=5Γ—105N = 5 \times 10^5 BPSK symbols over a Rayleigh fading channel at Eb/N0=12E_b/N_0 = 12 dB and observes Ne=47N_e = 47 bit errors.

(a) Compute the BER estimate P^e\hat{P}_e. (b) Compute the 95% confidence interval. (c) Is the estimate reliable enough for a journal paper?

Monte Carlo Simulation

A computational method that uses repeated random sampling to estimate statistical quantities. In wireless research, used primarily for BER/BLER estimation and ergodic rate computation. Converges at rate O(1/N)O(1/\sqrt{N}) regardless of problem dimension.

Related: BER (Bit Error Rate), Confidence Interval

Confidence Interval

A range [P^eβˆ’Ξ΄,P^e+Ξ΄][\hat{P}_e - \delta, \hat{P}_e + \delta] that contains the true parameter with specified probability (typically 95%). For BER: Ξ΄=1.96P^e(1βˆ’P^e)/N\delta = 1.96\sqrt{\hat{P}_e(1-\hat{P}_e)/N}. Essential for assessing the reliability of simulation results.

Related: Monte Carlo Simulation, BER (Bit Error Rate)