1次遅れと2次遅れ,ノッチフィルターを実装
Fork of Filter by
Filter.h@6:13ff4bea3c83, 2018-03-22 (annotated)
- Committer:
- uenono
- Date:
- Thu Mar 22 12:36:55 2018 +0000
- Revision:
- 6:13ff4bea3c83
- Parent:
- 5:ab6351c18264
second-order-lag???
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
uenono | 0:17706252d1ed | 1 | #include "mbed.h" |
uenono | 0:17706252d1ed | 2 | |
uenono | 0:17706252d1ed | 3 | class Filter |
uenono | 0:17706252d1ed | 4 | { |
uenono | 0:17706252d1ed | 5 | public: |
uenono | 0:17706252d1ed | 6 | double T_LPF; |
uenono | 0:17706252d1ed | 7 | double Om_n; |
uenono | 0:17706252d1ed | 8 | double sq_dt; |
uenono | 0:17706252d1ed | 9 | double sq_Om; |
uenono | 6:13ff4bea3c83 | 10 | |
uenono | 6:13ff4bea3c83 | 11 | double omega; |
uenono | 6:13ff4bea3c83 | 12 | double dzeta; |
uenono | 0:17706252d1ed | 13 | |
uenono | 1:637f9a61b133 | 14 | Filter(double); |
uenono | 4:fc9412c8334e | 15 | void setLowPassPara(double T, double init_data); |
uenono | 0:17706252d1ed | 16 | double LowPassFilter(double input); |
uenono | 6:13ff4bea3c83 | 17 | |
uenono | 6:13ff4bea3c83 | 18 | void setSecondOrderPara(double xOmega, double xDzeta, double init_data); |
uenono | 6:13ff4bea3c83 | 19 | double SecondOrderLag(double input); |
uenono | 6:13ff4bea3c83 | 20 | |
uenono | 5:ab6351c18264 | 21 | void setNotchPara(double Omega, double init_data); |
uenono | 0:17706252d1ed | 22 | double NotchFilter(double input); |
uenono | 1:637f9a61b133 | 23 | |
uenono | 1:637f9a61b133 | 24 | private: |
uenono | 2:a842c1a33e4f | 25 | double int_time; |
uenono | 3:987d5d78f863 | 26 | double preOutput; |
uenono | 3:987d5d78f863 | 27 | bool set_t; |
uenono | 5:ab6351c18264 | 28 | |
uenono | 6:13ff4bea3c83 | 29 | double prev_output1, prev_output2; |
uenono | 6:13ff4bea3c83 | 30 | bool set_secorder; |
uenono | 6:13ff4bea3c83 | 31 | |
uenono | 5:ab6351c18264 | 32 | double n_preOutput[2]; |
uenono | 5:ab6351c18264 | 33 | double n_preInput[2]; |
uenono | 0:17706252d1ed | 34 | |
uenono | 0:17706252d1ed | 35 | }; |