GNU Radio Manual and C++ API Reference 3.10.5.1
The Free & Open Software Radio Ecosystem
linear_equalizer.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2020 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_LINEAR_EQUALIZER_H
12#define INCLUDED_DIGITAL_LINEAR_EQUALIZER_H
13
18
19#include <string>
20#include <vector>
21
22namespace gr {
23namespace digital {
24
25/*!
26 * \brief Linear Equalizer block provides linear equalization using a specified adaptive
27 * algorithm \ingroup equalizers
28 *
29 */
31{
32
33public:
34 typedef std::shared_ptr<linear_equalizer> sptr;
35
36 /*!
37 * \brief Return a shared_ptr to a new instance of
38 * gr::digital::linear_equalizer.
39 *
40 * The Linear Equalizer block equalizes the incoming signal using an FIR filter.
41 * If provided with a training sequence and a training start tag, data aided
42 * equalization will be performed starting with the tagged sample. If training-based
43 * equalization is active and the training sequence ends, then optionally decision
44 * directed equalization will be performed given the adapt_after_training If no
45 * training sequence or no tag is provided, decision directed equalization will be
46 * performed
47 * This equalizer decimates to the symbol rate according to the samples per symbol
48 * param
49 *
50 * \param num_taps Number of taps for the FIR filter
51 * \param sps int - Samples per Symbol
52 * \param alg Adaptive algorithm object
53 * \param training_sequence Sequence of samples that will be used to train the
54 * equalizer. Provide empty vector to default to DD equalizer
55 * \param adapt_after_training bool - set true to continue DD training after training
56 * sequence has been used up
57 * \param training_start_tag string - tag that indicates the start
58 * of the training sequence in the incoming data
59 */
60 static sptr
61 make(unsigned num_taps,
62 unsigned sps,
63 adaptive_algorithm_sptr alg,
64 bool adapt_after_training = true,
65 std::vector<gr_complex> training_sequence = std::vector<gr_complex>(),
66 const std::string& training_start_tag = "");
67
68 virtual void set_taps(const std::vector<gr_complex>& taps) = 0;
69 virtual std::vector<gr_complex> taps() const = 0;
70
71 /*!
72 * \brief Public "work" function - equalize a block of input samples
73 * \details Behaves similar to the block's work function, but made public
74 * to be able to be called outside the GNU Radio scheduler on bursty data
75 * \param input_samples Buffer of input samples to equalize
76 * \param output_symbols Buffer of output symbols post equalization
77 * \param num_inputs Number of input samples provided
78 * \param max_num_outputs Size of output_symbols buffer to write into
79 * \param training_start_samples Vector of starting positions of training sequences
80 * within the input_samples buffer
81 * \param history_included Flag to indicate whether history has been provided at
82 * the beginning of the input_samples buffer, as would normally be provided in a
83 * work() call. The work() function of this block sets this to true, but in bursty
84 * operation, this should be set to false
85 * \param taps Optional output vector buffer of tap weights calculated at
86 * each sample of the output
87 * \param state Optional output state of the equalizer for debug {IDLE,
88 * TRAINING, DD}
89 */
90 virtual int equalize(
91 const gr_complex* input_samples,
92 gr_complex* output_symbols,
93 unsigned int num_inputs,
94 unsigned int max_num_outputs,
95 std::vector<unsigned int> training_start_samples = std::vector<unsigned int>(0),
96 bool history_included = false,
97 gr_complex* taps = nullptr,
98 unsigned short* state = nullptr) = 0;
99};
100
101} // namespace digital
102} // namespace gr
103
104#endif /* INCLUDED_DIGITAL_LINEAR_EQUALIZER_H */
Linear Equalizer block provides linear equalization using a specified adaptive algorithm.
Definition: linear_equalizer.h:31
std::shared_ptr< linear_equalizer > sptr
Definition: linear_equalizer.h:34
virtual void set_taps(const std::vector< gr_complex > &taps)=0
virtual int equalize(const gr_complex *input_samples, gr_complex *output_symbols, unsigned int num_inputs, unsigned int max_num_outputs, std::vector< unsigned int > training_start_samples=std::vector< unsigned int >(0), bool history_included=false, gr_complex *taps=nullptr, unsigned short *state=nullptr)=0
Public "work" function - equalize a block of input samples.
virtual std::vector< gr_complex > taps() const =0
static sptr make(unsigned num_taps, unsigned sps, adaptive_algorithm_sptr alg, bool adapt_after_training=true, std::vector< gr_complex > training_sequence=std::vector< gr_complex >(), const std::string &training_start_tag="")
Return a shared_ptr to a new instance of gr::digital::linear_equalizer.
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.
Definition: basic_block.h:29