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