29#ifndef PUNCT_CONVCODE_H
30#define PUNCT_CONVCODE_H
36#include <itpp/itexports.h>
119 void encode(
const bvec &input, bvec &output);
121 bvec
encode(
const bvec &input) { bvec output;
encode(input, output);
return output; }
124 void encode_trunc(
const bvec &input, bvec &output);
135 void encode_tail(
const bvec &input, bvec &output);
146 void encode_tailbite(
const bvec &input, bvec &output);
149 { bvec output; encode_tailbite(input, output);
return output; }
185 { bvec output; decode_tailbite(
received_signal, output);
return output; }
196 bool catastrophic(
void);
255 int weight_reverse(
const int state,
const int input,
int time);
257 void weight_reverse(
const int state,
int &
w0,
int &
w1,
int time);
Definition of Array class (container)
Binary Convolutional rate 1/n class.
void set_method(const CONVOLUTIONAL_CODE_METHOD method)
Set encoding and decoding method (Trunc, Tail, or Tailbite)
void set_code(const CONVOLUTIONAL_CODE_TYPE type_of_code, int inverse_rate, int constraint_length)
Set the code according to built-in tables.
void set_generator_polynomials(const ivec &gen, int constraint_length)
Set generator polynomials. Given in Proakis integer form.
Binary Punctured Convolutional Code Class.
void set_method(const CONVOLUTIONAL_CODE_METHOD method)
Set encoding and decoding method (Trunc, Tail, or Tailbite)
void set_generator_polynomials(const ivec &gen, int constraint_length)
Set generator polynomials. Given in Proakis integer form.
int get_puncture_period() const
Get puncturing period.
void set_code(const CONVOLUTIONAL_CODE_TYPE type_of_code, int inverse_rate, int constraint_length)
Set the code according to built-in tables.
virtual ~Punctured_Convolutional_Code(void)
Destructor.
bmat puncture_matrix
The puncture matrix (n rows and Period columns)
bvec encode_tail(const bvec &input)
Encoding that begins and ends in the zero state.
ivec get_generator_polynomials() const
Get generator polynomials.
bvec encode_tailbite(const bvec &input)
Encode a binary vector of inputs using tailbiting.
int total
The number of "1" in the puncture matrix.
bvec decode_tail(const vec &received_signal)
Decode a block of encoded data where encode_tail has been used.
virtual double get_rate() const
Return rate of code.
bmat get_puncture_matrix() const
Get puncture matrix.
Punctured_Convolutional_Code(void)
Constructor.
bvec encode_trunc(const bvec &input)
Encode a binary vector of inputs starting from state set by the set_state function.
bvec decode_tailbite(const vec &received_signal)
Decode a block of encoded data where encode_tailbite has been used. Tries all start states.
bvec encode(const bvec &input)
Encode a binary vector of inputs using specified method.
virtual bvec decode(const vec &received_signal)
Viterbi decoding using specified method.
bvec decode_trunc(const vec &received_signal)
Viterbi decoding using truncation of memory (default = 5*K)
void init_encoder()
Set the encoder internal state in start_state (set by set_start_state()).
int Period
The puncture period (i.e. the number of columns in the puncture matrix)
Definition of a binary convolutional encoder class.
CONVOLUTIONAL_CODE_METHOD
Encoding and decoding methods for Convolutional codes.
CONVOLUTIONAL_CODE_TYPE
Type of Convolutional Code.
int weight(const bvec &a)
Calculate the Hamming weight of a.
Vec< T > reverse(const Vec< T > &in)
Reverse the input vector.
vec spectrum(const vec &v, int nfft, int noverlap)
Power spectrum calculation.
Matrix Class Definitions.
Mat< bin > bmat
bin matrix
Templated Vector Class Definitions.