komm.BinaryErasureChannel
Binary erasure channel (BEC). It is a discrete memoryless channel with input alphabet $\mathcal{X} = \{ 0, 1 \}$, output alphabet $\mathcal{Y} = \{ 0, 1, 2 \}$, and transition probability matrix given by $$ p_{Y \mid X} = \begin{bmatrix} 1 - \epsilon & 0 & \epsilon \\ 0 & 1 - \epsilon & \epsilon \end{bmatrix}, $$ where the parameter $\epsilon$ is called the erasure probability of the channel. For more details, see CT06, Sec. 7.1.5.
To invoke the channel, call the object giving the input signal as parameter (see example in the constructor below).
__init__()
Constructor for the class.
Parameters:
-
erasure_probability
(Optional[float]
) –The channel erasure probability $\epsilon$. Must satisfy $0 \leq \epsilon \leq 1$. Default value is
0.0
, which corresponds to a noiseless channel.
Examples:
>>> np.random.seed(1)
>>> bec = komm.BinaryErasureChannel(0.1)
>>> x = [1, 1, 1, 0, 0, 0, 1, 0, 1, 0]
>>> y = bec(x); y
array([1, 1, 2, 0, 0, 2, 1, 0, 1, 0])
erasure_probability
property
writable
The erasure probability $\epsilon$ of the channel.
capacity()
Returns the channel capacity $C$. It is given by $C = 1 - \epsilon$. See CT06, Sec. 7.1.5.
Examples:
>>> bec = komm.BinaryErasureChannel(0.25)
>>> bec.capacity()
0.75