23 #ifndef INCLUDED_SINGLE_POLE_IIR_H 24 #define INCLUDED_SINGLE_POLE_IIR_H 36 template <
class o_type,
class i_type,
class tap_type>
55 o_type
filter(
const i_type input);
61 void filterN(o_type output[],
const i_type input[],
unsigned long n);
68 if (alpha < 0 || alpha > 1)
69 throw std::out_of_range(
"Alpha must be in [0, 1]\n");
89 template <
class o_type,
class i_type,
class tap_type>
95 d_prev_output = output;
97 return (o_type)output;
101 template <
class o_type,
class i_type,
class tap_type>
103 const i_type input[],
106 for (
unsigned i = 0; i < n; i++)
107 output[i] =
filter(input[i]);
116 template <
class i_type>
148 if (alpha < 0 || alpha > 1)
149 throw std::out_of_range(
"Alpha must be in [0, 1]\n");
166 template <
class i_type>
179 template <
class i_type>
181 const i_type input[],
184 for (
unsigned i = 0; i < n; i++)
185 output[i] =
filter(input[i]);
void reset()
reset state to zero
Definition: single_pole_iir.h:156
single_pole_iir(tap_type alpha=1.0)
construct new single pole IIR with given alpha
Definition: single_pole_iir.h:45
o_type d_prev_output
Definition: single_pole_iir.h:83
std::complex< double > gr_complexd
Definition: gr_complex.h:28
class template for single pole IIR filter
Definition: single_pole_iir.h:37
gr_complexd prev_output() const
Definition: single_pole_iir.h:158
single_pole_iir(double alpha=1.0)
construct new single pole IIR with given alpha
Definition: single_pole_iir.h:125
std::complex< float > gr_complex
Definition: gr_complex.h:27
void set_taps(double alpha)
install alpha as the current taps.
Definition: single_pole_iir.h:146
GNU Radio logging wrapper for log4cpp library (C++ port of log4j)
Definition: basic_block.h:43
gr_complexd d_prev_output
Definition: single_pole_iir.h:163
void filterN(o_type output[], const i_type input[], unsigned long n)
compute an array of N output values. input must have n valid entries.
Definition: single_pole_iir.h:102
tap_type d_alpha
Definition: single_pole_iir.h:81
double d_one_minus_alpha
Definition: single_pole_iir.h:162
o_type filter(const i_type input)
compute a single output value.
Definition: single_pole_iir.h:90
o_type prev_output() const
Definition: single_pole_iir.h:78
tap_type d_one_minus_alpha
Definition: single_pole_iir.h:82
double d_alpha
Definition: single_pole_iir.h:161
void reset()
reset state to zero
Definition: single_pole_iir.h:76
void set_taps(tap_type alpha)
install alpha as the current taps.
Definition: single_pole_iir.h:66