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