ya kno it
filter.h@1:db5970567c4d, 2017-10-27 (annotated)
- Committer:
- Thijs12va
- Date:
- Fri Oct 27 12:48:46 2017 +0000
- Revision:
- 1:db5970567c4d
- Parent:
- 0:09ae59836ddc
changed omega
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Thijs12va | 0:09ae59836ddc | 1 | #ifndef FILTERJWZ |
Thijs12va | 0:09ae59836ddc | 2 | #define FILTERJWZ |
Thijs12va | 0:09ae59836ddc | 3 | |
Thijs12va | 0:09ae59836ddc | 4 | #include "mbed.h" |
Thijs12va | 0:09ae59836ddc | 5 | //#include <math.h> |
Thijs12va | 0:09ae59836ddc | 6 | |
Thijs12va | 0:09ae59836ddc | 7 | class LowPass{ |
Thijs12va | 0:09ae59836ddc | 8 | public: |
Thijs12va | 0:09ae59836ddc | 9 | float yprev; |
Thijs12va | 0:09ae59836ddc | 10 | float a; |
Thijs12va | 0:09ae59836ddc | 11 | |
Thijs12va | 0:09ae59836ddc | 12 | float filter(float x); |
Thijs12va | 0:09ae59836ddc | 13 | }; |
Thijs12va | 0:09ae59836ddc | 14 | |
Thijs12va | 0:09ae59836ddc | 15 | class HighPass{ |
Thijs12va | 0:09ae59836ddc | 16 | public: |
Thijs12va | 0:09ae59836ddc | 17 | float xprev[2]; // to remember the 2 previous input values |
Thijs12va | 0:09ae59836ddc | 18 | float yprev; // to remember the previous output value |
Thijs12va | 0:09ae59836ddc | 19 | float a; /*RC / (RC + dt)*/ |
Thijs12va | 0:09ae59836ddc | 20 | |
Thijs12va | 0:09ae59836ddc | 21 | float filter(float x); |
Thijs12va | 0:09ae59836ddc | 22 | }; |
Thijs12va | 0:09ae59836ddc | 23 | |
Thijs12va | 0:09ae59836ddc | 24 | class Notch{ |
Thijs12va | 0:09ae59836ddc | 25 | public: |
Thijs12va | 0:09ae59836ddc | 26 | float xprev[3]; |
Thijs12va | 0:09ae59836ddc | 27 | float yprev[2]; |
Thijs12va | 0:09ae59836ddc | 28 | float lambda; |
Thijs12va | 0:09ae59836ddc | 29 | float b; |
Thijs12va | 0:09ae59836ddc | 30 | |
Thijs12va | 0:09ae59836ddc | 31 | float filter(float x); |
Thijs12va | 0:09ae59836ddc | 32 | }; |
Thijs12va | 0:09ae59836ddc | 33 | |
Thijs12va | 0:09ae59836ddc | 34 | class ButterLow{ |
Thijs12va | 0:09ae59836ddc | 35 | public: |
Thijs12va | 0:09ae59836ddc | 36 | float xprev[3]; |
Thijs12va | 0:09ae59836ddc | 37 | float yprev[2]; |
Thijs12va | 0:09ae59836ddc | 38 | float w; //wc: cutoff frequency |
Thijs12va | 0:09ae59836ddc | 39 | |
Thijs12va | 0:09ae59836ddc | 40 | float filter(float x); |
Thijs12va | 0:09ae59836ddc | 41 | }; |
Thijs12va | 0:09ae59836ddc | 42 | |
Thijs12va | 0:09ae59836ddc | 43 | #endif |