GNU Radio Manual and C++ API Reference  3.8.1.0
The Free & Open Software Radio Ecosystem
chunks_to_symbols.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2004,2012,2018 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 CHUNKS_TO_SYMBOLS_H
24 #define CHUNKS_TO_SYMBOLS_H
25 
26 #include <gnuradio/digital/api.h>
28 #include <cstdint>
29 
30 namespace gr {
31 namespace digital {
32 
33 /*!
34  * \brief Map a stream of unpacked symbol indexes to stream of
35  * float or complex constellation points in D dimensions (D = 1 by
36  * default) \ingroup converter_blk
37  *
38  * \details
39  * \li input: stream of IN_T
40  * \li output: stream of OUT_T
41  *
42  * \li out[n D + k] = symbol_table[in[n] D + k], k=0,1,...,D-1
43  *
44  * The combination of gr::blocks::packed_to_unpacked_XX followed
45  * by gr::digital::chunks_to_symbols_XY handles the general case
46  * of mapping from a stream of bytes or shorts into arbitrary
47  * float or complex symbols.
48  *
49  * \sa gr::blocks::packed_to_unpacked_bb, gr::blocks::unpacked_to_packed_bb,
50  * \sa gr::blocks::packed_to_unpacked_ss, gr::blocks::unpacked_to_packed_ss,
51  * \sa gr::digital::chunks_to_symbols_bf, gr::digital::chunks_to_symbols_bc.
52  * \sa gr::digital::chunks_to_symbols_sf, gr::digital::chunks_to_symbols_sc.
53  */
54 template <class IN_T, class OUT_T>
56 {
57 public:
58  typedef boost::shared_ptr<chunks_to_symbols<IN_T, OUT_T>> sptr;
59 
60  /*!
61  * Make a chunks-to-symbols block.
62  *
63  * \param symbol_table: list that maps chunks to symbols.
64  * \param D: dimension of table.
65  */
66  static sptr make(const std::vector<OUT_T>& symbol_table, const int D = 1);
67 
68  virtual int D() const = 0;
69  virtual std::vector<OUT_T> symbol_table() const = 0;
70  virtual void set_symbol_table(const std::vector<OUT_T>& symbol_table) = 0;
71 };
72 
79 } /* namespace digital */
80 } /* namespace gr */
81 
82 #endif /* CHUNKS_TO_SYMBOLS_H */
chunks_to_symbols< std::int32_t, float > chunks_to_symbols_if
Definition: chunks_to_symbols.h:77
chunks_to_symbols< std::int16_t, gr_complex > chunks_to_symbols_sc
Definition: chunks_to_symbols.h:76
chunks_to_symbols< std::int32_t, gr_complex > chunks_to_symbols_ic
Definition: chunks_to_symbols.h:78
#define DIGITAL_API
Definition: gr-digital/include/gnuradio/digital/api.h:30
boost::shared_ptr< chunks_to_symbols< IN_T, OUT_T > > sptr
Definition: chunks_to_symbols.h:58
chunks_to_symbols< std::int16_t, float > chunks_to_symbols_sf
Definition: chunks_to_symbols.h:75
synchronous 1:N input to output with historyOverride work to provide the signal processing implementa...
Definition: sync_interpolator.h:37
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition: basic_block.h:43
Map a stream of unpacked symbol indexes to stream of float or complex constellation points in D dimen...
Definition: chunks_to_symbols.h:55
chunks_to_symbols< std::uint8_t, float > chunks_to_symbols_bf
Definition: chunks_to_symbols.h:73
chunks_to_symbols< std::uint8_t, gr_complex > chunks_to_symbols_bc
Definition: chunks_to_symbols.h:74