SPUC::iir_2nd< Numeric, Coeff > Class Template Reference
[SPUC double templatesIIR filters]

Template for 2nd Order IIR filter. More...

#include <iir_2nd.h>

Collaboration diagram for SPUC::iir_2nd< Numeric, Coeff >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef mixed_type< Numeric,
Coeff >::dtype 
sum_type

Public Member Functions

 iir_2nd (Coeff B0, Coeff B1, Coeff B2, Coeff A1, Coeff A2, long b=0)
 iir_2nd (Coeff A1=0, Coeff A2=0)
void set_round_bits (long x)
int get_round_bits ()
Coeff get_b0 ()
void reset ()
void set_a (Coeff A1, Coeff A2)
void set_b (Coeff A1, Coeff A2)
void set_coeffs (Coeff B0, Coeff B1, Coeff B2, Coeff A1, Coeff A2)
 iir_2nd (const char *file)
 Constructor reading coefficients from a file.
void print ()
 Print out coefficients.
Numeric clock (Numeric input)
 Input new sample and calculate output.

Public Attributes

Numeric fb2
Numeric fb1
Numeric fb0

Protected Attributes

long round_bits
Coeff b0
Coeff b1
Coeff b2
Coeff a1
Coeff a2
Numeric in [3]
quantiser< Coeff > Q

Detailed Description

template<class Numeric, class Coeff = float_type>
class SPUC::iir_2nd< Numeric, Coeff >

Template for 2nd Order IIR filter.

The filter is assumed to be a low pass 2nd order digital filter of the form $ G(z) = \frac{b0*z^2 + b1*z+b2}{(z^2+a1*z+a2)} $

iir_2nd.gif
Author:
Tony Kirke
iir_2nd.png


Member Typedef Documentation

template<class Numeric, class Coeff = float_type>
typedef mixed_type<Numeric,Coeff>::dtype SPUC::iir_2nd< Numeric, Coeff >::sum_type


Constructor & Destructor Documentation

template<class Numeric, class Coeff = float_type>
SPUC::iir_2nd< Numeric, Coeff >::iir_2nd ( Coeff  B0,
Coeff  B1,
Coeff  B2,
Coeff  A1,
Coeff  A2,
long  b = 0 
) [inline]

template<class Numeric, class Coeff = float_type>
SPUC::iir_2nd< Numeric, Coeff >::iir_2nd ( Coeff  A1 = 0,
Coeff  A2 = 0 
) [inline]

template<class Numeric, class Coeff = float_type>
SPUC::iir_2nd< Numeric, Coeff >::iir_2nd ( const char *  file  )  [inline]

Constructor reading coefficients from a file.


Member Function Documentation

template<class Numeric, class Coeff = float_type>
Numeric SPUC::iir_2nd< Numeric, Coeff >::clock ( Numeric  input  )  [inline]

Input new sample and calculate output.

template<class Numeric, class Coeff = float_type>
Coeff SPUC::iir_2nd< Numeric, Coeff >::get_b0 (  )  [inline]

template<class Numeric, class Coeff = float_type>
int SPUC::iir_2nd< Numeric, Coeff >::get_round_bits (  )  [inline]

template<class Numeric, class Coeff = float_type>
void SPUC::iir_2nd< Numeric, Coeff >::print ( void   )  [inline]

Print out coefficients.

template<class Numeric, class Coeff = float_type>
void SPUC::iir_2nd< Numeric, Coeff >::reset ( void   )  [inline]

template<class Numeric, class Coeff = float_type>
void SPUC::iir_2nd< Numeric, Coeff >::set_a ( Coeff  A1,
Coeff  A2 
) [inline]

template<class Numeric, class Coeff = float_type>
void SPUC::iir_2nd< Numeric, Coeff >::set_b ( Coeff  A1,
Coeff  A2 
) [inline]

template<class Numeric, class Coeff = float_type>
void SPUC::iir_2nd< Numeric, Coeff >::set_coeffs ( Coeff  B0,
Coeff  B1,
Coeff  B2,
Coeff  A1,
Coeff  A2 
) [inline]

template<class Numeric, class Coeff = float_type>
void SPUC::iir_2nd< Numeric, Coeff >::set_round_bits ( long  x  )  [inline]


Member Data Documentation

template<class Numeric, class Coeff = float_type>
Coeff SPUC::iir_2nd< Numeric, Coeff >::a1 [protected]

template<class Numeric, class Coeff = float_type>
Coeff SPUC::iir_2nd< Numeric, Coeff >::a2 [protected]

template<class Numeric, class Coeff = float_type>
Coeff SPUC::iir_2nd< Numeric, Coeff >::b0 [protected]

template<class Numeric, class Coeff = float_type>
Coeff SPUC::iir_2nd< Numeric, Coeff >::b1 [protected]

template<class Numeric, class Coeff = float_type>
Coeff SPUC::iir_2nd< Numeric, Coeff >::b2 [protected]

template<class Numeric, class Coeff = float_type>
Numeric SPUC::iir_2nd< Numeric, Coeff >::fb0

template<class Numeric, class Coeff = float_type>
Numeric SPUC::iir_2nd< Numeric, Coeff >::fb1

template<class Numeric, class Coeff = float_type>
Numeric SPUC::iir_2nd< Numeric, Coeff >::fb2

template<class Numeric, class Coeff = float_type>
Numeric SPUC::iir_2nd< Numeric, Coeff >::in[3] [protected]

template<class Numeric, class Coeff = float_type>
quantiser<Coeff> SPUC::iir_2nd< Numeric, Coeff >::Q [protected]

template<class Numeric, class Coeff = float_type>
long SPUC::iir_2nd< Numeric, Coeff >::round_bits [protected]


The documentation for this class was generated from the following file:
Generated on Mon Jun 9 19:40:42 2008 for DSPTemplates by  doxygen 1.4.7