Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

rec_syst_conv_code.h

Go to the documentation of this file.
00001 // 
00002 // SPUC - Signal processing using C++ - A DSP library
00003 /*---------------------------------------------------------------------------*
00004  *                                   IT++                                    *
00005  *---------------------------------------------------------------------------*
00006  * Copyright (c) 1995-2001 by Tony Ottosson, Thomas Eriksson, Pål Frenger,   *
00007  * Tobias Ringström, and Jonas Samuelsson.                                   *
00008  *                                                                           *
00009  * Permission to use, copy, modify, and distribute this software and its     *
00010  * documentation under the terms of the GNU General Public License is hereby *
00011  * granted. No representations are made about the suitability of this        *
00012  * software for any purpose. It is provided "as is" without expressed or     *
00013  * implied warranty. See the GNU General Public License for more details.    *
00014  *---------------------------------------------------------------------------*/
00015 
00026 #ifndef __rec_syst_conv_code_h
00027 #define __rec_syst_conv_code_h
00028 
00029 #include <binary.h>
00030 #include <vector.h>
00031 #include <matrix.h>
00032 //#include "specmat.h"
00033 //#include "matfunc.h"
00034 #include "convcode.h"
00035 namespace SPUC {
00046 class Rec_Syst_Conv_Code {
00047 public:
00048 
00050   Rec_Syst_Conv_Code(void) {}
00051 
00060   void set_generator_polynomials(const ivec &gen, int constraint_length);
00061 
00068   void set_awgn_channel_parameters(double in_Ec, double in_N0);
00069 
00075   void set_scaling_factor(double in_Lc);
00076 
00084   void encode_tail(const bvec &input, bvec &tail, bmat &parity_bits);
00085 
00089   void encode(const bvec &input, bmat &parity_bits);
00090 
00104   void map_decode(const vec &rec_systematic, const mat &rec_parity, const vec &extrinsic_input, vec &extrinsic_output, 
00105                   bool set_terminated = false);
00106 
00121   void log_decode(const vec &rec_systematic, const mat &rec_parity, const vec &extrinsic_input, vec &extrinsic_output,
00122                   bool set_terminated = false, string metric = "LOGMAX");
00123 
00134   void log_decode_n2(const vec &rec_systematic, const vec &rec_parity, const vec &extrinsic_input, vec &extrinsic_output, 
00135                      bool in_terminated = false, string metric = "LOGMAX");
00136 
00137 private:
00138 
00140   void state_transition(int s_prim, int input_bit, int &s, int &parity);
00142   void reverse_state_transition(int s, int input_bit, int &s_prim, int &parity);
00144   int calc_state_transition(const int instate, const int input, ivec &parity);
00145 
00146   int n, K, m;
00147   ivec gen_pol, gen_pol_rev;
00148   int encoder_state, Nstates;
00149   double rate, Ec, N0, Lc;
00150   imat state_trans, output_parity, rev_state_trans, rev_output_parity;
00151   bool terminated;
00152   mat gamma, alpha, beta;
00153   vec denom;
00154   double ln2;
00155 
00156 };
00157 }
00158 #endif // __rec_syst_conv_code_h

Generated on Fri Sep 16 11:02:21 2005 for spuc by  doxygen 1.4.4