GNU Radio's ADAPT Package

rls_filter_cc.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2019 <+YOU OR YOUR COMPANY+>.
4 *
5 * This is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 3, or (at your option)
8 * any later version.
9 *
10 * This software is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this software; see the file COPYING. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street,
18 * Boston, MA 02110-1301, USA.
19 */
20
21
22#ifndef INCLUDED_ADAPT_RLS_FILTER_CC_H
23#define INCLUDED_ADAPT_RLS_FILTER_CC_H
24
25#include <adapt/api.h>
26#include <gnuradio/sync_decimator.h>
27
28 namespace gr {
29 namespace adapt {
30
31/*!
32 * \brief Recursive Least Squares Adaptive Filter (complex in/out)
33 * \ingroup adapt
34 *
35 * \details
36 * This block implements a RLS-based adaptive filter.
37 */
38 class ADAPT_API rls_filter_cc : virtual public gr::sync_decimator {
39 protected:
40 virtual gr_complex error(const gr_complex& desired, const gr_complex& out) = 0;
41 virtual void update_tap(gr_complex& tap, const gr_complex& in) = 0;
42
43 public:
44 typedef boost::shared_ptr<rls_filter_cc> sptr;
45
46 /*!
47 * Make a RLS adaptive filter
48 *
49 * \param first_input Specifies whether first input is reference or error signal (bool)
50 * \param num_taps Number of taps in the filter (int)
51 * \param delta Regularization factor of the update loop (float)
52 * \param _lambda Forgetting factor of the update loop (float)
53 * \param skip Specifies how many samples are skipped between
54 * successive filter updates (unsigned)
55 * \param decimation Decimation rate of the filter (unsigned)
56 * \param adapt Controls whether filter taps are being updated (bool)
57 * \param reset Reset filter taps (bool)
58 */
59 static sptr make(bool first_input,
60 int num_taps,
61 float delta,
62 float _lambda,
63 unsigned skip,
64 unsigned decimation,
65 bool adapt,
66 bool reset);
67
68 virtual void set_taps(const std::vector<gr_complex>& taps) = 0;
69 virtual const std::vector<gr_complex>& get_taps() = 0;
70 virtual float get_delta() const = 0;
71 virtual void set_delta(float delta) = 0;
72 virtual float get_lambda() const = 0;
73 virtual void set_lambda(float _lambda) = 0;
74 virtual unsigned get_skip() const = 0;
75 virtual void set_skip(unsigned skip) = 0;
76 virtual bool get_adapt() const = 0;
77 virtual void set_adapt(bool adapt) = 0;
78 virtual bool get_reset() const = 0;
79 virtual void set_reset(bool reset) = 0;
80};
81
82} // namespace adapt
83} // namespace gr
84
85#endif /* INCLUDED_ADAPT_RLS_FILTER_CC_H */
api.h
ADAPT_API
#define ADAPT_API
Definition api.h:31
gr::adapt::rls_filter_cc
Recursive Least Squares Adaptive Filter (complex in/out)
Definition rls_filter_cc.h:38
gr::adapt::rls_filter_cc::make
static sptr make(bool first_input, int num_taps, float delta, float _lambda, unsigned skip, unsigned decimation, bool adapt, bool reset)
gr::adapt::rls_filter_cc::get_delta
virtual float get_delta() const =0
gr::adapt::rls_filter_cc::get_lambda
virtual float get_lambda() const =0
gr::adapt::rls_filter_cc::set_adapt
virtual void set_adapt(bool adapt)=0
gr::adapt::rls_filter_cc::sptr
boost::shared_ptr< rls_filter_cc > sptr
Definition rls_filter_cc.h:44
gr::adapt::rls_filter_cc::get_taps
virtual const std::vector< gr_complex > & get_taps()=0
gr::adapt::rls_filter_cc::get_adapt
virtual bool get_adapt() const =0
gr::adapt::rls_filter_cc::set_skip
virtual void set_skip(unsigned skip)=0
gr::adapt::rls_filter_cc::set_delta
virtual void set_delta(float delta)=0
gr::adapt::rls_filter_cc::set_lambda
virtual void set_lambda(float _lambda)=0
gr::adapt::rls_filter_cc::set_taps
virtual void set_taps(const std::vector< gr_complex > &taps)=0
gr::adapt::rls_filter_cc::error
virtual gr_complex error(const gr_complex &desired, const gr_complex &out)=0
gr::adapt::rls_filter_cc::update_tap
virtual void update_tap(gr_complex &tap, const gr_complex &in)=0
gr::adapt::rls_filter_cc::get_reset
virtual bool get_reset() const =0
gr::adapt::rls_filter_cc::get_skip
virtual unsigned get_skip() const =0
gr::adapt::rls_filter_cc::set_reset
virtual void set_reset(bool reset)=0
gr
Definition iqrd_rls_filter_cc.h:28