IT++ Logo
itpp::Reed_Solomon Class Reference

Reed-Solomon Codes. More...

#include <itpp/comm/reedsolomon.h>

Inheritance diagram for itpp::Reed_Solomon:
itpp::Channel_Code

Public Member Functions

 Reed_Solomon (int in_m, int in_t, bool sys=false, int in_b=1)
 
virtual ~Reed_Solomon ()
 Destructor.
 
virtual void encode (const bvec &uncoded_bits, bvec &coded_bits)
 Encoder function.
 
virtual bvec encode (const bvec &uncoded_bits)
 Encoder function.
 
virtual bool decode (const bvec &coded_bits, const ivec &erasure_positions, bvec &decoded_message, bvec &cw_isvalid)
 Decode the RS code bits. Return false if there has been any decoding failure.
 
virtual bool decode (const bvec &coded_bits, bvec &decoded_message, bvec &cw_isvalid)
 Decode the RS code bits. Return false if there has been any decoding failure.
 
virtual void decode (const bvec &coded_bits, bvec &decoded_bits)
 Decoder a bvec of coded data. This function is kept for backward compatibility. Better use.
 
virtual bvec decode (const bvec &coded_bits)
 Decoder a bvec of coded data. This function is kept for backward compatibility. Better use.
 
virtual void decode (const vec &received_signal, bvec &output)
 Decode a vec of received data.
 
virtual bvec decode (const vec &received_signal)
 Decode a vec of received data.
 
virtual double get_rate () const
 Gets the rate of the RS-code.
 
Reed_Solomonoperator= (const Reed_Solomon &)
 Dummy assignment operator - MSVC++ warning C4512.
 

Protected Attributes

GFX g
 The generator polynomial of the RS code.
 
const bool systematic
 Whether or not the code is systematic.
 
int m
 
int t
 
int k
 
int n
 
int q
 
int b
 

Detailed Description

Reed-Solomon Codes.

Uses the Berlkamp-Massey algorithm for decoding as described in: S. B. Wicker, "Error Control Systems for digital communication and storage," Prentice Hall.

The code is $2^m$ - ary of length $2^m-1$ capable of correcting $t$ errors.

Definition at line 51 of file reedsolomon.h.

Constructor & Destructor Documentation

◆ Reed_Solomon()

itpp::Reed_Solomon::Reed_Solomon ( int in_m,
int in_t,
bool sys = false,
int in_b = 1 )

Class constructor for the $2^m$ - ary, $t$ error correcting RS-code. The generator polynomial will be $g(x)=\prod_{i=0}^{2t-1}(x-\alpha^{b+i})$, where $\alpha$ is a root of the primitive polynomial of itpp::GF.

Definition at line 55 of file reedsolomon.cpp.

References b, g, it_assert, k, m, n, itpp::pow2i(), q, itpp::GFX::set(), and t.

◆ ~Reed_Solomon()

virtual itpp::Reed_Solomon::~Reed_Solomon ( )
inlinevirtual

Destructor.

Definition at line 60 of file reedsolomon.h.

Member Function Documentation

◆ encode() [1/2]

void itpp::Reed_Solomon::encode ( const bvec & uncoded_bits,
bvec & coded_bits )
virtual

Encoder function.

Implements itpp::Channel_Code.

Definition at line 71 of file reedsolomon.cpp.

References itpp::floor_i(), g, k, m, itpp::modgfx(), n, q, itpp::GF::set(), and systematic.

Referenced by encode().

◆ encode() [2/2]

bvec itpp::Reed_Solomon::encode ( const bvec & uncoded_bits)
virtual

Encoder function.

Implements itpp::Channel_Code.

Definition at line 114 of file reedsolomon.cpp.

References encode().

◆ decode() [1/6]

bool itpp::Reed_Solomon::decode ( const bvec & coded_bits,
const ivec & erasure_positions,
bvec & decoded_message,
bvec & cw_isvalid )
virtual

Decode the RS code bits. Return false if there has been any decoding failure.

The coded_bits are block-wise decoded into decoded_message messages. If there has been any decoding failure, the function will return false. If this happened in the n-th block, then cw_isvalid(n) will be set to false (zero-indexed). In case of a systematic code the systematic bits will be extracted and presented in the corresponding block of decoded_message. This is better than just presenting zeros, which is done in case of a decoding failure of non-systematic codes.

For erasure decoding the indices of erased positions need to be passed in erasure_positions as indices to the erased \fsymbol\f (not bit!).

Definition at line 121 of file reedsolomon.cpp.

References b, itpp::concat(), itpp::divgfx(), itpp::floor_i(), itpp::formal_derivate(), g, it_assert, k, m, itpp::max(), n, itpp::ones_i(), q, itpp::GFX::set_degree(), systematic, t, and itpp::zeros_b().

Referenced by decode(), decode(), and decode().

◆ decode() [2/6]

bool itpp::Reed_Solomon::decode ( const bvec & coded_bits,
bvec & decoded_message,
bvec & cw_isvalid )
virtual

Decode the RS code bits. Return false if there has been any decoding failure.

The coded_bits are block-wise decoded into decoded_message messages. If there has been any decoding failure, the function will return false. If this happened in the n-th block, then cw_isvalid(n) will be set to false (zero-indexed). In case of a systematic code the systematic bits will be extracted and presented in the corresponding block of decoded_message. This is better than just presenting zeros, which is done in case of a decoding failure of non-systematic codes.

Definition at line 278 of file reedsolomon.cpp.

References decode().

◆ decode() [3/6]

void itpp::Reed_Solomon::decode ( const bvec & coded_bits,
bvec & decoded_bits )
virtual

Decoder a bvec of coded data. This function is kept for backward compatibility. Better use.

bool decode(const bvec &coded_bits, bvec &decoded_message, bvec &cw_isvalid)
virtual bool decode(const bvec &coded_bits, const ivec &erasure_positions, bvec &decoded_message, bvec &cw_isvalid)
Decode the RS code bits. Return false if there has been any decoding failure.

.

Implements itpp::Channel_Code.

Definition at line 284 of file reedsolomon.cpp.

References decode(), k, m, and itpp::zeros_b().

◆ decode() [4/6]

bvec itpp::Reed_Solomon::decode ( const bvec & coded_bits)
virtual

Decoder a bvec of coded data. This function is kept for backward compatibility. Better use.

bool decode(const bvec &coded_bits, bvec &decoded_message, bvec &cw_isvalid)

.

Implements itpp::Channel_Code.

Definition at line 297 of file reedsolomon.cpp.

References decode().

◆ decode() [5/6]

void itpp::Reed_Solomon::decode ( const vec & received_signal,
bvec & decoded_bits )
virtual

Decode a vec of received data.

Implements itpp::Channel_Code.

Definition at line 306 of file reedsolomon.cpp.

References it_error.

◆ decode() [6/6]

bvec itpp::Reed_Solomon::decode ( const vec & received_signal)
virtual

Decode a vec of received data.

Implements itpp::Channel_Code.

Definition at line 311 of file reedsolomon.cpp.

References it_error.

◆ get_rate()

virtual double itpp::Reed_Solomon::get_rate ( void ) const
inlinevirtual

Gets the rate of the RS-code.

Implements itpp::Channel_Code.

Definition at line 107 of file reedsolomon.h.

◆ operator=()

Reed_Solomon & itpp::Reed_Solomon::operator= ( const Reed_Solomon & )
inline

Dummy assignment operator - MSVC++ warning C4512.

Definition at line 110 of file reedsolomon.h.

Member Data Documentation

◆ m

int itpp::Reed_Solomon::m
protected

Internal encoder/decoder parameters

Definition at line 115 of file reedsolomon.h.

Referenced by decode(), decode(), encode(), and Reed_Solomon().

◆ t

int itpp::Reed_Solomon::t
protected

Internal encoder/decoder parameters

Definition at line 115 of file reedsolomon.h.

Referenced by decode(), and Reed_Solomon().

◆ k

int itpp::Reed_Solomon::k
protected

Internal encoder/decoder parameters

Definition at line 115 of file reedsolomon.h.

Referenced by decode(), decode(), encode(), and Reed_Solomon().

◆ n

int itpp::Reed_Solomon::n
protected

Internal encoder/decoder parameters

Definition at line 115 of file reedsolomon.h.

Referenced by decode(), encode(), and Reed_Solomon().

◆ q

int itpp::Reed_Solomon::q
protected

Internal encoder/decoder parameters

Definition at line 115 of file reedsolomon.h.

Referenced by decode(), encode(), and Reed_Solomon().

◆ b

int itpp::Reed_Solomon::b
protected

Internal encoder/decoder parameters

Definition at line 115 of file reedsolomon.h.

Referenced by decode(), and Reed_Solomon().

◆ g

GFX itpp::Reed_Solomon::g
protected

The generator polynomial of the RS code.

Definition at line 118 of file reedsolomon.h.

Referenced by decode(), encode(), and Reed_Solomon().

◆ systematic

const bool itpp::Reed_Solomon::systematic
protected

Whether or not the code is systematic.

Definition at line 120 of file reedsolomon.h.

Referenced by decode(), and encode().


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

Generated on Tue Aug 17 2021 10:59:15 for IT++ by Doxygen 1.12.0