- sdr.biawgn_capacity(snr: ArrayLike) NDArray[float64]
Calculates the capacity of a binary-input additive white Gaussian noise (BI-AWGN) channel.
- Parameters:¶
- snr: ArrayLike¶
The signal-to-noise ratio
at the output of the channel in dB.Note
This SNR is for a real signal. In the case of soft-decision BPSK, the SNR after coherent detection is
, where is the energy per symbol and is the noise power spectral density.
- Returns:¶
The capacity
of the channel in bits/1D.
Notes¶
The BI-AWGN channel is defined as
where
is the input with , is the signal amplitude, is the AWGN noise, the SNR is , and is the output with .The capacity of the BI-AWGN channel is
where
is the mutual information between the input and output , is the differential entropy of the output , and is the conditional entropy of the output given the input . The maximum mutual information is achieved when is equally likely to be or .The conditional probability density function (PDF) of
given isThe marginal PDF of
isThe differential entropy of the output
isThe conditional entropy of the output
given the input isIn this case, since
, the conditional entropy simplifies toThe capacity of the BI-AWGN channel is
However, the integral must be solved using numerical methods. A convenient closed-form upper bound, provided by Yang, is
where
in linear units.References¶
Examples¶
In [1]: snr = np.linspace(-30, 20, 51) In [2]: C_ub = np.log2(2) - np.log2(1 + np.exp(-sdr.linear(snr))) In [3]: C = sdr.biawgn_capacity(snr) In [4]: plt.figure(); \ ...: plt.plot(snr, C_ub, linestyle="--", label="$C_{ub}$"); \ ...: plt.plot(snr, C, label="$C$"); \ ...: plt.legend(); \ ...: plt.xlabel("Signal-to-noise ratio (dB), $A^2/\sigma^2$"); \ ...: plt.ylabel("Capacity (bits/1D), $C$"); \ ...: plt.title("Capacity of the BI-AWGN Channel"); ...:
In [5]: snr = np.linspace(-30, 20, 51) In [6]: p = sdr.Q(np.sqrt(sdr.linear(snr))) In [7]: C_hard = sdr.bsc_capacity(p) In [8]: C_soft = sdr.biawgn_capacity(snr) In [9]: plt.figure(); \ ...: plt.plot(snr, C_hard, label="BSC (hard)"); \ ...: plt.plot(snr, C_soft, label="BI-AWGN (soft)"); \ ...: plt.legend(); \ ...: plt.xlabel("Signal-to-noise ratio (dB), $A^2/\sigma^2$"); \ ...: plt.ylabel("Capacity (bits/1D), $C$"); \ ...: plt.title("Capacity of the BSC (hard-decision) and BI-AWGN (soft-decision) Channels"); ...: