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