GNU Radio 3.7.2 C++ API
viterbi.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008 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 #include <gnuradio/fec/api.h>
28 
29 struct viterbi_state {
30  unsigned long path; /* Decoded path to this state */
31  long metric; /* Cumulative metric to this state */
32 };
33 
34 FEC_API
35 int gen_met(int mettab[2][256], /* Metric table */
36  int amp, /* Signal amplitude */
37  double esn0, /* Es/N0 ratio in dB */
38  double bias, /* Metric bias */
39  int scale); /* Scale factor */
40 
41 FEC_API unsigned char
42 encode(unsigned char *symbols, unsigned char *data,
43  unsigned int nbytes,unsigned char encstate);
44 
45 FEC_API void
46 viterbi_chunks_init(struct viterbi_state* state);
47 
48  FEC_API void
49 viterbi_butterfly2(unsigned char *symbols, int mettab[2][256],
50  struct viterbi_state *state0, struct viterbi_state *state1);
51 
52 FEC_API unsigned char
53 viterbi_get_output(struct viterbi_state *state, unsigned char *outbuf);
FEC_API unsigned char viterbi_get_output(struct viterbi_state *state, unsigned char *outbuf)
FEC_API int gen_met(int mettab[2][256], int amp, double esn0, double bias, int scale)
Definition: viterbi.h:29
long metric
Definition: viterbi.h:31
FEC_API void viterbi_chunks_init(struct viterbi_state *state)
#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 viterbi_butterfly2(unsigned char *symbols, int mettab[2][256], struct viterbi_state *state0, struct viterbi_state *state1)
unsigned long path
Definition: viterbi.h:30