GNU Radio Manual and C++ API Reference  3.8.1.0
The Free & Open Software Radio Ecosystem
ofdm_equalizer_base.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /* Copyright 2012 Free Software Foundation, Inc.
3  *
4  * This file is part of GNU Radio
5  *
6  * GNU Radio is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 3, or (at your option)
9  * any later version.
10  *
11  * GNU Radio is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with GNU Radio; see the file COPYING. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street,
19  * Boston, MA 02110-1301, USA.
20  */
21 
22 #ifndef INCLUDED_DIGITAL_OFDM_EQUALIZER_BASE_H
23 #define INCLUDED_DIGITAL_OFDM_EQUALIZER_BASE_H
24 
25 #include <gnuradio/digital/api.h>
26 #include <gnuradio/gr_complex.h>
27 #include <gnuradio/tags.h>
28 #include <boost/enable_shared_from_this.hpp>
29 
30 namespace gr {
31 namespace digital {
32 
33 /*!
34  * \brief Base class for implementation details of frequency-domain OFDM equalizers.
35  * \ingroup ofdm_blk
36  * \ingroup equalizers_blk
37  */
39  : public boost::enable_shared_from_this<ofdm_equalizer_base>
40 {
41 protected:
42  int d_fft_len;
43 
44 public:
45  typedef boost::shared_ptr<ofdm_equalizer_base> sptr;
46 
47  ofdm_equalizer_base(int fft_len);
48  virtual ~ofdm_equalizer_base();
49 
50  //! Reset the channel information state knowledge
51  virtual void reset() = 0;
52  //! Run the actual equalization
53  virtual void
54  equalize(gr_complex* frame,
55  int n_sym,
56  const std::vector<gr_complex>& initial_taps = std::vector<gr_complex>(),
57  const std::vector<tag_t>& tags = std::vector<tag_t>()) = 0;
58  //! Return the current channel state
59  virtual void get_channel_state(std::vector<gr_complex>& taps) = 0;
60  int fft_len() { return d_fft_len; };
61  sptr base() { return shared_from_this(); };
62 };
63 
64 
65 /* \brief Base class for implementation details of 1-dimensional OFDM FDEs which use pilot
66  * tones. \ingroup digital
67  *
68  */
70 {
71 protected:
72  //! If \p d_occupied_carriers[k][l] is true, symbol k, carrier l is carrying data.
73  // (this is a different format than occupied_carriers!)
74  std::vector<bool> d_occupied_carriers;
75  //! If \p d_pilot_carriers[k][l] is true, symbol k, carrier l is carrying data.
76  // (this is a different format than pilot_carriers!)
77  std::vector<std::vector<bool>> d_pilot_carriers;
78  //! If \p d_pilot_carriers[k][l] is true, d_pilot_symbols[k][l] is its tx'd value.
79  // (this is a different format than pilot_symbols!)
80  std::vector<std::vector<gr_complex>> d_pilot_symbols;
81  //! In case the frame doesn't begin with OFDM symbol 0, this is the index of the first
82  //! symbol
84  //! The current position in the set of pilot symbols
86  //! Vector of length d_fft_len saving the current channel state (on the occupied
87  //! carriers)
88  std::vector<gr_complex> d_channel_state;
89 
90 public:
91  typedef boost::shared_ptr<ofdm_equalizer_1d_pilots> sptr;
92 
93  ofdm_equalizer_1d_pilots(int fft_len,
94  const std::vector<std::vector<int>>& occupied_carriers,
95  const std::vector<std::vector<int>>& pilot_carriers,
96  const std::vector<std::vector<gr_complex>>& pilot_symbols,
97  int symbols_skipped,
98  bool input_is_shifted);
100 
101  void reset();
102  void get_channel_state(std::vector<gr_complex>& taps);
103 };
104 
105 } /* namespace digital */
106 } /* namespace gr */
107 
108 #endif /* INCLUDED_DIGITAL_OFDM_EQUALIZER_BASE_H */
std::vector< gr_complex > d_channel_state
Vector of length d_fft_len saving the current channel state (on the occupied carriers) ...
Definition: ofdm_equalizer_base.h:88
std::vector< std::vector< bool > > d_pilot_carriers
If d_pilot_carriers[k][l] is true, symbol k, carrier l is carrying data.
Definition: ofdm_equalizer_base.h:77
#define DIGITAL_API
Definition: gr-digital/include/gnuradio/digital/api.h:30
std::vector< bool > d_occupied_carriers
If d_occupied_carriers[k][l] is true, symbol k, carrier l is carrying data.
Definition: ofdm_equalizer_base.h:74
std::vector< std::vector< gr_complex > > d_pilot_symbols
If d_pilot_carriers[k][l] is true, d_pilot_symbols[k][l] is its tx&#39;d value.
Definition: ofdm_equalizer_base.h:80
int d_pilot_carr_set
The current position in the set of pilot symbols.
Definition: ofdm_equalizer_base.h:85
std::complex< float > gr_complex
Definition: gr_complex.h:27
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition: basic_block.h:43
boost::shared_ptr< ofdm_equalizer_base > sptr
Definition: ofdm_equalizer_base.h:45
boost::shared_ptr< ofdm_equalizer_1d_pilots > sptr
Definition: ofdm_equalizer_base.h:91
sptr base()
Definition: ofdm_equalizer_base.h:61
static const float taps[NSTEPS+1][NTAPS]
Definition: interpolator_taps.h:9
Base class for implementation details of frequency-domain OFDM equalizers.
Definition: ofdm_equalizer_base.h:38
Definition: ofdm_equalizer_base.h:69
int fft_len()
Definition: ofdm_equalizer_base.h:60
int d_symbols_skipped
In case the frame doesn&#39;t begin with OFDM symbol 0, this is the index of the first symbol...
Definition: ofdm_equalizer_base.h:83
int d_fft_len
Definition: ofdm_equalizer_base.h:42