Moving Average

Dependents:   MovingAverage_HelloWorld Levitator EMG_Realtime_Filter EMG_Calibration ... more

Fork of MoyenneMobile by Alexandre Proulx

Committer:
Alegrowin
Date:
Sun Apr 14 01:02:39 2013 +0000
Revision:
0:226202c7ea37
Child:
1:b310d132db09
Initial Commit; ; This library purpose is to provide a tool to filter data from a source that is not precise enough,; ; Read more here:http://en.wikipedia.org/wiki/Moving_average

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Alegrowin 0:226202c7ea37 1 #ifndef MOVING_AVERAGE_H
Alegrowin 0:226202c7ea37 2 #define MOVING_AVERAGE_H
Alegrowin 0:226202c7ea37 3
Alegrowin 0:226202c7ea37 4 template <class T>
Alegrowin 0:226202c7ea37 5 class MovingAverage
Alegrowin 0:226202c7ea37 6 {
Alegrowin 0:226202c7ea37 7 private:
Alegrowin 0:226202c7ea37 8 T AverageFilter[];
Alegrowin 0:226202c7ea37 9 T Average;
Alegrowin 0:226202c7ea37 10
Alegrowin 0:226202c7ea37 11 unsigned char NextElement;
Alegrowin 0:226202c7ea37 12 unsigned char MaxLength;
Alegrowin 0:226202c7ea37 13 public:
Alegrowin 0:226202c7ea37 14 MovingAverage(unsigned char maxLength, T defaultValue);
Alegrowin 0:226202c7ea37 15 T GetAverage();
Alegrowin 0:226202c7ea37 16 void Insert(T value);
Alegrowin 0:226202c7ea37 17 };
Alegrowin 0:226202c7ea37 18
Alegrowin 0:226202c7ea37 19 #endif