GNU Radio 3.6.5 C++ API
|
00001 /* -*- c++ -*- */ 00002 /* Copyright 2012 Free Software Foundation, Inc. 00003 * 00004 * This file is part of GNU Radio 00005 * 00006 * GNU Radio is free software; you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation; either version 3, or (at your option) 00009 * any later version. 00010 * 00011 * GNU Radio is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with GNU Radio; see the file COPYING. If not, write to 00018 * the Free Software Foundation, Inc., 51 Franklin Street, 00019 * Boston, MA 02110-1301, USA. 00020 */ 00021 00022 #ifndef INCLUDED_DIGITAL_OFDM_EQUALIZER_BASE_H 00023 #define INCLUDED_DIGITAL_OFDM_EQUALIZER_BASE_H 00024 00025 #include <digital_api.h> 00026 #include <gr_tags.h> 00027 #include <gr_complex.h> 00028 #include <boost/enable_shared_from_this.hpp> 00029 00030 class digital_ofdm_equalizer_base; 00031 typedef boost::shared_ptr<digital_ofdm_equalizer_base> digital_ofdm_equalizer_base_sptr; 00032 00033 class digital_ofdm_equalizer_1d_pilots; 00034 typedef boost::shared_ptr<digital_ofdm_equalizer_1d_pilots> digital_ofdm_equalizer_1d_pilots_sptr; 00035 00036 /* \brief Base class for implementation details of frequency-domain OFDM equalizers. 00037 * \ingroup ofdm_blk 00038 * \ingroup equalizers_blk 00039 * 00040 */ 00041 class DIGITAL_API digital_ofdm_equalizer_base : public boost::enable_shared_from_this<digital_ofdm_equalizer_base> 00042 { 00043 protected: 00044 int d_fft_len; 00045 00046 public: 00047 digital_ofdm_equalizer_base(int fft_len); 00048 ~digital_ofdm_equalizer_base(); 00049 00050 virtual void reset() = 0; 00051 virtual void equalize( 00052 gr_complex *frame, 00053 int n_sym, 00054 const std::vector<gr_complex> &initial_taps = std::vector<gr_complex>(), 00055 const std::vector<gr_tag_t> &tags = std::vector<gr_tag_t>()) = 0; 00056 virtual void get_channel_state(std::vector<gr_complex> &taps) = 0; 00057 int fft_len() { return d_fft_len; }; 00058 digital_ofdm_equalizer_base_sptr base() { return shared_from_this(); }; 00059 }; 00060 00061 00062 /* \brief Base class for implementation details of 1-dimensional OFDM FDEs which use pilot tones. 00063 * \ingroup digital 00064 * 00065 */ 00066 class DIGITAL_API digital_ofdm_equalizer_1d_pilots : public digital_ofdm_equalizer_base 00067 { 00068 protected: 00069 //! If \p d_occupied_carriers[k][l] is true, symbol k, carrier l is carrying data. 00070 // (this is a different format than occupied_carriers!) 00071 std::vector<bool> d_occupied_carriers; 00072 //! If \p d_pilot_carriers[k][l] is true, symbol k, carrier l is carrying a pilot symbol. 00073 // (this is a different format than pilot_carriers!) 00074 std::vector<std::vector<bool> > d_pilot_carriers; 00075 //! If \p d_pilot_carriers[k][l] is true, d_pilot_symbols[k][l] is its tx'd value. 00076 // (this is a different format than pilot_symbols!) 00077 std::vector<std::vector<gr_complex> > d_pilot_symbols; 00078 //! In case the frame doesn't begin with OFDM symbol 0, this is the index of the first symbol 00079 int d_symbols_skipped; 00080 //! The current position in the set of pilot symbols 00081 int d_pilot_carr_set; 00082 //! Vector of length d_fft_len saving the current channel state (on the occupied carriers) 00083 std::vector<gr_complex> d_channel_state; 00084 00085 public: 00086 digital_ofdm_equalizer_1d_pilots( 00087 int fft_len, 00088 const std::vector<std::vector<int> > &occupied_carriers, 00089 const std::vector<std::vector<int> > &pilot_carriers, 00090 const std::vector<std::vector<gr_complex> > &pilot_symbols, 00091 int symbols_skipped, 00092 bool input_is_shifted); 00093 ~digital_ofdm_equalizer_1d_pilots(); 00094 00095 void reset(); 00096 void get_channel_state(std::vector<gr_complex> &taps); 00097 }; 00098 00099 #endif /* INCLUDED_DIGITAL_OFDM_EQUALIZER_BASE_H */ 00100