Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Class Members | File Members

gri_iir< i_type, o_type, tap_type > Class Template Reference

#include <gri_iir.h>

Collaboration diagram for gri_iir< i_type, o_type, tap_type >:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<class i_type, class o_type, class tap_type>
class gri_iir< i_type, o_type, tap_type >

base class template for Infinite Impulse Response filter (IIR)


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 () 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_typed_fftaps
std::vector< tap_typed_fbtaps
int d_latest
std::vector< tap_typed_prev_output
std::vector< i_typed_prev_input


Constructor & Destructor Documentation

template<class i_type, class o_type, class tap_type>
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

\[ y[n] - \sum_{k=1}^{N} a_k y[n-k] = \sum_{k=0}^{M} b_k x[n-k] \]

with the corresponding rational system function

\[ H(z) = \frac{\sum_{k=0}^{M} b_k z^{-k}}{1 - \sum_{k=1}^{N} a_k z^{-k}} \]

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.

template<class i_type, class o_type, class tap_type>
gri_iir< i_type, o_type, tap_type >::gri_iir  )  [inline]
 

template<class i_type, class o_type, class tap_type>
gri_iir< i_type, o_type, tap_type >::~gri_iir  )  [inline]
 


Member Function Documentation

template<class i_type, class o_type, class tap_type>
o_type gri_iir< i_type, o_type, tap_type >::filter const i_type  input  ) 
 

compute a single output value.

Returns:
the filtered input value.

template<class i_type, class o_type, class tap_type>
void gri_iir< i_type, o_type, tap_type >::filter_n o_type  output[],
const i_type  input[],
long  n
 

compute an array of N output values. input must have N valid entries.

template<class i_type, class o_type, class tap_type>
unsigned gri_iir< i_type, o_type, tap_type >::ntaps  )  const [inline]
 

Returns:
number of taps in filter.

template<class i_type, class o_type, class tap_type>
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]
 

install new taps.


Member Data Documentation

template<class i_type, class o_type, class tap_type>
std::vector<tap_type> gri_iir< i_type, o_type, tap_type >::d_fbtaps [protected]
 

template<class i_type, class o_type, class tap_type>
std::vector<tap_type> gri_iir< i_type, o_type, tap_type >::d_fftaps [protected]
 

template<class i_type, class o_type, class tap_type>
int gri_iir< i_type, o_type, tap_type >::d_latest [protected]
 

template<class i_type, class o_type, class tap_type>
std::vector<i_type> gri_iir< i_type, o_type, tap_type >::d_prev_input [protected]
 

template<class i_type, class o_type, class tap_type>
std::vector<tap_type> gri_iir< i_type, o_type, tap_type >::d_prev_output [protected]
 


The documentation for this class was generated from the following file:
Generated on Sat Jul 8 17:14:55 2006 for GNU Radio 2.x by  doxygen 1.4.1