Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
DesignerDrawer.hpp
00001 //------------------------------------------------------------------------------ 00002 // IIR フィルタを双一次 z 変換で設計し,その周波数特性を描画するためのクラス -- Header 00003 // 00004 // 2016/05/01, Copyright (c) 2016 MIKAMI, Naoki 00005 //------------------------------------------------------------------------------ 00006 00007 #ifndef F746_DISIGNER_AND_DRAWER_HPP 00008 #define F746_DISIGNER_AND_DRAWER_HPP 00009 00010 #include "NumericLabel.hpp" 00011 #include "TouchPanelDetectorX.hpp" 00012 #include "FrquencyResponseDrawer.hpp" 00013 #include "BilinearDesignLH.hpp" 00014 #include "IIR_CascadeFrqResp.hpp" 00015 00016 namespace Mikami 00017 { 00018 class DesignerDrawer 00019 { 00020 public: 00021 // Constructor 00022 DesignerDrawer(uint16_t x0, uint16_t y0, 00023 float db1, int fs, int order, 00024 float fc, uint16_t fL, uint16_t fH, 00025 BilinearDesign::Type lpHp); 00026 00027 ~DesignerDrawer(); 00028 00029 // フィルタの再設計と周波数特性の再描画 00030 bool ReDesignAndDraw(Biquad::Coefs *ck, float &g0, 00031 BilinearDesign::Type lpHp); 00032 00033 // 周波数特性の描画 00034 void DrawResponse(); 00035 00036 void GetCoefficients(Biquad::Coefs *ck, float &g0); 00037 00038 uint16_t GetOrder() { return ORDER_; } 00039 00040 private: 00041 LCD_DISCO_F746NG *lcd_; 00042 TS_DISCO_F746NG *ts_; 00043 00044 const uint16_t X0_, Y0_; 00045 const uint16_t ORDER_; 00046 const uint16_t CURSOR_Y0_, CURSOR_LENGTH_; 00047 const uint16_t LOWER_F_, HIGHER_F_; 00048 const uint32_t CURSOR_COLOR_, CURSOR_TOUCHED_COLOR_; 00049 00050 IIR_CascadeFrqResp *frqResp_; // IIR フィルタの周波数応答に対応するオブジェクト 00051 BilinearDesign::Coefs *coefs_; // 設計された係数 00052 Biquad::Coefs *ck_; 00053 float g0_; // 設計された係数(利得定数) 00054 00055 int fC_; // 遮断周波数 00056 00057 uint16_t cursorX_, oldCursorX_; 00058 bool cursorRedraw_; 00059 BilinearDesign::Type lp_; 00060 00061 FrqRespDrawer *drawerObj_; 00062 BilinearDesign *designObj_; 00063 TouchPanelDetectorX *tp_; 00064 NumericLabel<int> *lblFrq_; // 遮断周波数表示用 00065 00066 // 周波数を 10, 20, 50, 100 Hz の倍数にする 00067 int Frq10(float f); 00068 }; 00069 } 00070 #endif // F746_DISIGNER_AND_DRAWER_HPP
Generated on Fri Aug 5 2022 02:03:47 by
