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