GNU Radio's ADAPT Package

iqrd_rls_filter_ff_impl.h
Go to the documentation of this file.
1/* -*- c++ -*- */
2/*
3 * Copyright 2018 <+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#ifndef INCLUDED_ADAPT_IQRD_RLS_FILTER_FF_IMPL_H
22#define INCLUDED_ADAPT_IQRD_RLS_FILTER_FF_IMPL_H
23
24#include "config.h"
25#ifdef ARMADILLO_FOUND
26#include <armadillo>
27#endif
28#include <adapt/iqrd_rls_filter_ff.h>
29#include <gnuradio/filter/fir_filter.h>
30
31 namespace gr {
32 namespace adapt {
33
34 class iqrd_rls_filter_ff_impl : public iqrd_rls_filter_ff, filter::kernel::fir_filter_fff {
35 private:
36 void init_internals();
37
38#ifdef ARMADILLO_FOUND
39 arma::fvec d_taps;
40 arma::fvec d_new_taps;
41 arma::fmat d_U, d_dq2;
42#else
43 std::vector<float> d_new_taps;
44 std::vector<std::vector<float>> d_U;
45 std::vector<float> d_dq2;
46#endif // ARMADILLO_FOUND
47 bool d_updated;
48 float d_delta, d_lambda;
49 unsigned d_skip, d_i;
50 bool d_adapt, d_reset;
51
52 protected:
53 float error(const float& desired, const float& out);
54
55 public:
56 iqrd_rls_filter_ff_impl(int num_taps,
57 float delta,
58 float lambda,
59 unsigned skip,
60 unsigned decimation,
61 bool adapt,
62 bool reset);
63 ~iqrd_rls_filter_ff_impl() = default;
64
65 const std::vector<float>& get_taps() override;
66 void set_taps(const std::vector<float>& new_taps) override;
67 float get_delta() const override;
68 void set_delta(float delta) override;
69 float get_lambda() const override;
70 void set_lambda(float lambda) override;
71 unsigned get_skip() const override;
72 void set_skip(unsigned skip) override;
73 bool get_adapt() const override;
74 void set_adapt(bool adapt) override;
75 bool get_reset() const override;
76 void set_reset(bool reset) override;
77
78 // Where all the action really happens
79 int work(int noutput_items,
80 gr_vector_const_void_star& input_items,
81 gr_vector_void_star& output_items);
82};
83
84} // namespace adapt
85} // namespace gr
86
87#endif /* INCLUDED_ADAPT_IQRD_RLS_FILTER_FF_IMPL_H */
gr::adapt::iqrd_rls_filter_ff_impl
Definition iqrd_rls_filter_ff_impl.h:34
gr::adapt::iqrd_rls_filter_ff_impl::set_reset
void set_reset(bool reset) override
gr::adapt::iqrd_rls_filter_ff_impl::get_delta
float get_delta() const override
gr::adapt::iqrd_rls_filter_ff_impl::set_adapt
void set_adapt(bool adapt) override
gr::adapt::iqrd_rls_filter_ff_impl::error
float error(const float &desired, const float &out)
gr::adapt::iqrd_rls_filter_ff_impl::set_skip
void set_skip(unsigned skip) override
gr::adapt::iqrd_rls_filter_ff_impl::work
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
gr::adapt::iqrd_rls_filter_ff_impl::set_taps
void set_taps(const std::vector< float > &new_taps) override
gr::adapt::iqrd_rls_filter_ff_impl::iqrd_rls_filter_ff_impl
iqrd_rls_filter_ff_impl(int num_taps, float delta, float lambda, unsigned skip, unsigned decimation, bool adapt, bool reset)
gr::adapt::iqrd_rls_filter_ff_impl::~iqrd_rls_filter_ff_impl
~iqrd_rls_filter_ff_impl()=default
gr::adapt::iqrd_rls_filter_ff_impl::get_adapt
bool get_adapt() const override
gr::adapt::iqrd_rls_filter_ff_impl::get_reset
bool get_reset() const override
gr::adapt::iqrd_rls_filter_ff_impl::set_lambda
void set_lambda(float lambda) override
gr::adapt::iqrd_rls_filter_ff_impl::get_skip
unsigned get_skip() const override
gr::adapt::iqrd_rls_filter_ff_impl::get_taps
const std::vector< float > & get_taps() override
gr::adapt::iqrd_rls_filter_ff_impl::set_delta
void set_delta(float delta) override
gr::adapt::iqrd_rls_filter_ff_impl::get_lambda
float get_lambda() const override
gr::adapt::iqrd_rls_filter_ff
Inverse QR Decomposition Recursive Least Squares Adaptive Filter (float in/out)
Definition iqrd_rls_filter_ff.h:38
config.h
iqrd_rls_filter_ff.h
gr
Definition iqrd_rls_filter_cc.h:28