lms_filter_cc_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_LMS_FILTER_CC_IMPL_H
#define INCLUDED_ADAPT_LMS_FILTER_CC_IMPL_H
#include "config.h"
#ifdef ARMADILLO_FOUND
#include <armadillo>
#endif
#include <adapt/lms_filter_cc.h>
#include <gnuradio/filter/fir_filter.h>
namespace gr {
namespace adapt {
class lms_filter_cc_impl : public lms_filter_cc, filter::kernel::fir_filter_ccc {
private:
#ifdef ARMADILLO_FOUND
arma::cx_fvec d_taps;
arma::cx_fvec d_new_taps;
#else
std::vector<gr_complex> d_new_taps;
#endif // ARMADILLO_FOUND
bool d_first_input;
bool d_updated;
gr_complex d_error;
float d_mu;
unsigned d_skip, d_i;
bool d_adapt, d_bypass, d_reset;
protected:
gr_complex error(const gr_complex& desired, const gr_complex& out) override;
void update_tap(gr_complex& tap, const gr_complex& in) override;
public:
lms_filter_cc_impl(bool first_input,
int num_taps,
float mu,
unsigned skip,
unsigned decimation,
bool adapt,
bool bypass,
bool reset);
~lms_filter_cc_impl() = default;
const std::vector<gr_complex>& get_taps() override;
void set_taps(const std::vector<gr_complex>& new_taps) override;
float get_mu() const override;
void set_mu(float mu) 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_bypass() const override;
void set_bypass(bool bypass) 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) override;
};
} // namespace adapt
} // namespace gr
#endif /* INCLUDED_ADAPT_LMS_FILTER_CC_IMPL_H */
gr::adapt::lms_filter_cc_impl
Definition: lms_filter_cc_impl.h:34
gr::adapt::lms_filter_cc_impl::get_mu
float get_mu() const override
gr::adapt::lms_filter_cc_impl::set_mu
void set_mu(float mu) override
gr::adapt::lms_filter_cc_impl::update_tap
void update_tap(gr_complex &tap, const gr_complex &in) override
gr::adapt::lms_filter_cc_impl::work
int work(int noutput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) override
gr::adapt::lms_filter_cc_impl::set_taps
void set_taps(const std::vector< gr_complex > &new_taps) override
gr::adapt::lms_filter_cc_impl::lms_filter_cc_impl
lms_filter_cc_impl(bool first_input, int num_taps, float mu, unsigned skip, unsigned decimation, bool adapt, bool bypass, bool reset)
gr::adapt::lms_filter_cc_impl::set_reset
void set_reset(bool reset) override
gr::adapt::lms_filter_cc_impl::set_adapt
void set_adapt(bool adapt) override
gr::adapt::lms_filter_cc_impl::set_bypass
void set_bypass(bool bypass) override
gr::adapt::lms_filter_cc_impl::~lms_filter_cc_impl
~lms_filter_cc_impl()=default
gr::adapt::lms_filter_cc_impl::get_reset
bool get_reset() const override
gr::adapt::lms_filter_cc_impl::set_skip
void set_skip(unsigned skip) override
gr::adapt::lms_filter_cc_impl::get_adapt
bool get_adapt() const override
gr::adapt::lms_filter_cc_impl::get_bypass
bool get_bypass() const override
gr::adapt::lms_filter_cc_impl::error
gr_complex error(const gr_complex &desired, const gr_complex &out) override
gr::adapt::lms_filter_cc_impl::get_skip
unsigned get_skip() const override
gr::adapt::lms_filter_cc_impl::get_taps
const std::vector< gr_complex > & get_taps() override
gr::adapt::lms_filter_cc
Least Mean Squares Adaptive Filter (complex in/out)
Definition: lms_filter_cc.h:41
config.h
lms_filter_cc.h
gr
Definition: iqrd_rls_filter_cc.h:28