35 #include <itpp/itexports.h>
42 #if (defined(_MSC_VER) && defined (ITPP_SHARED_LIB))
44 template class ITPP_EXPORT Sequence_Interleaver<bin>;
45 template class ITPP_EXPORT Sequence_Interleaver<double>;
99 void set_parameters(ivec gen1, ivec gen2,
int constraint_length,
100 const ivec &interleaver_sequence,
int in_iterations = 8,
101 std::string in_metric =
"LOGMAX",
double in_logmax_scale_factor = 1.0,
110 void set_interleaver(
const ivec &interleaver_sequence);
124 void set_metric(std::string in_metric =
"LOGMAX",
double in_logmax_scale_factor = 1.0,
130 void set_iterations(
int in_iterations = 8);
138 void set_adaptive_stop(
bool in_adaptive_stop =
true);
146 void set_awgn_channel_parameters(
double in_Ec,
double in_N0);
170 void set_scaling_factor(
double in_Lc);
191 void encode(
const bvec &input, bvec &output);
204 virtual void decode(
const vec &received_signal, bvec &decoded_bits,
const bvec &true_bits =
"0");
218 virtual void decode(
const vec &received_signal, bvec &decoded_bits, ivec &nrof_used_iterations,
219 const bvec &true_bits =
"0");
237 void encode_block(
const bvec &input, bvec &in1, bvec &in2,
bmat &parity1,
bmat &parity2);
268 virtual void decode_block(
const vec &rec_syst1,
const vec &rec_syst2,
const mat &rec_parity1,
const mat &rec_parity2,
269 bmat &decoded_bits_i,
int &nrof_used_iterations_i,
const bvec &true_bits =
"0");
282 void decode_n3(
const vec &received_signal, bvec &decoded_bits, ivec &nrof_used_iterations,
283 const bvec &true_bits =
"0");
286 int interleaver_size;
287 int Ncoded, Nuncoded;
288 int m_tail, n1, n2, n_tot, iterations;
289 double Ec, N0, Lc, R, logmax_scale_factor;
291 struct ITPP_EXPORT Metric
293 enum Type {Unknown, LOGMAX,
LOGMAP, MAP, TABLE};
294 Metric() : _t(Unknown) {}
295 Metric(Type t) : _t(t) {}
296 operator Type ()
const {
return _t;}
299 template<
typename T>
operator T ()
const;
304 bvec decoded_bits_previous_iteration;
307 Rec_Syst_Conv_Code rscc1, rscc2;
308 Sequence_Interleaver<bin> bit_interleaver;
309 Sequence_Interleaver<double> float_interleaver;
310 static std::string string_from_metric(
const Metric& m);
368 void set_parameters(ivec gen1, ivec gen2,
int constraint_length,
const ivec &interleaver_sequence,
bmat &pmatrix,
int in_iterations = 8, std::string in_metric =
"LOGMAX",
double in_logmax_scale_factor = 1.0,
bool in_adaptive_stop =
false,
itpp::LLR_calc_unit lcalc =
itpp::LLR_calc_unit());
375 void set_puncture_matrix(
const bmat &pmatrix);
399 double get_rate(
bool nominal =
true);
431 void encode(
const bvec &input, bvec &output);
440 bvec encode(
const bvec &input);
453 virtual void decode(
const vec &received_signal, bvec &decoded_bits,
const bvec &true_bits =
"0");
464 virtual bvec decode(
const vec &received_signal);
478 virtual void decode(
const vec &received_signal, bvec &decoded_bits, ivec &nrof_used_iterations,
479 const bvec &true_bits =
"0");
502 void calculate_punctured_size(
void);
507 int punct_total, punct_total1, punct_total2;
509 bmat puncture_matrix;
528 #endif // #ifndef TURBO_H