GNU Radio 3.6.5 C++ API

digital_ofdm_equalizer_simpledfe.h

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