A simple biquad filter
Dependents: emgfilter includeair includeair Encodertest ... more
Biquad.h@2:3a80d1f8f30a, 2015-10-29 (annotated)
- Committer:
- Gerth
- Date:
- Thu Oct 29 14:03:02 2015 +0000
- Revision:
- 2:3a80d1f8f30a
- Parent:
- 1:11e0eb82cb18
converted floats to doubles
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Gerth | 0:ba910c57d594 | 1 | #ifndef _BIQUAD_H_ |
Gerth | 0:ba910c57d594 | 2 | #define _BIQUAD_H_ |
Gerth | 0:ba910c57d594 | 3 | |
Gerth | 0:ba910c57d594 | 4 | #include "mbed.h" |
Gerth | 0:ba910c57d594 | 5 | |
Gerth | 0:ba910c57d594 | 6 | class Biquad |
Gerth | 0:ba910c57d594 | 7 | { |
Gerth | 0:ba910c57d594 | 8 | public: |
Gerth | 0:ba910c57d594 | 9 | ///Instantiate the biquad filter |
Gerth | 0:ba910c57d594 | 10 | Biquad(void); |
Gerth | 0:ba910c57d594 | 11 | |
Gerth | 1:11e0eb82cb18 | 12 | /**Filters the given signal with the filter values. |
Gerth | 2:3a80d1f8f30a | 13 | * @param u : double signal to filter |
Gerth | 2:3a80d1f8f30a | 14 | * @param &v1 : double variable to store previous values |
Gerth | 2:3a80d1f8f30a | 15 | * @param &v2 : double variable to store previous values |
Gerth | 2:3a80d1f8f30a | 16 | * @param a1 : double filter coefficient a1 |
Gerth | 2:3a80d1f8f30a | 17 | * @param a1 : double filter coefficient a2 |
Gerth | 2:3a80d1f8f30a | 18 | * @param a1 : double filter coefficient b0 |
Gerth | 2:3a80d1f8f30a | 19 | * @param a1 : double filter coefficient b1 |
Gerth | 2:3a80d1f8f30a | 20 | * @param a1 : double filter coefficient b2 |
Gerth | 2:3a80d1f8f30a | 21 | * @return v : double filtered signal |
Gerth | 0:ba910c57d594 | 22 | */ |
Gerth | 0:ba910c57d594 | 23 | double filter( double u, double &v1, double &v2, const double a1, const double a2, |
Gerth | 0:ba910c57d594 | 24 | const double b0, const double b1, const double b2 ); |
Gerth | 0:ba910c57d594 | 25 | }; |
Gerth | 0:ba910c57d594 | 26 | #endif |