Cyclic Redundancy Check Codes. More...
#include <itpp/comm/crc.h>
Public Member Functions | |
CRC_Code () | |
Default Constructor. | |
CRC_Code (const std::string &code) | |
Set CRC code to one of the standardpolynomials using the string value. | |
void | set_generator (const bvec &poly) |
Set an arbitary polynomial in bvec form. Start with highest order terms. | |
void | set_code (const std::string &code) |
Set CRC code to one of the standardpolynomials using the string value. | |
void | parity (const bvec &in_bits, bvec &out) const |
Calulate the parity bits. | |
bool | check_parity (const bvec &coded_bits) const |
Return true if parity checks OK otherwise flase. | |
void | encode (const bvec &in_bits, bvec &out) const |
Calculate and add parity to the in_bits. | |
bvec | encode (const bvec &in_bits) const |
Returns the in_bits vector with parity added. | |
bool | decode (const bvec &coded_bits, bvec &out) const |
Return true if parity checks OK otherwise flase. Also returns the message part in out. | |
bool | decode (bvec &bits) const |
Return true if parity checks OK otherwise flase. Also returns the message part in bits. | |
Cyclic Redundancy Check Codes.
This class will add the CRC bits after each input word. With b(i) denoting the i-th input bit and p(i) the i-th parity check bit, the order of the outbut bits will be:
When the WCDMA CRC polynomials are used, this class will reverse the order of the parity check bits in order to comply to the WCDMA standard. Thus for the polynomials WCDMA-8, WCDMA-12, WCDMA-16, and WCDMA-24 the output will be:
Usage:
|
inline |
Generated on Sat Jul 6 2013 10:54:31 for IT++ by Doxygen 1.8.2