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

turbo.h

Go to the documentation of this file.
00001 // 
00003 // SPUC - Signal processing using C++ - A DSP library
00004 /*---------------------------------------------------------------------------*
00005  *                                   IT++                                    *
00006  *---------------------------------------------------------------------------*
00007  * Copyright (c) 1995-2001 by Tony Ottosson, Thomas Eriksson, Pål Frenger,   *
00008  * Tobias Ringström, and Jonas Samuelsson.                                   *
00009  *                                                                           *
00010  * Permission to use, copy, modify, and distribute this software and its     *
00011  * documentation under the terms of the GNU General Public License is hereby *
00012  * granted. No representations are made about the suitability of this        *
00013  * software for any purpose. It is provided "as is" without expressed or     *
00014  * implied warranty. See the GNU General Public License for more details.    *
00015  *---------------------------------------------------------------------------*/
00016 
00027 #ifndef __turbo_h
00028 #define __turbo_h
00029 
00030 #include <binary.h>
00031 #include <vector.h>
00032 #include <matrix.h>
00033 #include "rec_syst_conv_code.h"
00034 #include "interleave.h"
00035 namespace SPUC {
00036 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00037 
00049 class Turbo_Codec {
00050  public:
00051   
00053   Turbo_Codec(void) {}
00054   
00065   void set_parameters(ivec gen1, ivec gen2, int constraint_length, const ivec &interleaver_sequence, 
00066                       int in_iterations=8, string in_metric="LOGMAX");
00067 
00074   void set_interleaver(const ivec &interleaver_sequence);
00075   
00082   void set_awgn_channel_parameters(double in_Ec, double in_N0);
00083   
00106   void set_scaling_factor(double in_Lc);
00107 
00126   void encode(const bvec &input, bvec &output);
00127 
00133   void decode(const vec &received_signal, bvec &decoded_bits, const bvec &true_bits="0");
00134 
00150   void encode_block(const bvec &input, bvec &in1, bvec &in2, bmat &parity1, bmat &parity2);
00151 
00175   void decode_block(const vec &rec_syst1, const vec &rec_syst2, const mat &rec_parity1, const mat &rec_parity2, 
00176                     bmat &decoded_bits_i, const bvec &true_bits="0");
00177 
00178 private:   
00179 
00183   void decode_n2(const vec &received_signal, bvec &decoded_bits);
00184 
00185   //Scalars:
00186   long interleaver_size;
00187   long Ncoded, Nuncoded;
00188   int m_tail, n1, n2, n_tot, iterations;
00189   double Ec, N0, Lc, R;
00190   string metric;
00191 
00192   //Classes:
00193   Rec_Syst_Conv_Code rscc1, rscc2;
00194   Sequence_Interleaver<bin> bit_interleaver;
00195   Sequence_Interleaver<double> float_interleaver;
00196 
00197 };
00198 
00199 
00204 ivec wcdma_turbo_interleaver_sequence(int interleaver_size);
00205 #endif
00206 }
00207 #endif // __turbo_h

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