GNU Radio 3.7.1 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_SIMPLEDFE_H 00023 #define INCLUDED_DIGITAL_OFDM_EQUALIZER_SIMPLEDFE_H 00024 00025 #include <gnuradio/digital/api.h> 00026 #include <gnuradio/digital/constellation.h> 00027 #include <gnuradio/digital/ofdm_equalizer_base.h> 00028 00029 namespace gr { 00030 namespace digital { 00031 00032 /* \brief Simple decision feedback equalizer for OFDM. 00033 * \ingroup ofdm_blk 00034 * \ingroup equalizers_blk 00035 * 00036 * \details 00037 * Equalizes an OFDM signal symbol by symbol using knowledge of the 00038 * complex modulations symbols. 00039 * For every symbol, the following steps are performed: 00040 * - On every sub-carrier, decode the modulation symbol 00041 * - Use the difference between the decoded symbol and the received symbol 00042 * to update the channel state on this carrier 00043 * - Whenever a pilot symbol is found, it uses the known pilot symbol to 00044 * update the channel state. 00045 * 00046 * This equalizer makes a lot of assumptions: 00047 * - The initial channel state is good enough to decode the first 00048 * symbol without error (unless the first symbol only consists of pilot 00049 * tones) 00050 * - The channel changes only very slowly, such that the channel state 00051 * from one symbol is enough to decode the next 00052 * - SNR low enough that equalization will always suffice to correctly 00053 * decode a symbol 00054 * If these assumptions are not met, the most common error is that the 00055 * channel state is estimated incorrectly during equalization; after that, 00056 * all subsequent symbols will be completely wrong. 00057 * 00058 * Note that the equalized symbols are *exact points* on the constellation. 00059 * This means soft information of the modulation symbols is lost after the 00060 * equalization, which is suboptimal for channel codes that use soft decision. 00061 * 00062 */ 00063 class DIGITAL_API ofdm_equalizer_simpledfe : public ofdm_equalizer_1d_pilots 00064 { 00065 public: 00066 typedef boost::shared_ptr<ofdm_equalizer_simpledfe> sptr; 00067 00068 ofdm_equalizer_simpledfe( 00069 int fft_len, 00070 const gr::digital::constellation_sptr &constellation, 00071 const std::vector<std::vector<int> > &occupied_carriers = std::vector<std::vector<int> >(), 00072 const std::vector<std::vector<int> > &pilot_carriers = std::vector<std::vector<int> >(), 00073 const std::vector<std::vector<gr_complex> > &pilot_symbols = std::vector<std::vector<gr_complex> >(), 00074 int symbols_skipped = 0, 00075 float alpha = 0.1, 00076 bool input_is_shifted = true); 00077 00078 ~ofdm_equalizer_simpledfe(); 00079 00080 void equalize(gr_complex *frame, 00081 int n_sym, 00082 const std::vector<gr_complex> &initial_taps = std::vector<gr_complex>(), 00083 const std::vector<tag_t> &tags = std::vector<tag_t>()); 00084 00085 /* 00086 * \param fft_len FFT length 00087 * \param constellation The constellation object describing the modulation used 00088 * on the subcarriers (e.g. QPSK). This is used to decode 00089 * the individual symbols. 00090 * \param occupied_carriers List of occupied carriers, see ofdm_carrier_allocator 00091 * for a description. 00092 * \param pilot_carriers Position of pilot symbols, see ofdm_carrier_allocator 00093 * for a description. 00094 * \param pilot_symbols Value of pilot symbols, see ofdm_carrier_allocator 00095 * for a description. 00096 * \param alpha Averaging coefficient (in a nutshell, if \f$H_{i,k}\f$ is the channel 00097 * state for carrier i and symbol k, 00098 * \f$H_{i,k+1} = \alpha H_{i,k} + (1 - \alpha) H_{i,k+1}\f$. Make this 00099 * larger if there's more noise, but keep in mind that larger values 00100 * of alpha mean slower response to channel changes). 00101 * \param symbols_skipped Starting position within occupied_carriers and pilot_carriers. 00102 * If the first symbol of the frame was removed (e.g. to decode the 00103 * header), set this make sure the pilot symbols are correctly 00104 * identified. 00105 * \param input_is_shifted Set this to false if the input signal is not shifted, i.e. 00106 * the first input items is on the DC carrier. 00107 * Note that a lot of the OFDM receiver blocks operate on shifted 00108 * signals! 00109 */ 00110 static sptr make( 00111 int fft_len, 00112 const gr::digital::constellation_sptr &constellation, 00113 const std::vector<std::vector<int> > &occupied_carriers = std::vector<std::vector<int> >(), 00114 const std::vector<std::vector<int> > &pilot_carriers = std::vector<std::vector<int> >(), 00115 const std::vector<std::vector<gr_complex> > &pilot_symbols = std::vector<std::vector<gr_complex> >(), 00116 int symbols_skipped=0, 00117 float alpha=0.1, 00118 bool input_is_shifted=true 00119 ); 00120 00121 private: 00122 gr::digital::constellation_sptr d_constellation; 00123 //! Averaging coefficient 00124 float d_alpha; 00125 }; 00126 00127 } /* namespace digital */ 00128 } /* namespace gr */ 00129 00130 #endif /* INCLUDED_DIGITAL_OFDM_EQUALIZER_SIMPLEDFE_H */ 00131