a floating median filter to filter floating point data such as analog inputs

Dependents:   Quadcopter_mk2

Fork of filter by Ad van der Weiden

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers filter.h Source File

filter.h

00001 #ifndef FILTER_H
00002 #define FILTER_H
00003 
00004 class filter 
00005 {
00006   private:
00007     int N;
00008     double *val;
00009     bool *big;
00010     int med, i;
00011     double median;
00012     int findmax();
00013     int findmin();
00014 
00015   public:
00016     filter(int window = 3); //every window >= 1 is allowed but the behaviour for even window sizes is not well defined
00017     double process(double);
00018     double getMedian();
00019 };
00020 
00021 #endif