ya kno it
Diff: filter.h
- Revision:
- 0:09ae59836ddc
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/filter.h Wed Oct 25 12:35:24 2017 +0000 @@ -0,0 +1,43 @@ +#ifndef FILTERJWZ +#define FILTERJWZ + +#include "mbed.h" +//#include <math.h> + +class LowPass{ + public: + float yprev; + float a; + + float filter(float x); +}; + +class HighPass{ + public: + float xprev[2]; // to remember the 2 previous input values + float yprev; // to remember the previous output value + float a; /*RC / (RC + dt)*/ + + float filter(float x); +}; + +class Notch{ + public: + float xprev[3]; + float yprev[2]; + float lambda; + float b; + + float filter(float x); +}; + +class ButterLow{ + public: + float xprev[3]; + float yprev[2]; + float w; //wc: cutoff frequency + + float filter(float x); +}; + +#endif \ No newline at end of file