Statistics
| Branch: | Tag: | Revision:

root / gnuradio-core / src / lib / general / gr_decode_ccsds_27_fb.h @ 38fe2e1b

History | View | Annotate | Download (2.3 kB)

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