GNU Radio Manual and C++ API Reference  3.8.1.0
The Free & Open Software Radio Ecosystem
gr-fec/include/gnuradio/fec/viterbi.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008,2018 Free Software Foundation, Inc.
3  *
4  * This file is part of GNU Radio
5  *
6  * GNU Radio is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3, or (at your option)
9  * any later version.
10  *
11  * GNU Radio is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with GNU Radio; see the file COPYING. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street,
19  * Boston, MA 02110-1301, USA.
20  */
21 
22 /* The path memory for each state is 32 bits. This is slightly shorter
23  * than we'd like for K=7, especially since we chain back every 8 bits.
24  * But it fits so nicely into a 32-bit machine word...
25  */
26 
27 #ifndef INCLUDED_VITERBI_H
28 #define INCLUDED_VITERBI_H
29 
30 #include <gnuradio/fec/api.h>
31 
32 namespace gr {
33 namespace fec {
34 
36  unsigned long path; /* Decoded path to this state */
37  long metric; /* Cumulative metric to this state */
38 };
39 
40 FEC_API
41 void gen_met(int mettab[2][256], /* Metric table */
42  int amp, /* Signal amplitude */
43  double esn0, /* Es/N0 ratio in dB */
44  double bias, /* Metric bias */
45  int scale); /* Scale factor */
46 
47 FEC_API unsigned char encode(unsigned char* symbols,
48  unsigned char* data,
49  unsigned int nbytes,
50  unsigned char encstate);
51 
52 FEC_API void viterbi_chunks_init(struct viterbi_state* state);
53 
54 FEC_API void viterbi_butterfly2(unsigned char* symbols,
55  int mettab[2][256],
56  struct viterbi_state* state0,
57  struct viterbi_state* state1);
58 
59 FEC_API unsigned char viterbi_get_output(struct viterbi_state* state,
60  unsigned char* outbuf);
61 } // namespace fec
62 } // namespace gr
63 
64 #endif /* INCLUDED_VITERBI_H */
Definition: gr-fec/include/gnuradio/fec/viterbi.h:35
unsigned long path
Definition: gr-fec/include/gnuradio/fec/viterbi.h:36
FEC_API void viterbi_butterfly2(unsigned char *symbols, int mettab[2][256], struct viterbi_state *state0, struct viterbi_state *state1)
FEC_API void viterbi_chunks_init(struct viterbi_state *state)
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition: basic_block.h:43
#define FEC_API
Definition: gr-fec/include/gnuradio/fec/api.h:30
FEC_API unsigned char encode(unsigned char *symbols, unsigned char *data, unsigned int nbytes, unsigned char encstate)
FEC_API void gen_met(int mettab[2][256], int amp, double esn0, double bias, int scale)
FEC_API unsigned char viterbi_get_output(struct viterbi_state *state, unsigned char *outbuf)
long metric
Definition: gr-fec/include/gnuradio/fec/viterbi.h:37