C(++)ECCO
C++ Error Control COding: a header-only library for ECC simulations and experiments, modeling complete coding systems across arbitrary finite fields and complex inter-field relationships - Christian Senger <senger@inue.uni-stuttgart.de>
Loading...
Searching...
No Matches
CECCO::BAC Class Reference

Binary Asymmetric Channel (Z-channel) — 0 is preserved; 1 flips to 0 with probability p. More...

#include <blocks.hpp>

Inheritance diagram for CECCO::BAC:
Inheritance graph

Public Member Functions

 BAC (double p)
 Construct with flip probability p.
Fp< 2 > operator() (const Fp< 2 > &in)
 Process one bit.
double get_pe () const noexcept
 Flip probability p (probability that 1 → 0).
double get_capacity () const noexcept
 Shannon capacity in bits per symbol.
Public Member Functions inherited from CECCO::details::BlockProcessor< T, ElementType, ElementType >
Vector< ElementType > operator() (const Vector< ElementType > &in)
 Apply the block element-wise to each vector entry.
Vector< ElementType > operator() (Vector< ElementType > &&in)
 Apply the block element-wise (rvalue input).
Matrix< ElementType > operator() (const Matrix< ElementType > &in)
 Apply the block element-wise to each matrix entry.
Matrix< ElementType > operator() (Matrix< ElementType > &&in)
 Apply the block element-wise (rvalue input).
ElementType operator() (const U &)
 Catch-all for inputs whose element type differs from InputType.
Vector< ElementType > operator() (const Vector< U > &)
Matrix< ElementType > operator() (const Matrix< U > &)

Additional Inherited Members

Protected Member Functions inherited from CECCO::details::BlockProcessor< T, ElementType, ElementType >
const T & derived () const noexcept
T & derived () noexcept

Detailed Description

Binary Asymmetric Channel (Z-channel) — 0 is preserved; 1 flips to 0 with probability p.

BAC bac(0.1); // 10% probability that 1 flips to 0
Vector<Fp<2>> c = {0, 1, 1, 0};
Vector<Fp<2>> r = c >> bac;
double C = bac.get_capacity();
BAC(double p)
Construct with flip probability p.
Definition blocks.hpp:412
Vector v = (v₀, v₁, …, vₙ₋₁) over a CECCO::ComponentType.
Definition vectors.hpp:115
See also
CECCO::BSC, CECCO::BEC

Definition at line 400 of file blocks.hpp.

Constructor & Destructor Documentation

◆ BAC()

CECCO::BAC::BAC ( double p)
inline

Construct with flip probability p.

Parameters
pProbability that 1 → 0, p ∈ [0, 1]
Exceptions
std::out_of_rangeif p ∉ [0, 1] or 0 < p < 1e−9
Note
p = 0 is the perfect channel (capacity 1); p = 1 makes only 0 transmissible (capacity 0).

Definition at line 412 of file blocks.hpp.

Member Function Documentation

◆ get_capacity()

double CECCO::BAC::get_capacity ( ) const
inlinenoexcept

Shannon capacity in bits per symbol.

Returns
C = log₂(1 + (1 − p)·p^{p/(1−p)}); edge cases p ∈ {0, 1} handled explicitly.

Definition at line 431 of file blocks.hpp.

◆ get_pe()

double CECCO::BAC::get_pe ( ) const
inlinenoexcept

Flip probability p (probability that 1 → 0).

Definition at line 425 of file blocks.hpp.

◆ operator()()

Fp< 2 > CECCO::BAC::operator() ( const Fp< 2 > & in)
inline

Process one bit.

Parameters
inInput bit
Returns
Output: 0 is preserved; 1 flips to 0 with probability p

Definition at line 419 of file blocks.hpp.


The documentation for this class was generated from the following file: