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