GNU Radio 3.6.5.1 C++ API
digital_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 <digital_api.h>
26 #include <gr_tags.h>
27 #include <gr_complex.h>
28 #include <boost/enable_shared_from_this.hpp>
29 
32 
35 
36 /* \brief Base class for implementation details of frequency-domain OFDM equalizers.
37  * \ingroup ofdm_blk
38  * \ingroup equalizers_blk
39  *
40  */
41 class DIGITAL_API digital_ofdm_equalizer_base : public boost::enable_shared_from_this<digital_ofdm_equalizer_base>
42 {
43  protected:
44  int d_fft_len;
45 
46  public:
47  digital_ofdm_equalizer_base(int fft_len);
49 
50  virtual void reset() = 0;
51  virtual void equalize(
52  gr_complex *frame,
53  int n_sym,
54  const std::vector<gr_complex> &initial_taps = std::vector<gr_complex>(),
55  const std::vector<gr_tag_t> &tags = std::vector<gr_tag_t>()) = 0;
56  virtual void get_channel_state(std::vector<gr_complex> &taps) = 0;
57  int fft_len() { return d_fft_len; };
58  digital_ofdm_equalizer_base_sptr base() { return shared_from_this(); };
59 };
60 
61 
62 /* \brief Base class for implementation details of 1-dimensional OFDM FDEs which use pilot tones.
63  * \ingroup digital
64  *
65  */
67 {
68  protected:
69  //! If \p d_occupied_carriers[k][l] is true, symbol k, carrier l is carrying data.
70  // (this is a different format than occupied_carriers!)
71  std::vector<bool> d_occupied_carriers;
72  //! If \p d_pilot_carriers[k][l] is true, symbol k, carrier l is carrying a pilot symbol.
73  // (this is a different format than pilot_carriers!)
74  std::vector<std::vector<bool> > d_pilot_carriers;
75  //! If \p d_pilot_carriers[k][l] is true, d_pilot_symbols[k][l] is its tx'd value.
76  // (this is a different format than pilot_symbols!)
77  std::vector<std::vector<gr_complex> > d_pilot_symbols;
78  //! In case the frame doesn't begin with OFDM symbol 0, this is the index of the first symbol
80  //! The current position in the set of pilot symbols
82  //! Vector of length d_fft_len saving the current channel state (on the occupied carriers)
83  std::vector<gr_complex> d_channel_state;
84 
85  public:
87  int fft_len,
88  const std::vector<std::vector<int> > &occupied_carriers,
89  const std::vector<std::vector<int> > &pilot_carriers,
90  const std::vector<std::vector<gr_complex> > &pilot_symbols,
91  int symbols_skipped,
92  bool input_is_shifted);
94 
95  void reset();
96  void get_channel_state(std::vector<gr_complex> &taps);
97 };
98 
99 #endif /* INCLUDED_DIGITAL_OFDM_EQUALIZER_BASE_H */
100