The moving average purpose is to filter some data that comes from a source that may be unprecise. See more information about Moving Average here: http://en.wikipedia.org/wiki/Moving_average
MovingAverage.h
- Committer:
- Alegrowin
- Date:
- 2013-04-14
- Revision:
- 0:226202c7ea37
File content as of revision 0:226202c7ea37:
#ifndef MOVING_AVERAGE_H
#define MOVING_AVERAGE_H
template <class T>
class MovingAverage
{
private:
T AverageFilter[];
T Average;
unsigned char NextElement;
unsigned char MaxLength;
public:
MovingAverage(unsigned char maxLength, T defaultValue);
T GetAverage();
void Insert(T value);
};
#endif