GNU Radio Manual and C++ API Reference  3.8.1.0
The Free & Open Software Radio Ecosystem
ofdm_equalizer_simpledfe.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_SIMPLEDFE_H
23 #define INCLUDED_DIGITAL_OFDM_EQUALIZER_SIMPLEDFE_H
24 
25 #include <gnuradio/digital/api.h>
28 
29 namespace gr {
30 namespace digital {
31 
32 /*!
33  * \brief Simple decision feedback equalizer for OFDM.
34  * \ingroup ofdm_blk
35  * \ingroup equalizers_blk
36  *
37  * \details
38  * Equalizes an OFDM signal symbol by symbol using knowledge of the
39  * complex modulations symbols.
40  * For every symbol, the following steps are performed:
41  * - On every sub-carrier, decode the modulation symbol
42  * - Use the difference between the decoded symbol and the received symbol
43  * to update the channel state on this carrier
44  * - Whenever a pilot symbol is found, it uses the known pilot symbol to
45  * update the channel state.
46  *
47  * This equalizer makes a lot of assumptions:
48  * - The initial channel state is good enough to decode the first
49  * symbol without error (unless the first symbol only consists of pilot
50  * tones)
51  * - The channel changes only very slowly, such that the channel state
52  * from one symbol is enough to decode the next
53  * - SNR low enough that equalization will always suffice to correctly
54  * decode a symbol
55  * If these assumptions are not met, the most common error is that the
56  * channel state is estimated incorrectly during equalization; after that,
57  * all subsequent symbols will be completely wrong.
58  *
59  * Note that the equalized symbols are *exact points* on the constellation.
60  * This means soft information of the modulation symbols is lost after the
61  * equalization, which is suboptimal for channel codes that use soft decision.
62  *
63  */
65 {
66 public:
67  typedef boost::shared_ptr<ofdm_equalizer_simpledfe> sptr;
68 
69  ofdm_equalizer_simpledfe(int fft_len,
70  const gr::digital::constellation_sptr& constellation,
71  const std::vector<std::vector<int>>& occupied_carriers =
72  std::vector<std::vector<int>>(),
73  const std::vector<std::vector<int>>& pilot_carriers =
74  std::vector<std::vector<int>>(),
75  const std::vector<std::vector<gr_complex>>& pilot_symbols =
76  std::vector<std::vector<gr_complex>>(),
77  int symbols_skipped = 0,
78  float alpha = 0.1,
79  bool input_is_shifted = true);
80 
82 
83  void equalize(gr_complex* frame,
84  int n_sym,
85  const std::vector<gr_complex>& initial_taps = std::vector<gr_complex>(),
86  const std::vector<tag_t>& tags = std::vector<tag_t>());
87 
88  /*
89  * \param fft_len FFT length
90  * \param constellation The constellation object describing the modulation used
91  * on the subcarriers (e.g. QPSK). This is used to decode
92  * the individual symbols.
93  * \param occupied_carriers List of occupied carriers, see ofdm_carrier_allocator
94  * for a description.
95  * \param pilot_carriers Position of pilot symbols, see ofdm_carrier_allocator
96  * for a description.
97  * \param pilot_symbols Value of pilot symbols, see ofdm_carrier_allocator
98  * for a description.
99  * \param alpha Averaging coefficient (in a nutshell, if \f$H_{i,k}\f$ is the channel
100  * state for carrier i and symbol k,
101  * \f$H_{i,k+1} = \alpha H_{i,k} + (1 - \alpha) H_{i,k+1}\f$. Make this
102  * larger if there's more noise, but keep in mind that larger values
103  * of alpha mean slower response to channel changes).
104  * \param symbols_skipped Starting position within occupied_carriers and
105  * pilot_carriers. If the first symbol of the frame was removed (e.g. to decode the
106  * header), set this make sure the pilot symbols are correctly
107  * identified.
108  * \param input_is_shifted Set this to false if the input signal is not shifted, i.e.
109  * the first input items is on the DC carrier.
110  * Note that a lot of the OFDM receiver blocks operate on
111  * shifted signals!
112  */
113  static sptr make(int fft_len,
114  const gr::digital::constellation_sptr& constellation,
115  const std::vector<std::vector<int>>& occupied_carriers =
116  std::vector<std::vector<int>>(),
117  const std::vector<std::vector<int>>& pilot_carriers =
118  std::vector<std::vector<int>>(),
119  const std::vector<std::vector<gr_complex>>& pilot_symbols =
120  std::vector<std::vector<gr_complex>>(),
121  int symbols_skipped = 0,
122  float alpha = 0.1,
123  bool input_is_shifted = true);
124 
125 private:
126  gr::digital::constellation_sptr d_constellation;
127  //! Averaging coefficient
128  float d_alpha;
129 };
130 
131 } /* namespace digital */
132 } /* namespace gr */
133 
134 #endif /* INCLUDED_DIGITAL_OFDM_EQUALIZER_SIMPLEDFE_H */
An abstracted constellation object.
Definition: constellation.h:62
#define DIGITAL_API
Definition: gr-digital/include/gnuradio/digital/api.h:30
std::complex< float > gr_complex
Definition: gr_complex.h:27
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition: basic_block.h:43
boost::shared_ptr< ofdm_equalizer_simpledfe > sptr
Definition: ofdm_equalizer_simpledfe.h:67
Simple decision feedback equalizer for OFDM.
Definition: ofdm_equalizer_simpledfe.h:64
Definition: ofdm_equalizer_base.h:69