GNU Radio 3.5.3.1 C++ API
gr_decode_ccsds_27_fb.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2008 Free Software Foundation, Inc.
4  *
5  * GNU Radio is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3, or (at your option)
8  * any later version.
9  *
10  * GNU Radio is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with GNU Radio; see the file COPYING. If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street,
18  * Boston, MA 02110-1301, USA.
19  */
20 #ifndef INCLUDED_GR_DECODE_CCSDS_27_FB_H
21 #define INCLUDED_GR_DECODE_CCSDS_27_FB_H
22 
23 #include <gr_core_api.h>
24 #include <gr_sync_decimator.h>
25 
26 extern "C" {
27 #include <viterbi.h>
28 }
29 
31 
33 
35 
36 /*! \brief A rate 1/2, k=7 convolutional decoder for the CCSDS standard
37  * \ingroup ecc
38  *
39  * This block performs soft-decision convolutional decoding using the Viterbi
40  * algorithm.
41  *
42  * The input is a stream of (possibly noise corrupted) floating point values
43  * nominally spanning [-1.0, 1.0], representing the encoded channel symbols
44  * 0 (-1.0) and 1 (1.0), with erased symbols at 0.0.
45  *
46  * The output is MSB first packed bytes of decoded values.
47  *
48  * As a rate 1/2 code, there will be one output byte for every 16 input symbols.
49  *
50  * This block is designed for continuous data streaming, not packetized data.
51  * The first 32 bits out will be zeroes, with the output delayed four bytes
52  * from the corresponding inputs.
53  */
54 
56 {
57 private:
59 
61 
62  // Viterbi state
63  int d_mettab[2][256];
64  struct viterbi_state d_state0[64];
65  struct viterbi_state d_state1[64];
66  unsigned char d_viterbi_in[16];
67 
68  int d_count;
69 
70 public:
72 
73  int work (int noutput_items,
74  gr_vector_const_void_star &input_items,
75  gr_vector_void_star &output_items);
76 };
77 
78 #endif /* INCLUDED_GR_DECODE_CCSDS_27_FB_H */