itpp::Reed_Solomon Class Reference
Communications Module » Forward Error Correcting Codes

Reed-Solomon Codes. More...

`#include <itpp/comm/reedsolomon.h>`

Inheritance diagram for itpp::Reed_Solomon:

## 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. More...
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. More...
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. More...
virtual bvec | decode (const bvec &coded_bits)
| Decoder a `bvec` of coded data. This function is kept for backward compatibility. Better use. More...
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_Solomon & | operator= (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 - ary of length capable of correcting 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 - ary, error correcting RS-code. The generator polynomial will be $g(x)={i=0}^{2t-1}(x-^{b+i})$, where $$ 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.

## Member Function Documentation

## decode() [1/4]

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 (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() [2/4]

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/4]

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)

.

Implements itpp::Channel_Code.

Definition at line 284 of file reedsolomon.cpp.

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

## decode() [4/4]

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().

## 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(), 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(), 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().

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

- itpp/comm/reedsolomon.h
- itpp/comm/reedsolomon.cpp

Generated on Sat Sep 30 2017 07:04:09 for IT++ by Doxygen 1.8.13