till
Dependencies: mbed
Fork of RT2_P3_students_G4 by
IIR_filter.h@6:8ed679044a72, 2018-04-17 (annotated)
- Committer:
- altb
- Date:
- Tue Apr 17 11:47:35 2018 +0000
- Revision:
- 6:8ed679044a72
- Parent:
- 2:769ce5f06d3e
RT2_P3_W2, 2nd session
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
altb | 6:8ed679044a72 | 1 | #ifndef IIR_FILTER_H_ |
altb | 6:8ed679044a72 | 2 | #define IIR_FILTER_H_ |
altb | 6:8ed679044a72 | 3 | |
altb | 0:78ca29b4c49e | 4 | class IIR_filter{ |
altb | 0:78ca29b4c49e | 5 | public: |
altb | 0:78ca29b4c49e | 6 | |
altb | 2:769ce5f06d3e | 7 | IIR_filter(float T, float Ts); |
altb | 2:769ce5f06d3e | 8 | IIR_filter(float T, float Ts, float K); |
altb | 2:769ce5f06d3e | 9 | IIR_filter(float w0, float D, float Ts, float K); |
altb | 2:769ce5f06d3e | 10 | IIR_filter(float *b, float *a, int nb_, int na_); |
altb | 0:78ca29b4c49e | 11 | |
altb | 0:78ca29b4c49e | 12 | float operator()(float u){ |
altb | 2:769ce5f06d3e | 13 | return filter((double)u); |
altb | 0:78ca29b4c49e | 14 | } |
altb | 0:78ca29b4c49e | 15 | virtual ~IIR_filter(); |
altb | 0:78ca29b4c49e | 16 | void reset(float); |
altb | 2:769ce5f06d3e | 17 | float filter(double); |
altb | 0:78ca29b4c49e | 18 | |
altb | 0:78ca29b4c49e | 19 | private: |
altb | 0:78ca29b4c49e | 20 | |
altb | 0:78ca29b4c49e | 21 | unsigned int nb; |
altb | 0:78ca29b4c49e | 22 | unsigned int na; |
altb | 2:769ce5f06d3e | 23 | double *B; |
altb | 2:769ce5f06d3e | 24 | double *A; |
altb | 2:769ce5f06d3e | 25 | double *uk; |
altb | 2:769ce5f06d3e | 26 | double *yk; |
altb | 2:769ce5f06d3e | 27 | double K; |
altb | 6:8ed679044a72 | 28 | }; |
altb | 6:8ed679044a72 | 29 | |
altb | 6:8ed679044a72 | 30 | #endif /* IIR_FILTER_H_ */ |