GNU Radio 3.7.1 C++ API
|
00001 /* -*- c++ -*- */ 00002 /* 00003 * Copyright 2004,2012 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 <gnuradio/digital/metric_type.h> 00029 #include <gnuradio/trellis/fsm.h> 00030 #include <gnuradio/trellis/interleaver.h> 00031 00032 namespace gr { 00033 namespace trellis { 00034 00035 float min(float a, float b); 00036 float min_star(float a, float b); 00037 00038 template <class T> 00039 void viterbi_algorithm(int I, int S, int O, 00040 const std::vector<int> &NS, 00041 const std::vector<int> &OS, 00042 const std::vector< std::vector<int> > &PS, 00043 const std::vector< std::vector<int> > &PI, 00044 int K, 00045 int S0,int SK, 00046 const float *in, T *out); 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 digital::trellis_metric_type_t TYPE, 00059 const Ti *in, To *out); 00060 00061 void siso_algorithm(int I, int S, int O, 00062 const std::vector<int> &NS, 00063 const std::vector<int> &OS, 00064 const std::vector< std::vector<int> > &PS, 00065 const std::vector< std::vector<int> > &PI, 00066 int K, 00067 int S0,int SK, 00068 bool POSTI, bool POSTO, 00069 float (*p2mymin)(float,float), 00070 const float *priori, const float *prioro, float *post); 00071 00072 template <class T> 00073 void siso_algorithm_combined(int I, int S, int O, 00074 const std::vector<int> &NS, 00075 const std::vector<int> &OS, 00076 const std::vector< std::vector<int> > &PS, 00077 const std::vector< std::vector<int> > &PI, 00078 int K, 00079 int S0,int SK, 00080 bool POSTI, bool POSTO, 00081 float (*p2mymin)(float,float), 00082 int D, 00083 const std::vector<T> &TABLE, 00084 digital::trellis_metric_type_t TYPE, 00085 const float *priori, const T *observations, float *post); 00086 00087 template<class T> 00088 void sccc_decoder(const fsm &FSMo, int STo0, int SToK, 00089 const fsm &FSMi, int STi0, int STiK, 00090 const interleaver &INTERLEAVER, int blocklength, int iterations, 00091 float (*p2mymin)(float,float), 00092 const float *iprioro, T *data); 00093 00094 template<class Ti, class To> 00095 void sccc_decoder_combined(const fsm &FSMo, int STo0, int SToK, 00096 const fsm &FSMi, int STi0, int STiK, 00097 const interleaver &INTERLEAVER, int blocklength, int iterations, 00098 float (*p2mymin)(float,float), 00099 int D, const std::vector<Ti> &TABLE, 00100 digital::trellis_metric_type_t METRIC_TYPE, 00101 float scaling, 00102 const Ti *observations, To *data); 00103 00104 template<class T> 00105 void pccc_decoder(const fsm &FSM1, int ST10, int ST1K, 00106 const fsm &FSM2, int ST20, int ST2K, 00107 const interleaver &INTERLEAVER, int blocklength, int iterations, 00108 float (*p2mymin)(float,float), 00109 const float *cprioro, T *data); 00110 00111 template<class Ti, class To> 00112 void pccc_decoder_combined(const fsm &FSM1, int ST10, int ST1K, 00113 const fsm &FSM2, int ST20, int ST2K, 00114 const interleaver &INTERLEAVER, int blocklength, int iterations, 00115 float (*p2mymin)(float,float), 00116 int D, const std::vector<Ti> &TABLE, 00117 digital::trellis_metric_type_t METRIC_TYPE, 00118 float scaling, 00119 const Ti *observations, To *data); 00120 00121 } /* namespace trellis */ 00122 } /* namespace gr */ 00123 00124 #endif /* INCLUDED_CORE_ALGORITHMS_H */