GNU Radio 3.4.0 C++ API
core_algorithms.h
Go to the documentation of this file.
00001 /* -*- c++ -*- */
00002 /*
00003  * Copyright 2004 Free Software Foundation, Inc.
00004  * 
00005  * This file is part of GNU Radio
00006  * 
00007  * GNU Radio is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 3, or (at your option)
00010  * any later version.
00011  * 
00012  * GNU Radio is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  * 
00017  * You should have received a copy of the GNU General Public License
00018  * along with GNU Radio; see the file COPYING.  If not, write to
00019  * the Free Software Foundation, Inc., 51 Franklin Street,
00020  * Boston, MA 02110-1301, USA.
00021  */
00022 
00023 #ifndef INCLUDED_CORE_ALGORITHMS_H
00024 #define INCLUDED_CORE_ALGORITHMS_H
00025 
00026 #include <cmath>
00027 #include <vector>
00028 //#include <gr_complex.h>
00029 #include "metric_type.h"
00030 #include "fsm.h"
00031 #include "interleaver.h"
00032 
00033 
00034 float min(float a, float b);
00035 float min_star(float a, float b);
00036 
00037 template <class T> 
00038 void viterbi_algorithm(int I, int S, int O,
00039              const std::vector<int> &NS,
00040              const std::vector<int> &OS,
00041              const std::vector< std::vector<int> > &PS,
00042              const std::vector< std::vector<int> > &PI,
00043              int K,
00044              int S0,int SK,
00045              const float *in, T *out
00046 );
00047 
00048 template <class Ti, class To>
00049 void viterbi_algorithm_combined(int I, int S, int O,
00050              const std::vector<int> &NS,
00051              const std::vector<int> &OS,
00052              const std::vector< std::vector<int> > &PS,
00053              const std::vector< std::vector<int> > &PI,
00054              int K,
00055              int S0,int SK,
00056              int D,
00057              const std::vector<Ti> &TABLE,
00058              trellis_metric_type_t TYPE,
00059              const Ti *in, To *out
00060 );
00061 
00062 
00063 
00064 void siso_algorithm(int I, int S, int O,
00065              const std::vector<int> &NS,
00066              const std::vector<int> &OS,
00067              const std::vector< std::vector<int> > &PS,
00068              const std::vector< std::vector<int> > &PI,
00069              int K,
00070              int S0,int SK,
00071              bool POSTI, bool POSTO,
00072              float (*p2mymin)(float,float),
00073              const float *priori, const float *prioro, float *post
00074 );
00075 
00076 
00077 template <class T>
00078 void siso_algorithm_combined(int I, int S, int O,
00079              const std::vector<int> &NS,
00080              const std::vector<int> &OS,
00081              const std::vector< std::vector<int> > &PS,
00082              const std::vector< std::vector<int> > &PI,
00083              int K,
00084              int S0,int SK,
00085              bool POSTI, bool POSTO,
00086              float (*p2mymin)(float,float),
00087              int D,
00088              const std::vector<T> &TABLE,
00089              trellis_metric_type_t TYPE,
00090              const float *priori, const T *observations, float *post
00091 );
00092 
00093 
00094 template<class Ti, class To>
00095 void sccc_decoder_combined(
00096       const fsm &FSMo, int STo0, int SToK,
00097       const fsm &FSMi, int STi0, int STiK,
00098       const interleaver &INTERLEAVER, int blocklength, int repetitions,
00099       float (*p2mymin)(float,float),
00100       int D, const std::vector<Ti> &TABLE,
00101       trellis_metric_type_t METRIC_TYPE,
00102       float scaling,
00103       const Ti *observations, To *data
00104 );
00105 
00106 
00107 template<class T>
00108 void sccc_decoder(
00109       const fsm &FSMo, int STo0, int SToK,
00110       const fsm &FSMi, int STi0, int STiK,
00111       const interleaver &INTERLEAVER, int blocklength, int repetitions,
00112       float (*p2mymin)(float,float),
00113       const float *iprioro, T *data
00114 );
00115 
00116 
00117 template<class T>
00118 void pccc_decoder(
00119       const fsm &FSM1, int ST10, int ST1K,
00120       const fsm &FSM2, int ST20, int ST2K,
00121       const interleaver &INTERLEAVER, int blocklength, int repetitions,
00122       float (*p2mymin)(float,float),
00123       const float *cprioro, T *data
00124 );
00125 
00126 
00127 
00128 #endif