11#ifndef INCLUDED_DIGITAL_ADAPTIVE_ALGORITHM_NLMS_H
12#define INCLUDED_DIGITAL_ADAPTIVE_ALGORITHM_NLMS_H
23 typedef std::shared_ptr<adaptive_algorithm_nlms>
sptr;
26 const float d_step_size;
46 throw std::runtime_error(
47 "NLMS can only update all taps at once, single tap update is not valid");
54 unsigned int num_taps)
override
57 volk_32fc_x2_conjugate_dot_prod_32fc(&dp, in, in, num_taps);
58 float magsq = real(dp);
59 float norm_step_size = d_step_size / magsq;
61 for (
unsigned i = 0; i < num_taps; i++) {
62 taps[i] = conj(conj(
taps[i]) + norm_step_size * in[i] * conj(error));
Definition: adaptive_algorithm_nlms.h:21
~adaptive_algorithm_nlms() override
Definition: adaptive_algorithm_nlms.h:66
static sptr make(constellation_sptr cons, float step_size)
Definition: adaptive_algorithm_nlms.h:35
adaptive_algorithm_nlms(constellation_sptr cons, float step_size)
Definition: adaptive_algorithm_nlms.h:29
gr_complex update_tap(const gr_complex tap, const gr_complex &in, const gr_complex error, const gr_complex decision) override
Definition: adaptive_algorithm_nlms.h:41
void initialize_taps(std::vector< gr_complex > &taps) override
Definition: adaptive_algorithm_nlms.h:68
std::shared_ptr< adaptive_algorithm_nlms > sptr
Definition: adaptive_algorithm_nlms.h:23
void update_taps(gr_complex *taps, const gr_complex *in, const gr_complex error, const gr_complex decision, unsigned int num_taps) override
Definition: adaptive_algorithm_nlms.h:50
Definition: adaptive_algorithm.h:30
#define DIGITAL_API
Definition: gr-digital/include/gnuradio/digital/api.h:18
std::complex< float > gr_complex
Definition: gr_complex.h:15
static constexpr float taps[NSTEPS+1][NTAPS]
Definition: interpolator_taps.h:9
adaptive_algorithm_t
Definition: adaptive_algorithm.h:23
GNU Radio logging wrapper.
Definition: basic_block.h:29
PMT_API pmt_t cons(const pmt_t &x, const pmt_t &y)
Return a newly allocated pair whose car is x and whose cdr is y.