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
modulator.h
One- and two-dimensional modulators - header file.
itpp::Channel_Code::Channel_Code
Channel_Code()
Default constructor.
Definition: channel_code.h:54
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::Channel_Code::~Channel_Code
virtual ~Channel_Code()
Destructor.
Definition: channel_code.h:56
itpp::BPSK
BPSK modulator with real symbols.
Definition: modulator.h:876
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
itpp namespace
Definition: itmex.h:36
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
Dummy Channel Code class.
Definition: channel_code.h:86
itpp::Dummy_Code::~Dummy_Code
virtual ~Dummy_Code()
Destructor.
Definition: channel_code.h:92
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::encode
virtual void encode(const bvec &uncoded_bits, bvec &coded_bits)
Encode a bvec of input.
Definition: channel_code.h:95
itpp::Dummy_Code::get_rate
virtual double get_rate() const
Get the code rate.
Definition: channel_code.h:110
itpp::Dummy_Code::decode
virtual bvec decode(const bvec &coded_bits)
Decode a bvec of coded data.
Definition: channel_code.h:102
itpp::Channel_Code
Generic Channel Code class.
Definition: channel_code.h:50
vec.h
Templated Vector Class Definitions.
itpp::Dummy_Code::Dummy_Code
Dummy_Code()
Default constructor.
Definition: channel_code.h:90
itpp::Dummy_Code::encode
virtual bvec encode(const bvec &uncoded_bits)
Encode a bvec of input.
Definition: channel_code.h:97

Generated on Mon Mar 23 2020 06:18:03 for IT++ by Doxygen 1.8.17