SPUC  3.0
Public Member Functions | Protected Attributes | List of all members
SPUC::running_average< Numeric > Class Template Reference

template class running average filter consisting of a delay line, adder and subtractor More...

#include <running_average.h>

Collaboration diagram for SPUC::running_average< Numeric >:
Collaboration graph
[legend]

Public Member Functions

 running_average (long n=0)
 / Constructor More...
 
running_averageoperator= (const running_average &rhs)
 Assignment. More...
 
void set_size (long n)
 
 ~running_average (void)
 destructor More...
 
void reset (void)
 Reset/clear. More...
 
Numeric get_result ()
 return result More...
 
Numeric update (Numeric in)
 Clock in new input sample. More...
 
Numeric average (Numeric in)
 

Protected Attributes

Numeric result
 
delay< Numeric > z
 
long size
 
float_type inv_size
 

Detailed Description

template<class Numeric>
class SPUC::running_average< Numeric >

template class running average filter consisting of a delay line, adder and subtractor

Author
Tony Kirke
running_average.png
Tony Kirke
running_average.gif

Constructor & Destructor Documentation

template<class Numeric >
SPUC::running_average< Numeric >::running_average ( long  n = 0)
inline

/ Constructor

References SPUC::delay< Numeric >::reset(), and SPUC::delay< Numeric >::set_size().

Here is the call graph for this function:

template<class Numeric >
SPUC::running_average< Numeric >::~running_average ( void  )
inline

destructor

Member Function Documentation

template<class Numeric >
Numeric SPUC::running_average< Numeric >::average ( Numeric  in)
inline

References SPUC::running_average< Numeric >::update().

Here is the call graph for this function:

template<class Numeric >
Numeric SPUC::running_average< Numeric >::get_result ( )
inline

return result

template<class Numeric >
running_average& SPUC::running_average< Numeric >::operator= ( const running_average< Numeric > &  rhs)
inline
template<class Numeric >
void SPUC::running_average< Numeric >::reset ( void  )
inline

Reset/clear.

References SPUC::delay< Numeric >::reset().

Here is the call graph for this function:

template<class Numeric >
void SPUC::running_average< Numeric >::set_size ( long  n)
inline

References SPUC::delay< Numeric >::set_size().

Here is the call graph for this function:

template<class Numeric >
Numeric SPUC::running_average< Numeric >::update ( Numeric  in)
inline

Clock in new input sample.

References SPUC::delay< Numeric >::input(), and SPUC::delay< Numeric >::last().

Referenced by SPUC::running_average< Numeric >::average().

Here is the call graph for this function:

Member Data Documentation

template<class Numeric >
float_type SPUC::running_average< Numeric >::inv_size
protected
template<class Numeric >
Numeric SPUC::running_average< Numeric >::result
protected
template<class Numeric >
long SPUC::running_average< Numeric >::size
protected
template<class Numeric >
delay<Numeric> SPUC::running_average< Numeric >::z
protected

The documentation for this class was generated from the following file: