GNU Radio Manual and C++ API Reference  v3.9.2.0-89-gb7c7001e
The Free & Open Software Radio Ecosystem
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  * SPDX-License-Identifier: GPL-3.0-or-later
8  *
9  */
10 
11 #ifndef INCLUDED_DIGITAL_LMS_DD_EQUALIZER_CC_H
12 #define INCLUDED_DIGITAL_LMS_DD_EQUALIZER_CC_H
13 
14 #include <gnuradio/digital/api.h>
17 
18 namespace gr {
19 namespace digital {
20 
21 /*!
22  * \brief Least-Mean-Square Decision Directed Equalizer (complex in/out)
23  * \ingroup equalizers_blk
24  * \ingroup deprecated_blk
25  *
26  * \details
27  * This block implements an LMS-based decision-directed equalizer.
28  * It uses a set of weights, w, to correlate against the inputs,
29  * u, and a decisions is then made from this output. The error in
30  * the decision is used to update the weight vector.
31  *
32  * y[n] = conj(w[n]) u[n]
33  * d[n] = decision(y[n])
34  * e[n] = d[n] - y[n]
35  * w[n+1] = w[n] + mu u[n] conj(e[n])
36  *
37  * Where mu is a gain value (between 0 and 1 and usually small,
38  * around 0.001 - 0.01.
39  *
40  * This block uses the digital_constellation object for making the
41  * decision from y[n]. Create the constellation object for
42  * whatever constellation is to be used and pass in the object.
43  * In Python, you can use something like:
44  *
45  * self.constellation = digital.constellation_qpsk()
46  *
47  * To create a QPSK constellation (see the digital_constellation
48  * block for more details as to what constellations are available
49  * or how to create your own). You then pass the object to this
50  * block as an sptr, or using "self.constellation.base()".
51  *
52  * The theory for this algorithm can be found in Chapter 9 of:
53  * S. Haykin, Adaptive Filter Theory, Upper Saddle River, NJ:
54  * Prentice Hall, 1996.
55  */
57 {
58 protected:
59  virtual gr_complex error(const gr_complex& out) = 0;
60  virtual void update_tap(gr_complex& tap, const gr_complex& in) = 0;
61 
62 public:
63  // gr::digital::lms_dd_equalizer_cc::sptr
64  typedef std::shared_ptr<lms_dd_equalizer_cc> sptr;
65 
66  /*!
67  * Make an LMS decision-directed equalizer
68  *
69  * \param num_taps Number of taps in the equalizer (channel size)
70  * \param mu Gain of the update loop
71  * \param sps Number of samples per symbol of the input signal
72  * \param cnst A constellation derived from class
73  * 'constellation'. Use base() method to get a shared pointer to
74  * this base class type.
75  */
76  static sptr make(int num_taps, float mu, int sps, constellation_sptr cnst);
77 
78  virtual void set_taps(const std::vector<gr_complex>& taps) = 0;
79  virtual std::vector<gr_complex> taps() const = 0;
80  virtual float gain() const = 0;
81  virtual void set_gain(float mu) = 0;
82 };
83 
84 } /* namespace digital */
85 } /* namespace gr */
86 
87 #endif /* INCLUDED_DIGITAL_LMS_DD_EQUALIZER_CC_H */
Least-Mean-Square Decision Directed Equalizer (complex in/out)
Definition: lms_dd_equalizer_cc.h:57
std::shared_ptr< lms_dd_equalizer_cc > sptr
Definition: lms_dd_equalizer_cc.h:64
virtual gr_complex error(const gr_complex &out)=0
virtual void set_gain(float mu)=0
virtual float gain() const =0
virtual void set_taps(const std::vector< gr_complex > &taps)=0
static sptr make(int num_taps, float mu, int sps, constellation_sptr cnst)
virtual std::vector< gr_complex > taps() const =0
virtual void update_tap(gr_complex &tap, const gr_complex &in)=0
synchronous N:1 input to output with history
Definition: sync_decimator.h:26
#define DIGITAL_API
Definition: gr-digital/include/gnuradio/digital/api.h:18
std::complex< float > gr_complex
Definition: gr_complex.h:15
static constexpr float taps[NSTEPS+1][NTAPS]
Definition: interpolator_taps.h:9
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition: basic_block.h:29