SPUC  3.0
Public Types | Public Member Functions | Public Attributes | Protected Attributes | List of all members
SPUC::iir_2nd< Numeric, Coeff > Class Template Reference

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

#include <iir_2nd.h>

Collaboration diagram for SPUC::iir_2nd< Numeric, Coeff >:
Collaboration graph
[legend]

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 ()
 
Coeff get_b1 ()
 
Coeff get_b2 ()
 
Coeff get_a1 ()
 
Coeff get_a2 ()
 
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. More...
 
void print ()
 Print out coefficients. More...
 
Numeric clock (Numeric input)
 Input new sample and calculate output. More...
 

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

References SPUC::iir_2nd< Numeric, Coeff >::reset().

Here is the call graph for this function:

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

References SPUC::iir_2nd< Numeric, Coeff >::reset().

Here is the call graph for this function:

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

Member Function Documentation

template<class Numeric, class Coeff = float_type>
Numeric SPUC::iir_2nd< Numeric, Coeff >::clock ( Numeric  input)
inline
template<class Numeric, class Coeff = float_type>
Coeff SPUC::iir_2nd< Numeric, Coeff >::get_a1 ( )
inline
template<class Numeric, class Coeff = float_type>
Coeff SPUC::iir_2nd< Numeric, Coeff >::get_a2 ( )
inline
template<class Numeric, class Coeff = float_type>
Coeff SPUC::iir_2nd< Numeric, Coeff >::get_b0 ( )
inline
template<class Numeric, class Coeff = float_type>
Coeff SPUC::iir_2nd< Numeric, Coeff >::get_b1 ( )
inline
template<class Numeric, class Coeff = float_type>
Coeff SPUC::iir_2nd< Numeric, Coeff >::get_b2 ( )
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
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

References SPUC::quantiser< Numeric >::set_bits().

Referenced by main().

Here is the call graph for this function:

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: