GNU Radio 3.6.4 C++ API
core_algorithms.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2004 Free Software Foundation, Inc.
4  *
5  * This file is part of GNU Radio
6  *
7  * GNU Radio is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3, or (at your option)
10  * any later version.
11  *
12  * GNU Radio is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with GNU Radio; see the file COPYING. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 #ifndef INCLUDED_CORE_ALGORITHMS_H
24 #define INCLUDED_CORE_ALGORITHMS_H
25 
26 #include <cmath>
27 #include <vector>
28 //#include <gr_complex.h>
29 #include "digital_metric_type.h"
30 #include "fsm.h"
31 #include "interleaver.h"
32 
33 
34 float min(float a, float b);
35 float min_star(float a, float b);
36 
37 template <class T>
38 void viterbi_algorithm(int I, int S, int O,
39  const std::vector<int> &NS,
40  const std::vector<int> &OS,
41  const std::vector< std::vector<int> > &PS,
42  const std::vector< std::vector<int> > &PI,
43  int K,
44  int S0,int SK,
45  const float *in, T *out
46 );
47 
48 template <class Ti, class To>
49 void viterbi_algorithm_combined(int I, int S, int O,
50  const std::vector<int> &NS,
51  const std::vector<int> &OS,
52  const std::vector< std::vector<int> > &PS,
53  const std::vector< std::vector<int> > &PI,
54  int K,
55  int S0,int SK,
56  int D,
57  const std::vector<Ti> &TABLE,
59  const Ti *in, To *out
60 );
61 
62 
63 
64 void siso_algorithm(int I, int S, int O,
65  const std::vector<int> &NS,
66  const std::vector<int> &OS,
67  const std::vector< std::vector<int> > &PS,
68  const std::vector< std::vector<int> > &PI,
69  int K,
70  int S0,int SK,
71  bool POSTI, bool POSTO,
72  float (*p2mymin)(float,float),
73  const float *priori, const float *prioro, float *post
74 );
75 
76 
77 template <class T>
78 void siso_algorithm_combined(int I, int S, int O,
79  const std::vector<int> &NS,
80  const std::vector<int> &OS,
81  const std::vector< std::vector<int> > &PS,
82  const std::vector< std::vector<int> > &PI,
83  int K,
84  int S0,int SK,
85  bool POSTI, bool POSTO,
86  float (*p2mymin)(float,float),
87  int D,
88  const std::vector<T> &TABLE,
90  const float *priori, const T *observations, float *post
91 );
92 
93 
94 template<class T>
95 void sccc_decoder(
96  const fsm &FSMo, int STo0, int SToK,
97  const fsm &FSMi, int STi0, int STiK,
98  const interleaver &INTERLEAVER, int blocklength, int iterations,
99  float (*p2mymin)(float,float),
100  const float *iprioro, T *data
101 );
102 
103 
104 template<class Ti, class To>
106  const fsm &FSMo, int STo0, int SToK,
107  const fsm &FSMi, int STi0, int STiK,
108  const interleaver &INTERLEAVER, int blocklength, int iterations,
109  float (*p2mymin)(float,float),
110  int D, const std::vector<Ti> &TABLE,
111  trellis_metric_type_t METRIC_TYPE,
112  float scaling,
113  const Ti *observations, To *data
114 );
115 
116 template<class T>
117 void pccc_decoder(
118  const fsm &FSM1, int ST10, int ST1K,
119  const fsm &FSM2, int ST20, int ST2K,
120  const interleaver &INTERLEAVER, int blocklength, int iterations,
121  float (*p2mymin)(float,float),
122  const float *cprioro, T *data
123 );
124 
125 template<class Ti, class To>
127  const fsm &FSM1, int ST10, int ST1K,
128  const fsm &FSM2, int ST20, int ST2K,
129  const interleaver &INTERLEAVER, int blocklength, int iterations,
130  float (*p2mymin)(float,float),
131  int D, const std::vector<Ti> &TABLE,
132  trellis_metric_type_t METRIC_TYPE,
133  float scaling,
134  const Ti *observations, To *data
135 );
136 
137 
138 
139 
140 #endif