GNU Radio's DVBS2RX Package
gr::dvbs2rx::galois_field< T > Class Template Reference

Galois Field GF(2^m). More...

#include <gf.h>

Public Member Functions

 galois_field (const gf2_poly< T > &prim_poly)
 Construct a new Galois field object.
 
operator[] (uint32_t index) const
 Get the GF(2^m) element at a given index on the elements table.
 
get_alpha_i (uint32_t i) const
 Get the i-th power of the primitive element (alpha^i).
 
uint32_t get_exponent (const T &beta) const
 Get the exponent i of a given element beta = alpha^i.
 
multiply (const T &a, const T &b) const
 Multiply two elements from GF(2^m).
 
inverse (const T &beta) const
 Get the inverse beta^-1 from a GF(2^m) element beta.
 
inverse_by_exp (uint32_t i) const
 Get the inverse from a GF(2^m) element alpha^i given by its exponent i.
 
divide (const T &a, const T &b) const
 Divide two elements from GF(2^m).
 
std::set< T > get_conjugates (const T &beta) const
 Get the conjugates of element beta.
 
gf2_poly< T > get_min_poly (const T &beta) const
 Compute the minimal polynomial associated with element beta.
 
uint8_t get_m () const
 Get the dimension m of the GF(2^m) field.
 

Detailed Description

template<typename T>
class gr::dvbs2rx::galois_field< T >

Galois Field GF(2^m).

Template Parameters
TBase type for the field elements.
Note
See the reference implementation at https://github.com/igorauad/bch/blob/master/gf.py.

Constructor & Destructor Documentation

◆ galois_field()

template<typename T >
gr::dvbs2rx::galois_field< T >::galois_field ( const gf2_poly< T > &  prim_poly)

Construct a new Galois field object.

Parameters
prim_polyPrimitive polynomial that generates the field.

Member Function Documentation

◆ divide()

template<typename T >
T gr::dvbs2rx::galois_field< T >::divide ( const T &  a,
const T &  b 
) const

Divide two elements from GF(2^m).

Parameters
aDividend.
bDivisor.
Returns
T Quotient a/b.

◆ get_alpha_i()

template<typename T >
T gr::dvbs2rx::galois_field< T >::get_alpha_i ( uint32_t  i) const
inline

Get the i-th power of the primitive element (alpha^i).

Parameters
iExponent i of the target element alpha^i for i from 0 to "2**m - 2".
Returns
T Element alpha^i.
Note
This function cannot obtain the zero (additive identity) element, given the zero element cannot be expressed as a power of the primitive element. To access the zero element, use the operator[] instead.

◆ get_conjugates()

template<typename T >
std::set< T > gr::dvbs2rx::galois_field< T >::get_conjugates ( const T &  beta) const

Get the conjugates of element beta.

Parameters
betaThe element whose conjugates are to be computed.
Returns
std::set<T> The set of distinct conjugates alpha^(i^(2^l)) in GF(2^m) associated with element beta=alpha^i.

◆ get_exponent()

template<typename T >
uint32_t gr::dvbs2rx::galois_field< T >::get_exponent ( const T &  beta) const
inline

Get the exponent i of a given element beta = alpha^i.

Parameters
betaElement beta that is a power of the primitive element alpha.
Returns
T Exponent i.
Note
This function cannot obtain the exponent of the zero (additive identity) element, given the zero element cannot be expressed as a power of the primitive element alpha. A runtime error exception is raised if beta is the zero element.

◆ get_m()

template<typename T >
uint8_t gr::dvbs2rx::galois_field< T >::get_m ( ) const
inline

Get the dimension m of the GF(2^m) field.

Returns
uint8_t Dimension m.

◆ get_min_poly()

template<typename T >
gf2_poly< T > gr::dvbs2rx::galois_field< T >::get_min_poly ( const T &  beta) const

Compute the minimal polynomial associated with element beta.

Computes the polynomial phi(x) over GF(2) of smallest degree having beta as root. See the notes in the reference Python implementation.

Parameters
betaGF(2^m) element.
Returns
gf2_poly Minimal polynomial of beta as a polynomial over GF(2).

◆ inverse()

template<typename T >
T gr::dvbs2rx::galois_field< T >::inverse ( const T &  beta) const

Get the inverse beta^-1 from a GF(2^m) element beta.

Parameters
betaElement to invert.
Returns
T Inverse beta^-1.

◆ inverse_by_exp()

template<typename T >
T gr::dvbs2rx::galois_field< T >::inverse_by_exp ( uint32_t  i) const

Get the inverse from a GF(2^m) element alpha^i given by its exponent i.

Parameters
iExponent i of the element beta = alpha^i to be inverted.
Returns
T Inverse beta^-1.

◆ multiply()

template<typename T >
T gr::dvbs2rx::galois_field< T >::multiply ( const T &  a,
const T &  b 
) const

Multiply two elements from GF(2^m).

Parameters
aFirst multiplicand.
bSecond multiplicand.
Returns
T Product a*b.

◆ operator[]()

template<typename T >
T gr::dvbs2rx::galois_field< T >::operator[] ( uint32_t  index) const
inline

Get the GF(2^m) element at a given index on the elements table.

Parameters
indexTarget index.
Returns
T GF(2^m) element.

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