qrd_rls_filter_ff_impl.h
Go to the documentation of this file.
/* -*- c++ -*- */
/*
* Copyright 2018 <+YOU OR YOUR COMPANY+>.
*
* This is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3, or (at your option)
* any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street,
* Boston, MA 02110-1301, USA.
*/
#ifndef INCLUDED_ADAPT_QRD_RLS_FILTER_FF_IMPL_H
#define INCLUDED_ADAPT_QRD_RLS_FILTER_FF_IMPL_H
#include "config.h"
#ifdef ARMADILLO_FOUND
#include <armadillo>
#endif
#include <adapt/qrd_rls_filter_ff.h>
#include <gnuradio/filter/fir_filter.h>
namespace gr {
namespace adapt {
class qrd_rls_filter_ff_impl : public qrd_rls_filter_ff, filter::kernel::fir_filter_fff {
private:
void init_internals();
#ifdef ARMADILLO_FOUND
arma::fvec d_taps;
arma::fvec d_new_taps;
arma::fmat d_U, d_dq2;
#else
std::vector<float> d_new_taps;
std::vector<std::vector<float>> d_U;
std::vector<float> d_dq2;
#endif // ARMADILLO_FOUND
bool d_updated;
float d_delta, d_lambda;
unsigned d_skip, d_i;
bool d_adapt, d_reset;
protected:
float error(const float& desired, const float& out);
public:
qrd_rls_filter_ff_impl(int num_taps,
float delta,
float lambda,
unsigned skip,
unsigned decimation,
bool adapt,
bool reset);
~qrd_rls_filter_ff_impl() = default;
const std::vector<float>& get_taps() override;
void set_taps(const std::vector<float>& new_taps) override;
float get_delta() const override;
void set_delta(float delta) override;
float get_lambda() const override;
void set_lambda(float lambda) override;
unsigned get_skip() const override;
void set_skip(unsigned skip) override;
bool get_adapt() const override;
void set_adapt(bool adapt) override;
bool get_reset() const override;
void set_reset(bool reset) override;
// Where all the action really happens
int work(int noutput_items,
gr_vector_const_void_star& input_items,
gr_vector_void_star& output_items);
};
} // namespace adapt
} // namespace gr
#endif /* INCLUDED_ADAPT_QRD_RLS_FILTER_FF_IMPL_H */
gr::adapt::qrd_rls_filter_ff_impl
Definition qrd_rls_filter_ff_impl.h:34
gr::adapt::qrd_rls_filter_ff_impl::set_delta
void set_delta(float delta) override
gr::adapt::qrd_rls_filter_ff_impl::set_reset
void set_reset(bool reset) override
gr::adapt::qrd_rls_filter_ff_impl::get_reset
bool get_reset() const override
gr::adapt::qrd_rls_filter_ff_impl::get_taps
const std::vector< float > & get_taps() override
gr::adapt::qrd_rls_filter_ff_impl::get_delta
float get_delta() const override
gr::adapt::qrd_rls_filter_ff_impl::get_adapt
bool get_adapt() const override
gr::adapt::qrd_rls_filter_ff_impl::~qrd_rls_filter_ff_impl
~qrd_rls_filter_ff_impl()=default
gr::adapt::qrd_rls_filter_ff_impl::set_taps
void set_taps(const std::vector< float > &new_taps) override
gr::adapt::qrd_rls_filter_ff_impl::qrd_rls_filter_ff_impl
qrd_rls_filter_ff_impl(int num_taps, float delta, float lambda, unsigned skip, unsigned decimation, bool adapt, bool reset)
gr::adapt::qrd_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::qrd_rls_filter_ff_impl::error
float error(const float &desired, const float &out)
gr::adapt::qrd_rls_filter_ff_impl::set_adapt
void set_adapt(bool adapt) override
gr::adapt::qrd_rls_filter_ff_impl::set_skip
void set_skip(unsigned skip) override
gr::adapt::qrd_rls_filter_ff_impl::get_lambda
float get_lambda() const override
gr::adapt::qrd_rls_filter_ff_impl::get_skip
unsigned get_skip() const override
gr::adapt::qrd_rls_filter_ff_impl::set_lambda
void set_lambda(float lambda) override
gr::adapt::qrd_rls_filter_ff
QR Decomposition Recursive Least Squares Adaptive Filter (float in/out)
Definition qrd_rls_filter_ff.h:38
config.h
gr
Definition iqrd_rls_filter_cc.h:28
qrd_rls_filter_ff.h