channel_code.h
Go to the documentation of this file.
#ifndef CHANNEL_CODE_H
#define CHANNEL_CODE_H
#include <itpp/base/vec.h>
#include <itpp/comm/modulator.h>
#include <itpp/itexports.h>
namespace itpp
{
//---------------------- BCH --------------------------------------
class ITPP_EXPORT Channel_Code
{
public:
Channel_Code() {}
virtual ~Channel_Code() {}
virtual void encode(const bvec &uncoded_bits, bvec &coded_bits) = 0;
virtual bvec encode(const bvec &uncoded_bits) = 0;
virtual void decode(const bvec &codedbits, bvec &decoded_bits) = 0;
//virtual bvec decode(const bvec &coded_bits);
virtual bvec decode(const bvec &coded_bits) = 0;
virtual void decode(const vec &received_signal, bvec &decoded_bits) = 0;
//virtual bvec decode(const vec &received_signal);
virtual bvec decode(const vec &received_signal) = 0;
virtual double get_rate() const = 0;
};
class ITPP_EXPORT Dummy_Code : public Channel_Code
{
public:
Dummy_Code() {}
virtual ~Dummy_Code() {}
virtual void encode(const bvec &uncoded_bits, bvec &coded_bits) { coded_bits = uncoded_bits; }
virtual bvec encode(const bvec &uncoded_bits) { return uncoded_bits; }
virtual void decode(const bvec &coded_bits, bvec &decoded_bits) { decoded_bits = coded_bits; }
virtual bvec decode(const bvec &coded_bits) { return coded_bits; }
virtual void decode(const vec &received_signal, bvec &decoded_bits) { BPSK bpsk; bpsk.demodulate_bits(received_signal, decoded_bits); }
virtual bvec decode(const vec &received_signal) { bvec out; decode(received_signal, out); return out; }
virtual double get_rate() const { return 1.0; }
};
} // namespace itpp
#endif // #ifndef CHANNEL_CODE_H
itpp::Array
General array class.
Definition array.h:105
itpp::BPSK
BPSK modulator with real symbols.
Definition modulator.h:877
itpp::BPSK::demodulate_bits
void demodulate_bits(const vec &signal, bvec &output) const
Demodulate noisy BPSK symbols in complex domain into bits.
Definition modulator.cpp:326
itpp::Channel_Code
Generic Channel Code class.
Definition channel_code.h:51
itpp::Channel_Code::Channel_Code
Channel_Code()
Default constructor.
Definition channel_code.h:54
itpp::Channel_Code::decode
virtual bvec decode(const bvec &coded_bits)=0
Decode a bvec of coded data.
itpp::Channel_Code::get_rate
virtual double get_rate() const =0
Get the code rate.
itpp::Channel_Code::encode
virtual bvec encode(const bvec &uncoded_bits)=0
Encode a bvec of input.
itpp::Channel_Code::encode
virtual void encode(const bvec &uncoded_bits, bvec &coded_bits)=0
Encode a bvec of input.
itpp::Channel_Code::decode
virtual void decode(const vec &received_signal, bvec &decoded_bits)=0
Decode a vec of received data.
itpp::Channel_Code::~Channel_Code
virtual ~Channel_Code()
Destructor.
Definition channel_code.h:56
itpp::Channel_Code::decode
virtual bvec decode(const vec &received_signal)=0
Decode a vec of received data.
itpp::Channel_Code::decode
virtual void decode(const bvec &codedbits, bvec &decoded_bits)=0
Decode a bvec of coded data.
itpp::Dummy_Code
Dummy Channel Code class.
Definition channel_code.h:87
itpp::Dummy_Code::decode
virtual void decode(const vec &received_signal, bvec &decoded_bits)
Decode a vec of received data. Assumes soft input (BPSK modulated)
Definition channel_code.h:105
itpp::Dummy_Code::Dummy_Code
Dummy_Code()
Default constructor.
Definition channel_code.h:90
itpp::Dummy_Code::decode
virtual bvec decode(const bvec &coded_bits)
Decode a bvec of coded data.
Definition channel_code.h:102
itpp::Dummy_Code::encode
virtual bvec encode(const bvec &uncoded_bits)
Encode a bvec of input.
Definition channel_code.h:97
itpp::Dummy_Code::get_rate
virtual double get_rate() const
Get the code rate.
Definition channel_code.h:110
itpp::Dummy_Code::decode
virtual void decode(const bvec &coded_bits, bvec &decoded_bits)
Decode a bvec of coded data.
Definition channel_code.h:100
itpp::Dummy_Code::decode
virtual bvec decode(const vec &received_signal)
Decode a vec of received data. Assumes soft input (BPSK modulated)
Definition channel_code.h:107
itpp::Dummy_Code::encode
virtual void encode(const bvec &uncoded_bits, bvec &coded_bits)
Encode a bvec of input.
Definition channel_code.h:95
itpp::Dummy_Code::~Dummy_Code
virtual ~Dummy_Code()
Destructor.
Definition channel_code.h:92
modulator.h
One- and two-dimensional modulators - header file.
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