GNU Radio 3.7.1 C++ API
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/tags.h>
27 #include <gnuradio/gr_complex.h>
28 #include <boost/enable_shared_from_this.hpp>
29 
30 namespace gr {
31  namespace digital {
32 
33  /* \brief Base class for implementation details of frequency-domain OFDM equalizers.
34  * \ingroup ofdm_blk
35  * \ingroup equalizers_blk
36  */
38  : public boost::enable_shared_from_this<ofdm_equalizer_base>
39  {
40  protected:
41  int d_fft_len;
43 
44  public:
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  //! Set the carrier offset in integer multiples
53  void set_carrier_offset(int offset) { d_carr_offset = offset; };
54  virtual void equalize(
55  gr_complex *frame,
56  int n_sym,
57  const std::vector<gr_complex> &initial_taps = std::vector<gr_complex>(),
58  const std::vector<tag_t> &tags = std::vector<tag_t>()) = 0;
59  //! Return the current channel state
60  virtual void get_channel_state(std::vector<gr_complex> &taps) = 0;
61  int fft_len() { return d_fft_len; };
62  sptr base() { return shared_from_this(); };
63  };
64 
65 
66  /* \brief Base class for implementation details of 1-dimensional OFDM FDEs which use pilot tones.
67  * \ingroup digital
68  *
69  */
71  {
72  protected:
73  //! If \p d_occupied_carriers[k][l] is true, symbol k, carrier l is carrying data.
74  // (this is a different format than occupied_carriers!)
75  std::vector<bool> d_occupied_carriers;
76  //! If \p d_pilot_carriers[k][l] is true, symbol k, carrier l is carrying data.
77  // (this is a different format than pilot_carriers!)
78  std::vector<std::vector<bool> > d_pilot_carriers;
79  //! If \p d_pilot_carriers[k][l] is true, d_pilot_symbols[k][l] is its tx'd value.
80  // (this is a different format than pilot_symbols!)
81  std::vector<std::vector<gr_complex> > d_pilot_symbols;
82  //! In case the frame doesn't begin with OFDM symbol 0, this is the index of the first 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 carriers)
87  std::vector<gr_complex> d_channel_state;
88 
89  public:
91 
93  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 */
109