smooth_filter Class Reference
[Filters]

#include <SmoothFilter.h>

Inheritance diagram for smooth_filter:

Inheritance graph
[legend]
Collaboration diagram for smooth_filter:

Collaboration graph
[legend]

List of all members.


Detailed Description

Implements a simple weighted moving average based on a smooth_factor.

Definition at line 48 of file SmoothFilter.h.


Public Member Functions

 smooth_filter (double smooth_factor=0.9)
 creates a new smooth_filter, setting the smooth_factor
void update (double incoming)
 update the average with incoming
int age ()
 ages value without new value; equivalent to update(0.0); getValue();
int reset ()
 resets value to 0.0

Constructor & Destructor Documentation

smooth_filter::smooth_filter ( double  smooth_factor = 0.9  ) 

creates a new smooth_filter, setting the smooth_factor

Parameters:
smooth_factor the weight for the weighted moving average

Definition at line 34 of file SmoothFilter.cc.


Member Function Documentation

void smooth_filter::update ( double  incoming  )  [virtual]

update the average with incoming

$ value = oldValue \times (smooth\_factor) + (incoming \times (1.0 - smooth\_factor)) $

if the value is empty, just use the incoming value.

Parameters:
incoming the new value

Reimplemented from GenericFilter.

Definition at line 48 of file SmoothFilter.cc.

References GenericFilter::value.


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

Generated on Sat Oct 4 21:30:30 2008 for Mace Library by  doxygen 1.5.5