37 #include <itpp/itexports.h>
129 int constraint_length);
132 void set_generator_polynomials(
const ivec &gen,
int constraint_length);
142 virtual void encode(
const bvec &input, bvec &output);
145 encode(input, output);
157 void encode_trunc(
const bvec &input, bvec &output);
160 encode_trunc(input, output);
176 void encode_tail(
const bvec &input, bvec &output);
179 encode_tail(input, output);
199 void encode_tailbite(
const bvec &input, bvec &output);
202 encode_tailbite(input, output);
213 void encode_bit(
const bin &input, bvec &output);
216 encode_bit(input, output);
222 virtual void decode(
const bvec &coded_bits, bvec &decoded_bits);
223 virtual bvec decode(
const bvec &coded_bits);
227 virtual void decode(
const vec &received_signal, bvec &output);
228 virtual bvec
decode(
const vec &received_signal) {
230 decode(received_signal, output);
242 virtual void decode_tail(
const vec &received_signal, bvec &output);
245 decode_tail(received_signal, output);
259 virtual void decode_tailbite(
const vec &received_signal, bvec &output);
262 decode_tailbite(received_signal, output);
269 virtual void decode_trunc(
const vec &received_signal, bvec &output);
272 decode_trunc(received_signal, output);
279 virtual double get_rate(
void)
const {
return rate; }
284 it_error_if((state < 0) || ((state >= (1 << m)) && m != 0),
285 "Convolutional_Code::set_start_state(): Invalid start state");
301 it_error_if(length < K,
"Convolutional_Code::set_truncation_length(): "
302 "Truncation length shorter than K");
311 bool catastrophic(
void);
322 bool inverse_tail(
const bvec coded_sequence, bvec &input);
327 void distance_profile(ivec &dist_prof,
int dmax = 100000,
370 const int Cdfree = 1000000,
const bool test_catastrophic =
false);
375 return ((instate >> 1) | (input << (m - 1)));
379 return (((state << 1) | input) & ((1 << m) - 1));
383 S0 = (state << 1) & (no_states - 1);
387 int weight(
const int state,
const int input);
389 void weight(
const int state,
int &w0,
int &w1);
392 int weight_reverse(
const int state,
const int input);
395 void weight_reverse(
const int state,
int &w0,
int &w1);
397 bvec output_reverse(
const int state,
const int input);
399 void output_reverse(
const int state, bvec &zero_output, bvec &one_output);
401 void output_reverse(
const int state,
int &zero_output,
int &one_output);
403 void calc_metric_reverse(
const int state,
const vec &rx_codeword,
404 double &zero_metric,
double &one_metric);
406 void calc_metric(
const vec &rx_codeword, vec &delta_metrics);
408 int get_input(
const int state) {
return (state >> (m - 1)); }
477 #endif // #ifndef CONVCODE_H