MovingAverage template
Fork of MoyenneMobile by
Diff: MovingAverage.h
- Revision:
- 0:226202c7ea37
- Child:
- 1:b310d132db09
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/MovingAverage.h Sun Apr 14 01:02:39 2013 +0000
@@ -0,0 +1,19 @@
+#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
\ No newline at end of file
frederic blanc
