crc.h
Go to the documentation of this file.
#ifndef CRC_H
#define CRC_H
#include <itpp/base/vec.h>
#include <itpp/base/mat.h>
#include <itpp/itexports.h>
namespace itpp
{
class ITPP_EXPORT CRC_Code
{
public:
CRC_Code() { reverse_parity = false; }
CRC_Code(const std::string &code) { reverse_parity = false; set_code(code); }
void set_generator(const bvec &poly);
void set_code(const std::string &code);
void parity(const bvec &in_bits, bvec &out) const;
bool check_parity(const bvec &coded_bits) const;
void encode(const bvec &in_bits, bvec &out) const;
bvec encode(const bvec &in_bits) const;
bool decode(const bvec &coded_bits, bvec &out) const;
bool decode(bvec &bits) const;
private:
bool reverse_parity;
bvec polynomial;
int no_parity;
};
} // namespace itpp
#endif // #ifndef CRC_H
itpp::Array
General array class.
Definition array.h:105
itpp::CRC_Code
Cyclic Redundancy Check Codes.
Definition crc.h:65
itpp::CRC_Code::CRC_Code
CRC_Code(const std::string &code)
Set CRC code to one of the standardpolynomials using the string value.
Definition crc.h:78
itpp::CRC_Code::CRC_Code
CRC_Code()
Default Constructor.
Definition crc.h:69
itpp::poly
void poly(const vec &r, vec &p)
Create a polynomial of the given roots.
Definition poly.cpp:40
mat.h
Matrix Class Definitions.
itpp
itpp namespace
Definition itmex.h:37
vec.h
Templated Vector Class Definitions.

Generated on Mon Jun 10 2024 11:49:20 for IT++ by Doxygen 1.9.8