GNU Radio 3.5.1 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 "digital_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 T>
00095 void sccc_decoder(
00096       const fsm &FSMo, int STo0, int SToK,
00097       const fsm &FSMi, int STi0, int STiK,
00098       const interleaver &INTERLEAVER, int blocklength, int iterations,
00099       float (*p2mymin)(float,float),
00100       const float *iprioro, T *data
00101 );
00102  
00103 
00104 template<class Ti, class To>
00105 void sccc_decoder_combined(
00106       const fsm &FSMo, int STo0, int SToK,
00107       const fsm &FSMi, int STi0, int STiK,
00108       const interleaver &INTERLEAVER, int blocklength, int iterations,
00109       float (*p2mymin)(float,float),
00110       int D, const std::vector<Ti> &TABLE,
00111       trellis_metric_type_t METRIC_TYPE,
00112       float scaling,
00113       const Ti *observations, To *data
00114 );
00115 
00116 template<class T>
00117 void pccc_decoder(
00118       const fsm &FSM1, int ST10, int ST1K,
00119       const fsm &FSM2, int ST20, int ST2K,
00120       const interleaver &INTERLEAVER, int blocklength, int iterations,
00121       float (*p2mymin)(float,float),
00122       const float *cprioro, T *data
00123 );
00124 
00125 template<class Ti, class To>
00126 void pccc_decoder_combined(
00127       const fsm &FSM1, int ST10, int ST1K,
00128       const fsm &FSM2, int ST20, int ST2K,
00129       const interleaver &INTERLEAVER, int blocklength, int iterations,
00130       float (*p2mymin)(float,float),
00131       int D, const std::vector<Ti> &TABLE,
00132       trellis_metric_type_t METRIC_TYPE,
00133       float scaling,
00134       const Ti *observations, To *data
00135 );
00136 
00137 
00138 
00139 
00140 #endif