22 #ifndef _GR_SINGLE_POLE_IIR_H_
23 #define _GR_SINGLE_POLE_IIR_H_
31 template<
class o_type,
class i_type,
class tap_type>
49 o_type
filter (
const i_type input);
55 void filterN (o_type output[],
const i_type input[],
unsigned long n);
62 if (alpha < 0 || alpha > 1)
63 throw std::out_of_range (
"Alpha must be in [0, 1]\n");
87 template<
class o_type,
class i_type,
class tap_type>
93 output = d_alpha * input + d_one_minus_alpha * d_prev_output;
94 d_prev_output = output;
96 return (o_type) output;
100 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]);
115 template<
class i_type>
146 if (alpha < 0 || alpha > 1)
147 throw std::out_of_range (
"Alpha must be in [0, 1]\n");
167 template<
class i_type>
181 template<
class i_type>
184 const i_type input[],
187 for (
unsigned i = 0; i < n; i++)
188 output[i] =
filter (input[i]);
tap_type d_one_minus_alpha
Definition: gr_single_pole_iir.h:79
void set_taps(double alpha)
install alpha as the current taps.
Definition: gr_single_pole_iir.h:144
o_type filter(const i_type input)
compute a single output value.
Definition: gr_single_pole_iir.h:89
o_type d_prev_output
Definition: gr_single_pole_iir.h:80
gr_complexd d_prev_output
Definition: gr_single_pole_iir.h:164
void reset()
reset state to zero
Definition: gr_single_pole_iir.h:70
tap_type d_alpha
Definition: gr_single_pole_iir.h:78
std::complex< double > gr_complexd
Definition: gr_complex.h:27
std::complex< float > gr_complex
Definition: gr_complex.h:26
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: gr_single_pole_iir.h:102
void set_taps(tap_type alpha)
install alpha as the current taps.
Definition: gr_single_pole_iir.h:60
gr_single_pole_iir(double alpha=1.0)
construct new single pole IIR with given alpha
Definition: gr_single_pole_iir.h:123
gr_complexd prev_output() const
Definition: gr_single_pole_iir.h:159
o_type prev_output() const
Definition: gr_single_pole_iir.h:75
class template for single pole IIR filter
Definition: gr_single_pole_iir.h:32
double d_one_minus_alpha
Definition: gr_single_pole_iir.h:163
gr_single_pole_iir(tap_type alpha=1.0)
construct new single pole IIR with given alpha
Definition: gr_single_pole_iir.h:39
void reset()
reset state to zero
Definition: gr_single_pole_iir.h:154
double d_alpha
Definition: gr_single_pole_iir.h:162