GNU Radio Manual and C++ API Reference  3.7.9.2
The Free & Open Software Radio Ecosystem
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
basic_trellis_encoder_impl.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2002 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 _ATSC_BASIC_TRELLIS_ENCODER_H_
24 #define _ATSC_BASIC_TRELLIS_ENCODER_H_
25 
26 #include <gnuradio/atsc/api.h>
27 #include <assert.h>
28 
29 /*!
30  * \brief ATSC trellis encoder building block.
31  *
32  * Note this is NOT the 12x interleaved interface.
33  *
34  * This implements a single instance of the ATSC trellis encoder.
35  * This is a rate 2/3 encoder (really a constraint length 3, rate 1/2
36  * encoder with the top bit passed through unencoded. This does not
37  * implement the "precoding" of the top bit, because the NTSC rejection
38  * filter is not supported.
39  */
40 
42 
43 private:
44  int state; // two bit state;
45 
46 public:
47  atsci_basic_trellis_encoder () : state (0) {}
48 
49  /*!
50  * Encode two bit INPUT into 3 bit return value. Domain is [0,3],
51  * Range is [0,7]. The mapping to bipolar levels is not done.
52  */
53  int encode (unsigned int input);
54 
55  //! reset encoder state
56  void reset () { state = 0; }
57 
58  static const unsigned char next_state[32];
59  static const unsigned char out_symbol[32];
60 };
61 
62 #endif /* _ATSC_BASIC_TRELLIS_ENCODER_H_ */
#define ATSC_API
Definition: gr-atsc/include/gnuradio/atsc/api.h:30
ATSC trellis encoder building block.
Definition: basic_trellis_encoder_impl.h:41
atsci_basic_trellis_encoder()
Definition: basic_trellis_encoder_impl.h:47
void reset()
reset encoder state
Definition: basic_trellis_encoder_impl.h:56
FEC_API unsigned char encode(unsigned char *symbols, unsigned char *data, unsigned int nbytes, unsigned char encstate)