mit pathdingsbums
Dependencies: mbed
Fork of MicroMouse_MASTER_TWO by
Diff: LowpassFilter.h
- Revision:
- 1:d9e840c48b1e
- Parent:
- 0:a9fe4ef404bf
--- a/LowpassFilter.h Wed Mar 07 14:06:19 2018 +0000 +++ b/LowpassFilter.h Sat Mar 31 16:45:57 2018 +0000 @@ -14,25 +14,26 @@ * This filter can typically be used within a periodic task that takes measurements that need * to be filtered, like speed or position values. */ -class LowpassFilter { - - public: - - LowpassFilter(); - virtual ~LowpassFilter(); - void reset(); - void reset(float value); - void setPeriod(float period); - void setFrequency(float frequency); - float getFrequency(); - float filter(float value); - - private: - - float period; - float frequency; - float a11, a12, a21, a22, b1, b2; - float x1, x2; +class LowpassFilter +{ + +public: + + LowpassFilter(); + virtual ~LowpassFilter(); + void reset(); + void reset(float value); + void setPeriod(float period); + void setFrequency(float frequency); + float getFrequency(); + float filter(float value); + +private: + + float period; + float frequency; + float a11, a12, a21, a22, b1, b2; + float x1, x2; }; #endif /* LOWPASS_FILTER_H_ */