IT++ Logo
rec_syst_conv_code.h
Go to the documentation of this file.
1 
29 #ifndef REC_SYST_CONV_CODE_H
30 #define REC_SYST_CONV_CODE_H
31 
32 #include <itpp/base/vec.h>
33 #include <itpp/base/mat.h>
34 #include <itpp/comm/convcode.h>
35 #include <itpp/comm/llr.h>
36 #include <itpp/itexports.h>
37 
38 namespace itpp
39 {
40 
51 class ITPP_EXPORT Rec_Syst_Conv_Code
52 {
53 public:
54 
56  Rec_Syst_Conv_Code(): infinity(1e30) {}
57 
59  virtual ~Rec_Syst_Conv_Code() {}
60 
69  void set_generator_polynomials(const ivec &gen, int constraint_length);
70 
77  void set_awgn_channel_parameters(double Ec, double N0);
78 
84  void set_scaling_factor(double in_Lc);
85 
89  void set_llrcalc(LLR_calc_unit in_llrcalc);
90 
98  void encode_tail(const bvec &input, bvec &tail, bmat &parity_bits);
99 
103  void encode(const bvec &input, bmat &parity_bits);
104 
120  virtual void map_decode(const vec &rec_systematic, const mat &rec_parity, const vec &extrinsic_input, vec &extrinsic_output,
121  bool set_terminated = false);
122 
141  virtual void log_decode(const vec &rec_systematic, const mat &rec_parity, const vec &extrinsic_input,
142  vec &extrinsic_output, bool set_terminated = false, std::string metric = "LOGMAX");
143 
158  virtual void log_decode_n2(const vec &rec_systematic,
159  const vec &rec_parity,
160  const vec &extrinsic_input,
161  vec &extrinsic_output,
162  bool set_terminated = false,
163  std::string metric = "LOGMAX");
164 
165  // ===== EGL: ADDED FUNCTIONS NOV 2005 (THESE ARE DERIVATIVES OF EXISTING FUNCTIONS) ======
166 
179  virtual void log_decode(const QLLRvec &rec_systematic,
180  const QLLRmat &rec_parity,
181  const QLLRvec &extrinsic_input,
182  QLLRvec &extrinsic_output,
183  bool set_terminated = false);
184 
197  virtual void log_decode_n2(const QLLRvec &rec_systematic,
198  const QLLRvec &rec_parity,
199  const QLLRvec &extrinsic_input,
200  QLLRvec &extrinsic_output,
201  bool set_terminated = false);
202 
203  // ========================================================
204 
206  Rec_Syst_Conv_Code & operator=(const Rec_Syst_Conv_Code &) { return *this; }
207 
208 private:
210  int calc_state_transition(const int instate, const int input, ivec &parity);
211 
212  int n, K, m;
213  ivec gen_pol, gen_pol_rev;
214  int encoder_state, Nstates;
215  double rate, Lc;
216  imat state_trans, output_parity, rev_state_trans, rev_output_parity;
217  bool terminated;
218  double ln2;
219 
224  LLR_calc_unit llrcalc;
225 
226  // This const value replaces INT definition used previously
227  const double infinity;
228 };
229 
230 } // namespace itpp
231 
232 #endif // #ifndef REC_SYST_CONV_CODE_H
SourceForge Logo

Generated on Sat Jul 6 2013 10:54:23 for IT++ by Doxygen 1.8.2