hammcode.h
Go to the documentation of this file.
#ifndef HAMMING_H
#define HAMMING_H
#include <itpp/base/vec.h>
#include <itpp/base/mat.h>
#include <itpp/comm/channel_code.h>
#include <itpp/itexports.h>
namespace itpp
{
class ITPP_EXPORT Hamming_Code : public Channel_Code
{
public:
Hamming_Code(int m);
virtual ~Hamming_Code() { }
virtual void encode(const bvec &uncoded_bits, bvec &coded_bits);
virtual bvec encode(const bvec &uncoded_bits);
virtual void decode(const bvec &coded_bits, bvec &decoded_bits);
virtual bvec decode(const bvec &coded_bits);
// Soft-decision decoding is not implemented
virtual void decode(const vec &received_signal, bvec &output);
virtual bvec decode(const vec &received_signal);
virtual double get_rate() const { return static_cast<double>(k) / n; };
int get_n() const { return n; };
int get_k() const { return k; };
bmat get_H() const { return H; };
bmat get_G() const { return G; };
private:
int n, k;
bmat H, G;
void generate_H(void);
void generate_G(void);
};
} // namespace itpp
#endif // #ifndef HAMMING_H
channel_code.h
Channel Code class virtual interface.
itpp::Array
General array class.
Definition array.h:105
itpp::Channel_Code
Generic Channel Code class.
Definition channel_code.h:51
itpp::Hamming_Code
Binary Hamming codes.
Definition hammcode.h:45
itpp::Hamming_Code::get_H
bmat get_H() const
Gets the parity check matrix for the code.
Definition hammcode.h:75
itpp::Hamming_Code::get_rate
virtual double get_rate() const
Get the code rate.
Definition hammcode.h:68
itpp::Hamming_Code::get_G
bmat get_G() const
Gets the generator matrix for the code.
Definition hammcode.h:77
itpp::Hamming_Code::~Hamming_Code
virtual ~Hamming_Code()
Destructor.
Definition hammcode.h:51
itpp::Hamming_Code::get_n
int get_n() const
Gets the code length n.
Definition hammcode.h:71
itpp::Hamming_Code::get_k
int get_k() const
Gets the number of information bits per code word, k.
Definition hammcode.h:73
mat.h
Matrix Class Definitions.
bmat
Mat< bin > bmat
bin matrix
Definition mat.h:508
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