GNU Radio 3.7.3 C++ API
lms_dd_equalizer_cc.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2011,2012 Free Software Foundation, Inc.
4  *
5  * This file is part of GNU Radio
6  *
7  * GNU Radio is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation; either version 3, or (at your option)
10  * any later version.
11  *
12  * GNU Radio is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with GNU Radio; see the file COPYING. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 #ifndef INCLUDED_DIGITAL_LMS_DD_EQUALIZER_CC_H
24 #define INCLUDED_DIGITAL_LMS_DD_EQUALIZER_CC_H
25 
26 #include <gnuradio/digital/api.h>
29 
30 namespace gr {
31  namespace digital {
32 
33  /*!
34  * \brief Least-Mean-Square Decision Directed Equalizer (complex in/out)
35  * \ingroup equalizers_blk
36  *
37  * \details
38  * This block implements an LMS-based decision-directed equalizer.
39  * It uses a set of weights, w, to correlate against the inputs,
40  * u, and a decisions is then made from this output. The error in
41  * the decision is used to update the weight vector.
42  *
43  * y[n] = conj(w[n]) u[n]
44  * d[n] = decision(y[n])
45  * e[n] = d[n] - y[n]
46  * w[n+1] = w[n] + mu u[n] conj(e[n])
47  *
48  * Where mu is a gain value (between 0 and 1 and usualy small,
49  * around 0.001 - 0.01.
50  *
51  * This block uses the digital_constellation object for making the
52  * decision from y[n]. Create the constellation object for
53  * whatever constellation is to be used and pass in the object.
54  * In Python, you can use something like:
55  *
56  * self.constellation = digital.constellation_qpsk()
57  *
58  * To create a QPSK constellation (see the digital_constellation
59  * block for more details as to what constellations are available
60  * or how to create your own). You then pass the object to this
61  * block as an sptr, or using "self.constellation.base()".
62  *
63  * The theory for this algorithm can be found in Chapter 9 of:
64  * S. Haykin, Adaptive Filter Theory, Upper Saddle River, NJ:
65  * Prentice Hall, 1996.
66  */
68  virtual public sync_decimator
69  {
70  protected:
71  virtual gr_complex error(const gr_complex &out) = 0;
72  virtual void update_tap(gr_complex &tap, const gr_complex &in) = 0;
73 
74  public:
75  // gr::digital::lms_dd_equalizer_cc::sptr
77 
78  /*!
79  * Make an LMS decision-directed equalizer
80  *
81  * \param num_taps Numer of taps in the equalizer (channel size)
82  * \param mu Gain of the update loop
83  * \param sps Number of samples per symbol of the input signal
84  * \param cnst A constellation derived from class
85  * 'constellation'. Use base() method to get a shared pointer to
86  * this base class type.
87  */
88  static sptr make(int num_taps,
89  float mu, int sps,
90  constellation_sptr cnst);
91 
92  virtual void set_taps(const std::vector<gr_complex> &taps) = 0;
93  virtual std::vector<gr_complex> taps() const = 0;
94  virtual float gain() const = 0;
95  virtual void set_gain(float mu) = 0;
96  };
97 
98  } /* namespace digital */
99 } /* namespace gr */
100 
101 #endif /* INCLUDED_DIGITAL_LMS_DD_EQUALIZER_CC_H */
#define DIGITAL_API
Definition: gr-digital/include/gnuradio/digital/api.h:30
Least-Mean-Square Decision Directed Equalizer (complex in/out)
Definition: lms_dd_equalizer_cc.h:67
shared_ptr documentation stub
Definition: shared_ptr_docstub.h:15
std::complex< float > gr_complex
Definition: gr_complex.h:27
synchronous N:1 input to output with historyOverride work to provide the signal processing implementa...
Definition: sync_decimator.h:37
static const float taps[NSTEPS+1][NTAPS]
Definition: interpolator_taps.h:9
boost::shared_ptr< lms_dd_equalizer_cc > sptr
Definition: lms_dd_equalizer_cc.h:76