a floating median filter to filter floating point data such as analog inputs
Fork of filter by
Diff: filter.h
- Revision:
- 1:9ce370b360ba
- Parent:
- 0:46a72e790df8
diff -r 46a72e790df8 -r 9ce370b360ba filter.h --- a/filter.h Wed Feb 16 20:05:42 2011 +0000 +++ b/filter.h Wed Apr 01 11:18:55 2015 +0000 @@ -1,24 +1,21 @@ #ifndef FILTER_H #define FILTER_H -class filter { -public: - virtual float process(float in) { - return in; - } -}; - -class medianFilter: public filter { +class filter +{ + private: int N; - float *val; + double *val; bool *big; int med, i; - float median; + double median; int findmax(); int findmin(); -public: - medianFilter(int window = 3); //every window >= 1 is allowed but the behaviour for even window sizes is not well defined - virtual float process(float); + + public: + filter(int window = 3); //every window >= 1 is allowed but the behaviour for even window sizes is not well defined + double process(double); + double getMedian(); }; #endif \ No newline at end of file