sdr.awgn_capacity(snr: ArrayLike, bandwidth: float | None = None) NDArray[float64]

Calculates the capacity of an additive white Gaussian noise (AWGN) channel.

Parameters:
snr: ArrayLike

The signal-to-noise ratio \(S / N\) in dB of the channel.

bandwidth: float | None = None

The bandwidth \(B\) of the channel in Hz. If specified, the capacity is calculated in bits/s. If None, the capacity is calculated in bits/2D.

Returns:

The capacity \(C\) of the channel in bits/2D, or bits/s if bandwidth was specified.

Notes

The inputs to the AWGN channel are \(x_i \in \mathbb{C}\) and the outputs are \(y_i \in \mathbb{C}\). The capacity of the AWGN channel is

\[C = \log_2\left(1 + \frac{S}{N}\right) \ \ \text{bits/2D} ,\]

where \(S = \frac{1}{N} \sum_{i=0}^{N-1} \left| x_i \right|^2\) is the average signal power and \(N = \sigma^2\) is the complex noise power. The units are bits/2D, which is equivalent to bits per complex channel use.

If the channel bandwidth \(B\) is specified, the channel capacity is

\[C = B\log_2\left(1 + \frac{S}{N}\right) \ \ \text{bits/s} .\]

Examples

Plot the AWGN channel capacity as a function of \(S/N\). When the capacity is less than 2 bits/2D, capacity is in the power-limited regime. In the power-limited regime, the capacity increases linearly with signal power as in independent of bandwidth.

When the capacity is greater than 2 bits/2D, capacity is in the bandwidth-limited regime. In the bandwidth-limited regime, the capacity increases linearly with bandwidth and logarithmically with signal power.

In [1]: snr = np.linspace(-30, 60, 101); \
   ...: C = sdr.awgn_capacity(snr)
   ...: 

In [2]: plt.figure(); \
   ...: plt.semilogy(snr, C); \
   ...: plt.axvline(sdr.shannon_limit_snr(2), color='k', linestyle='--'); \
   ...: plt.annotate("Power-limited regime", (sdr.shannon_limit_snr(1e-2), 1e-2), xytext=(0, -20), textcoords="offset pixels", rotation=44); \
   ...: plt.annotate("Bandwidth-limited regime", (sdr.shannon_limit_snr(8), 8), xytext=(0, -20), textcoords="offset pixels", rotation=7); \
   ...: plt.xlabel("Signal-to-noise ratio (dB), $S/N$"); \
   ...: plt.ylabel("Capacity (bits/2D), $C$"); \
   ...: plt.title("Capacity of the AWGN Channel");
   ...: 
../../_images/sdr_awgn_capacity_1.png