Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: MedianFilter.hpp
- Revision:
- 1:7e434a01533c
- Parent:
- 0:49e6de85e2fb
- Child:
- 3:ec86928ff12d
diff -r 49e6de85e2fb -r 7e434a01533c MedianFilter.hpp
--- a/MedianFilter.hpp Mon Sep 26 17:48:46 2016 +0000
+++ b/MedianFilter.hpp Mon Sep 26 20:45:46 2016 +0200
@@ -0,0 +1,19 @@
+#ifndef MEDIANFILTER_H
+#define MEDIANFILTER_H
+
+#include <deque>
+#include <algorithm>
+
+class MedianFilter
+{
+public:
+ MedianFilter(int size = 3);
+
+ float Process(float val);
+
+private:
+ int _size;
+ int _n;
+ deque<float> _window;
+};
+#endif