?
DesignerDrawer.hpp@0:cacfc9e25452, 2019-06-04 (annotated)
- Committer:
- phungductung
- Date:
- Tue Jun 04 21:58:08 2019 +0000
- Revision:
- 0:cacfc9e25452
?;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
phungductung | 0:cacfc9e25452 | 1 | //------------------------------------------------------------------------------ |
phungductung | 0:cacfc9e25452 | 2 | // IIR フィルタを双一次 z 変換で設計し,その周波数特性を描画するためのクラス -- Header |
phungductung | 0:cacfc9e25452 | 3 | // |
phungductung | 0:cacfc9e25452 | 4 | // 2016/05/01, Copyright (c) 2016 MIKAMI, Naoki |
phungductung | 0:cacfc9e25452 | 5 | //------------------------------------------------------------------------------ |
phungductung | 0:cacfc9e25452 | 6 | |
phungductung | 0:cacfc9e25452 | 7 | #ifndef F746_DISIGNER_AND_DRAWER_HPP |
phungductung | 0:cacfc9e25452 | 8 | #define F746_DISIGNER_AND_DRAWER_HPP |
phungductung | 0:cacfc9e25452 | 9 | |
phungductung | 0:cacfc9e25452 | 10 | #include "NumericLabel.hpp" |
phungductung | 0:cacfc9e25452 | 11 | #include "TouchPanelDetectorX.hpp" |
phungductung | 0:cacfc9e25452 | 12 | #include "FrquencyResponseDrawer.hpp" |
phungductung | 0:cacfc9e25452 | 13 | #include "BilinearDesignLH.hpp" |
phungductung | 0:cacfc9e25452 | 14 | #include "IIR_CascadeFrqResp.hpp" |
phungductung | 0:cacfc9e25452 | 15 | |
phungductung | 0:cacfc9e25452 | 16 | namespace Mikami |
phungductung | 0:cacfc9e25452 | 17 | { |
phungductung | 0:cacfc9e25452 | 18 | class DesignerDrawer |
phungductung | 0:cacfc9e25452 | 19 | { |
phungductung | 0:cacfc9e25452 | 20 | public: |
phungductung | 0:cacfc9e25452 | 21 | // Constructor |
phungductung | 0:cacfc9e25452 | 22 | DesignerDrawer(uint16_t x0, uint16_t y0, |
phungductung | 0:cacfc9e25452 | 23 | float db1, int fs, int order, |
phungductung | 0:cacfc9e25452 | 24 | float fc, uint16_t fL, uint16_t fH, |
phungductung | 0:cacfc9e25452 | 25 | BilinearDesign::Type lpHp); |
phungductung | 0:cacfc9e25452 | 26 | |
phungductung | 0:cacfc9e25452 | 27 | ~DesignerDrawer(); |
phungductung | 0:cacfc9e25452 | 28 | |
phungductung | 0:cacfc9e25452 | 29 | // フィルタの再設計と周波数特性の再描画 |
phungductung | 0:cacfc9e25452 | 30 | bool ReDesignAndDraw(Biquad::Coefs *ck, float &g0, |
phungductung | 0:cacfc9e25452 | 31 | BilinearDesign::Type lpHp); |
phungductung | 0:cacfc9e25452 | 32 | |
phungductung | 0:cacfc9e25452 | 33 | // 周波数特性の描画 |
phungductung | 0:cacfc9e25452 | 34 | void DrawResponse(); |
phungductung | 0:cacfc9e25452 | 35 | |
phungductung | 0:cacfc9e25452 | 36 | void GetCoefficients(Biquad::Coefs *ck, float &g0); |
phungductung | 0:cacfc9e25452 | 37 | |
phungductung | 0:cacfc9e25452 | 38 | uint16_t GetOrder() { return ORDER_; } |
phungductung | 0:cacfc9e25452 | 39 | |
phungductung | 0:cacfc9e25452 | 40 | private: |
phungductung | 0:cacfc9e25452 | 41 | LCD_DISCO_F746NG *lcd_; |
phungductung | 0:cacfc9e25452 | 42 | TS_DISCO_F746NG *ts_; |
phungductung | 0:cacfc9e25452 | 43 | |
phungductung | 0:cacfc9e25452 | 44 | const uint16_t X0_, Y0_; |
phungductung | 0:cacfc9e25452 | 45 | const uint16_t ORDER_; |
phungductung | 0:cacfc9e25452 | 46 | const uint16_t CURSOR_Y0_, CURSOR_LENGTH_; |
phungductung | 0:cacfc9e25452 | 47 | const uint16_t LOWER_F_, HIGHER_F_; |
phungductung | 0:cacfc9e25452 | 48 | const uint32_t CURSOR_COLOR_, CURSOR_TOUCHED_COLOR_; |
phungductung | 0:cacfc9e25452 | 49 | |
phungductung | 0:cacfc9e25452 | 50 | IIR_CascadeFrqResp *frqResp_; // IIR フィルタの周波数応答に対応するオブジェクト |
phungductung | 0:cacfc9e25452 | 51 | BilinearDesign::Coefs *coefs_; // 設計された係数 |
phungductung | 0:cacfc9e25452 | 52 | Biquad::Coefs *ck_; |
phungductung | 0:cacfc9e25452 | 53 | float g0_; // 設計された係数(利得定数) |
phungductung | 0:cacfc9e25452 | 54 | |
phungductung | 0:cacfc9e25452 | 55 | int fC_; // 遮断周波数 |
phungductung | 0:cacfc9e25452 | 56 | |
phungductung | 0:cacfc9e25452 | 57 | uint16_t cursorX_, oldCursorX_; |
phungductung | 0:cacfc9e25452 | 58 | bool cursorRedraw_; |
phungductung | 0:cacfc9e25452 | 59 | BilinearDesign::Type lp_; |
phungductung | 0:cacfc9e25452 | 60 | |
phungductung | 0:cacfc9e25452 | 61 | FrqRespDrawer *drawerObj_; |
phungductung | 0:cacfc9e25452 | 62 | BilinearDesign *designObj_; |
phungductung | 0:cacfc9e25452 | 63 | TouchPanelDetectorX *tp_; |
phungductung | 0:cacfc9e25452 | 64 | NumericLabel<int> *lblFrq_; // 遮断周波数表示用 |
phungductung | 0:cacfc9e25452 | 65 | |
phungductung | 0:cacfc9e25452 | 66 | // 周波数を 10, 20, 50, 100 Hz の倍数にする |
phungductung | 0:cacfc9e25452 | 67 | int Frq10(float f); |
phungductung | 0:cacfc9e25452 | 68 | }; |
phungductung | 0:cacfc9e25452 | 69 | } |
phungductung | 0:cacfc9e25452 | 70 | #endif // F746_DISIGNER_AND_DRAWER_HPP |