Cheetah Software  1.0
AverageFilter< T > Class Template Reference

#include <filters.h>

+ Inheritance diagram for AverageFilter< T >:
+ Collaboration diagram for AverageFilter< T >:

Public Member Functions

 AverageFilter (T dt, T t_const, T limit)
 
virtual ~AverageFilter ()
 
virtual void input (T input_value)
 
virtual T output (void)
 
virtual void clear (void)
 
- Public Member Functions inherited from filter< T >
 filter (void)
 
virtual ~filter (void)
 

Private Attributes

est_value_
 
dt_
 
t_const_
 
limit_
 

Detailed Description

template<typename T>
class AverageFilter< T >

Definition at line 113 of file filters.h.

Constructor & Destructor Documentation

template<typename T >
AverageFilter< T >::AverageFilter ( dt,
t_const,
limit 
)

Definition at line 320 of file filters.cpp.

References AverageFilter< T >::est_value_.

321  : dt_(dt), t_const_(t_const), limit_(limit) {
322  est_value_ = 0.;
323 }
template<typename T >
AverageFilter< T >::~AverageFilter ( )
virtual

Definition at line 326 of file filters.cpp.

References AverageFilter< T >::est_value_.

326  {
327  est_value_ = 0;
328 }

Member Function Documentation

template<typename T >
void AverageFilter< T >::clear ( void  )
virtual

Implements filter< T >.

Definition at line 331 of file filters.cpp.

References AverageFilter< T >::est_value_.

331  {
332  est_value_ = 0.;
333 }
template<typename T >
void AverageFilter< T >::input ( input_value)
virtual

Implements filter< T >.

Definition at line 336 of file filters.cpp.

References AverageFilter< T >::dt_, AverageFilter< T >::est_value_, AverageFilter< T >::limit_, and AverageFilter< T >::t_const_.

336  {
337  T update_value = input - est_value_;
338  if (fabs(update_value) > limit_) {
339  update_value = 0.;
340  }
341  est_value_ += (dt_ / (dt_ + t_const_)) * update_value;
342 }
virtual void input(T input_value)
Definition: filters.cpp:336
template<typename T >
T AverageFilter< T >::output ( void  )
virtual

Implements filter< T >.

Definition at line 345 of file filters.cpp.

References AverageFilter< T >::est_value_.

345  {
346  return est_value_;
347 }

Member Data Documentation

template<typename T >
T AverageFilter< T >::dt_
private

Definition at line 123 of file filters.h.

template<typename T >
T AverageFilter< T >::est_value_
private

Definition at line 122 of file filters.h.

template<typename T >
T AverageFilter< T >::limit_
private

Definition at line 125 of file filters.h.

template<typename T >
T AverageFilter< T >::t_const_
private

Definition at line 124 of file filters.h.


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