dit.example_channels
A catalog of canonical discrete memoryless channels.
Each constructor returns a conditional Distribution p(Y | X) –
the representation consumed by dit.algorithms.channel_capacity() and the
channel-coding evaluation layer in dit.coding. Alphabets are integer-valued;
an erasure is the integer just past the input alphabet (binary erasure 2,
q-ary erasure q).
Functions
The binary asymmetric channel. |
|
The binary erasure channel with erasure probability |
|
The binary symmetric channel with crossover probability |
|
The binary symmetric error-and-erasure channel. |
|
The noiseless channel over an |
|
The noisy typewriter channel (Cover & Thomas). |
|
The q-ary erasure channel. |
|
The q-ary symmetric channel. |
|
The zero-capacity channel over an |
|
The Z-channel with crossover probability |
Reference
- binary_asymmetric_channel(p0, p1)[source]
The binary asymmetric channel.
A
0is flipped to1with probabilityp0; a1is flipped to0with probabilityp1. The binary symmetric channel is the casep0 == p1and the Z-channel is the casep0 == 0.- Parameters:
- Returns:
channel – The conditional distribution
p(Y | X)over{0, 1}.- Return type:
- binary_erasure_channel(epsilon)[source]
The binary erasure channel with erasure probability
epsilon.Each transmitted bit is independently erased with probability
epsilonand otherwise received unchanged. Its capacity is \(1 - \epsilon\).- Parameters:
epsilon (float) – The probability that a transmitted bit is erased.
- Returns:
channel – The conditional distribution
p(Y | X)with output alphabet{0, 1, 2}, where2denotes an erasure.- Return type:
- binary_symmetric_channel(p)[source]
The binary symmetric channel with crossover probability
p.Each transmitted bit is independently flipped with probability
p. Its capacity is \(1 - H_b(p)\).- Parameters:
p (float) – The probability that a transmitted bit is flipped.
- Returns:
channel – The conditional distribution
p(Y | X)over{0, 1}.- Return type:
- binary_symmetric_erasure_channel(p, epsilon)[source]
The binary symmetric error-and-erasure channel.
A transmitted bit is erased with probability
epsilonand flipped with probabilityp; the two events are disjoint, sop + epsilon <= 1.- Parameters:
- Returns:
channel – The conditional distribution
p(Y | X)with output alphabet{0, 1, 2}, where2denotes an erasure.- Return type:
- identity_channel(n=2)[source]
The noiseless channel over an
n-symbol alphabet.Every symbol is received unchanged, so the channel has capacity \(\log_2 n\).
- Parameters:
n (int) – The alphabet size (
n >= 1).- Returns:
channel – The conditional distribution
p(Y | X)over{0, ..., n - 1}.- Return type:
- noisy_typewriter(n=26)[source]
The noisy typewriter channel (Cover & Thomas).
Each of the
nletters is received either unchanged or as the next letter (cyclically), each with probability one half. Its capacity is \(\log_2(n / 2)\), achieved by using every other input letter.- Parameters:
n (int) – The alphabet size (
n >= 2).- Returns:
channel – The conditional distribution
p(Y | X)over{0, ..., n - 1}.- Return type:
- q_ary_erasure_channel(q, epsilon)[source]
The q-ary erasure channel.
A symbol is erased with probability
epsilonand otherwise received unchanged. Its capacity is \((1 - \epsilon) \log_2 q\). The binary erasure channel is the caseq == 2.- Parameters:
- Returns:
channel – The conditional distribution
p(Y | X)with output alphabet{0, ..., q - 1, q}, whereqdenotes an erasure.- Return type:
- q_ary_symmetric_channel(q, p)[source]
The q-ary symmetric channel.
A symbol is received correctly with probability
1 - pand is otherwise received as one of the otherq - 1symbols, chosen uniformly. Its capacity is \(\log_2 q - H_b(p) - p \log_2(q - 1)\). The binary symmetric channel is the caseq == 2.- Parameters:
- Returns:
channel – The conditional distribution
p(Y | X)over{0, ..., q - 1}.- Return type:
- useless_channel(n=2)[source]
The zero-capacity channel over an
n-symbol alphabet.The output is uniform and independent of the input, so the channel carries no information and has capacity
0.- Parameters:
n (int) – The alphabet size (
n >= 1).- Returns:
channel – The conditional distribution
p(Y | X)over{0, ..., n - 1}.- Return type:
- z_channel(p)[source]
The Z-channel with crossover probability
p.A
0is always received correctly; a1is flipped to0with probabilityp. This is the canonical binary asymmetric channel.- Parameters:
p (float) – The probability that a transmitted
1is received as0.- Returns:
channel – The conditional distribution
p(Y | X)over{0, 1}.- Return type: