GNU Radio Manual and C++ API Reference 3.7.14.0
The Free & Open Software Radio Ecosystem
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
44private:
45 int state; // two bit state;
46
47public:
49
50 /*!
51 * Encode two bit INPUT into 3 bit return value. Domain is [0,3],
52 * Range is [0,7]. The mapping to bipolar levels is not done.
53 */
54 int encode(unsigned int input);
55
56 //! reset encoder state
57 void reset() { state = 0; }
58
59 static const unsigned char next_state[32];
60 static const unsigned char out_symbol[32];
61};
62
63#endif /* _ATSC_BASIC_TRELLIS_ENCODER_H_ */
ATSC trellis encoder building block.
Definition: basic_trellis_encoder_impl.h:42
int encode(unsigned int input)
void reset()
reset encoder state
Definition: basic_trellis_encoder_impl.h:57
atsci_basic_trellis_encoder()
Definition: basic_trellis_encoder_impl.h:48
#define ATSC_API
Definition: gr-atsc/include/gnuradio/atsc/api.h:30