#include <gri_iir.h>
Public Member Functions | |
gri_iir (const std::vector< tap_type > &fftaps, const std::vector< tap_type > &fbtaps) throw (std::invalid_argument) | |
Construct an IIR with the given taps. | |
gri_iir () | |
~gri_iir () | |
o_type | filter (const i_type input) |
compute a single output value. | |
void | filter_n (o_type output[], const i_type input[], long n) |
compute an array of N output values. input must have N valid entries. | |
unsigned | ntaps_ff () const |
unsigned | ntaps_fb () const |
void | set_taps (const std::vector< tap_type > &fftaps, const std::vector< tap_type > &fbtaps) throw (std::invalid_argument) |
install new taps. | |
Protected Attributes | |
std::vector< tap_type > | d_fftaps |
std::vector< tap_type > | d_fbtaps |
int | d_latest_n |
int | d_latest_m |
std::vector< tap_type > | d_prev_output |
std::vector< i_type > | d_prev_input |
gri_iir< i_type, o_type, tap_type >::gri_iir | ( | const std::vector< tap_type > & | fftaps, | |
const std::vector< tap_type > & | fbtaps | |||
) | throw (std::invalid_argument) [inline] |
Construct an IIR with the given taps.
This filter uses the Direct Form I implementation, where fftaps
contains the feed-forward taps, and fbtaps
the feedback ones.
fftaps
and fbtaps
must have equal numbers of taps
The input and output satisfy a difference equation of the form
with the corresponding rational system function
Note that some texts define the system function with a + in the denominator. If you're using that convention, you'll need to negate the feedback taps.
gri_iir< i_type, o_type, tap_type >::gri_iir | ( | ) | [inline] |
gri_iir< i_type, o_type, tap_type >::~gri_iir | ( | ) | [inline] |
o_type gri_iir< i_type, o_type, tap_type >::filter | ( | const i_type | input | ) | [inline] |
compute a single output value.
References gri_iir< i_type, o_type, tap_type >::d_fbtaps, gri_iir< i_type, o_type, tap_type >::d_fftaps, gri_iir< i_type, o_type, tap_type >::d_latest_m, gri_iir< i_type, o_type, tap_type >::d_latest_n, gri_iir< i_type, o_type, tap_type >::d_prev_input, gri_iir< i_type, o_type, tap_type >::d_prev_output, gen_whitener::i, gri_iir< i_type, o_type, tap_type >::ntaps_fb(), and gri_iir< i_type, o_type, tap_type >::ntaps_ff().
Referenced by gri_iir< i_type, o_type, tap_type >::filter_n().
void gri_iir< i_type, o_type, tap_type >::filter_n | ( | o_type | output[], | |
const i_type | input[], | |||
long | n | |||
) | [inline] |
compute an array of N output values. input
must have N valid entries.
References gri_iir< i_type, o_type, tap_type >::filter(), and gen_whitener::i.
unsigned gri_iir< i_type, o_type, tap_type >::ntaps_fb | ( | ) | const [inline] |
Referenced by gri_iir< i_type, o_type, tap_type >::filter().
unsigned gri_iir< i_type, o_type, tap_type >::ntaps_ff | ( | ) | const [inline] |
void gri_iir< i_type, o_type, tap_type >::set_taps | ( | const std::vector< tap_type > & | fftaps, | |
const std::vector< tap_type > & | fbtaps | |||
) | throw (std::invalid_argument) [inline] |
std::vector<tap_type> gri_iir< i_type, o_type, tap_type >::d_fbtaps [protected] |
std::vector<tap_type> gri_iir< i_type, o_type, tap_type >::d_fftaps [protected] |
int gri_iir< i_type, o_type, tap_type >::d_latest_m [protected] |
int gri_iir< i_type, o_type, tap_type >::d_latest_n [protected] |
std::vector<i_type> gri_iir< i_type, o_type, tap_type >::d_prev_input [protected] |
std::vector<tap_type> gri_iir< i_type, o_type, tap_type >::d_prev_output [protected] |