GNU Radio's ADAPT Package
rls_filter_ff.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_FF_H
23#define INCLUDED_ADAPT_RLS_FILTER_FF_H
24
25#include <adapt/api.h>
26#include <gnuradio/sync_decimator.h>
27
28namespace gr {
29namespace adapt {
30
31/*!
32 * \brief Recursive Least Squares Adaptive Filter (float in/out)
33 * \ingroup adapt
34 *
35 * \details
36 * This block implements a RLS-based adaptive filter.
37 */
38class ADAPT_API rls_filter_ff : virtual public gr::sync_decimator {
39 public:
40 typedef boost::shared_ptr<rls_filter_ff> sptr;
41
42 /*!
43 * Make a RLS adaptive filter
44 *
45 * \param first_input Specifies whether first input is reference or error signal (bool)
46 * \param num_taps Number of taps in the filter (int)
47 * \param delta Regularization factor of the update loop (float)
48 * \param _lambda Forgetting factor of the update loop (float)
49 * \param skip Specifies how many samples are skipped between
50 * successive filter updates (unsigned)
51 * \param decimation Decimation rate of the filter (unsigned)
52 * \param adapt Controls whether filter taps are being updated (bool)
53 * \param reset Reset filter taps (bool)
54 */
55 static sptr make(bool first_input,
56 int num_taps,
57 float delta,
58 float _lambda,
59 unsigned skip,
60 unsigned decimation,
61 bool adapt,
62 bool reset);
63
64 virtual void set_taps(const std::vector<float>& taps) = 0;
65 virtual const std::vector<float>& get_taps() = 0;
66 virtual float get_delta() const = 0;
67 virtual void set_delta(float delta) = 0;
68 virtual float get_lambda() const = 0;
69 virtual void set_lambda(float _lambda) = 0;
70 virtual unsigned get_skip() const = 0;
71 virtual void set_skip(unsigned skip) = 0;
72 virtual bool get_adapt() const = 0;
73 virtual void set_adapt(bool adapt) = 0;
74 virtual bool get_reset() const = 0;
75 virtual void set_reset(bool reset) = 0;
76};
77
78} // namespace adapt
79} // namespace gr
80
81#endif /* INCLUDED_ADAPT_RLS_FILTER_FF_H */
#define ADAPT_API
Definition: api.h:31
Recursive Least Squares Adaptive Filter (float in/out)
Definition: rls_filter_ff.h:38
virtual void set_delta(float delta)=0
virtual bool get_reset() const =0
virtual void set_reset(bool reset)=0
static sptr make(bool first_input, int num_taps, float delta, float _lambda, unsigned skip, unsigned decimation, bool adapt, bool reset)
virtual float get_lambda() const =0
virtual float get_delta() const =0
virtual unsigned get_skip() const =0
virtual bool get_adapt() const =0
virtual void set_skip(unsigned skip)=0
virtual void set_adapt(bool adapt)=0
boost::shared_ptr< rls_filter_ff > sptr
Definition: rls_filter_ff.h:40
virtual void set_taps(const std::vector< float > &taps)=0
virtual void set_lambda(float _lambda)=0
virtual const std::vector< float > & get_taps()=0
Definition: iqrd_rls_filter_cc.h:28