- sdr.bec_capacity(p: ArrayLike) NDArray[float_]
Calculates the capacity of a binary erasure channel (BEC).
- Parameters:¶
- p: ArrayLike¶
The erasure probability \(p\) of the BEC channel.
- Returns:¶
The capacity \(C\) of the channel in bits/channel use.
Notes¶
The inputs to the BEC are \(x_i \in \{0, 1\}\) and the outputs are \(y_i \in \{0, 1, e\}\). Erasures \(e\) are represented by -1. The capacity of the BEC is
\[C = 1 - p \ \ \text{bits/channel use} .\]Examples¶
When the probability \(p\) of erasure is 0, the capacity of the channel is 1 bit/channel use. However, as the probability of erasure approaches 1, the capacity of the channel approaches 0.
In [1]: p = np.linspace(0, 1, 100); \ ...: C = sdr.bec_capacity(p) ...: In [2]: plt.figure(figsize=(8, 4)); \ ...: plt.plot(p, C); \ ...: plt.xlabel("Erasure probability, $p$"); \ ...: plt.ylabel("Capacity (bits/channel use), $C$"); \ ...: plt.title("Capacity of the Binary Erasure Channel"); \ ...: plt.grid(True); \ ...: plt.tight_layout() ...: