![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
revised version of F746_SD_GraphicEqualizer
Dependencies: BSP_DISCO_F746NG F746_GUI F746_SAI_IO FrequencyResponseDrawer LCD_DISCO_F746NG SDFileSystem_Warning_Fixed TS_DISCO_F746NG mbed
Fork of F746_SD_GraphicEqualizer by
MyClasses_Functions/DesignerDrawer.hpp@2:2a5c93bf729a, 2016-05-01 (annotated)
- Committer:
- MikamiUitOpen
- Date:
- Sun May 01 02:44:30 2016 +0000
- Revision:
- 2:2a5c93bf729a
- Parent:
- 0:e953eb392151
- Child:
- 6:599229a1b06a
3
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MikamiUitOpen | 0:e953eb392151 | 1 | //------------------------------------------------------------------------------ |
MikamiUitOpen | 0:e953eb392151 | 2 | // イコライザ用フィルタのパラメータを設定し,その周波数特性を描画するためのクラス -- Header |
MikamiUitOpen | 0:e953eb392151 | 3 | // |
MikamiUitOpen | 2:2a5c93bf729a | 4 | // 2016/05/01, Copyright (c) 2016 MIKAMI, Naoki |
MikamiUitOpen | 0:e953eb392151 | 5 | //------------------------------------------------------------------------------ |
MikamiUitOpen | 0:e953eb392151 | 6 | |
MikamiUitOpen | 0:e953eb392151 | 7 | #ifndef F746_DISIGNER_AND_DRAWER_HPP |
MikamiUitOpen | 0:e953eb392151 | 8 | #define F746_DISIGNER_AND_DRAWER_HPP |
MikamiUitOpen | 0:e953eb392151 | 9 | |
MikamiUitOpen | 0:e953eb392151 | 10 | #include "NumericLabel.hpp" |
MikamiUitOpen | 0:e953eb392151 | 11 | #include "FrquencyResponseDrawer.hpp" |
MikamiUitOpen | 0:e953eb392151 | 12 | #include "GrEqParamsCalculator.hpp" |
MikamiUitOpen | 0:e953eb392151 | 13 | #include "GrEqualizerFrqResp.hpp" |
MikamiUitOpen | 0:e953eb392151 | 14 | |
MikamiUitOpen | 0:e953eb392151 | 15 | namespace Mikami |
MikamiUitOpen | 0:e953eb392151 | 16 | { |
MikamiUitOpen | 0:e953eb392151 | 17 | class DesignerDrawer |
MikamiUitOpen | 0:e953eb392151 | 18 | { |
MikamiUitOpen | 0:e953eb392151 | 19 | public: |
MikamiUitOpen | 0:e953eb392151 | 20 | // Constructor |
MikamiUitOpen | 0:e953eb392151 | 21 | DesignerDrawer(uint16_t x0, uint16_t y0, |
MikamiUitOpen | 2:2a5c93bf729a | 22 | int stages, float f0, int fs, float db1); |
MikamiUitOpen | 0:e953eb392151 | 23 | |
MikamiUitOpen | 0:e953eb392151 | 24 | ~DesignerDrawer(); |
MikamiUitOpen | 0:e953eb392151 | 25 | |
MikamiUitOpen | 0:e953eb392151 | 26 | // 周波数特性の描画 |
MikamiUitOpen | 0:e953eb392151 | 27 | void DrawResponse(); |
MikamiUitOpen | 0:e953eb392151 | 28 | |
MikamiUitOpen | 0:e953eb392151 | 29 | // 特定のバンドのイコライザ用フィルタのパラメータの設定と周波数特性の再描画 |
MikamiUitOpen | 0:e953eb392151 | 30 | void DesignAndRedraw(float gainDb, int n); |
MikamiUitOpen | 0:e953eb392151 | 31 | |
MikamiUitOpen | 0:e953eb392151 | 32 | void GetCoefficients(BiquadGrEq::Coefs ck[]) |
MikamiUitOpen | 0:e953eb392151 | 33 | { for (int n=0; n<STAGES_; n++) ck[n] = ck_[n]; } |
MikamiUitOpen | 0:e953eb392151 | 34 | |
MikamiUitOpen | 0:e953eb392151 | 35 | BiquadGrEq::Coefs GetCoefficient(int n) { return ck_[n]; } |
MikamiUitOpen | 0:e953eb392151 | 36 | |
MikamiUitOpen | 0:e953eb392151 | 37 | uint16_t GetX0() |
MikamiUitOpen | 0:e953eb392151 | 38 | { return drawerObj_->X(f0_[0]); } |
MikamiUitOpen | 0:e953eb392151 | 39 | |
MikamiUitOpen | 0:e953eb392151 | 40 | uint16_t GetSpaceX() |
MikamiUitOpen | 0:e953eb392151 | 41 | { return (uint16_t)(drawerObj_->X(f0_[1]) |
MikamiUitOpen | 0:e953eb392151 | 42 | - drawerObj_->X(f0_[0])); } |
MikamiUitOpen | 0:e953eb392151 | 43 | |
MikamiUitOpen | 0:e953eb392151 | 44 | int GetStages() { return STAGES_; } |
MikamiUitOpen | 0:e953eb392151 | 45 | |
MikamiUitOpen | 0:e953eb392151 | 46 | private: |
MikamiUitOpen | 0:e953eb392151 | 47 | LCD_DISCO_F746NG *lcd_; |
MikamiUitOpen | 0:e953eb392151 | 48 | TS_DISCO_F746NG *ts_; |
MikamiUitOpen | 0:e953eb392151 | 49 | |
MikamiUitOpen | 0:e953eb392151 | 50 | const uint16_t X0_, Y0_; |
MikamiUitOpen | 0:e953eb392151 | 51 | const int STAGES_; |
MikamiUitOpen | 0:e953eb392151 | 52 | const float Q_VAL_; |
MikamiUitOpen | 0:e953eb392151 | 53 | |
MikamiUitOpen | 2:2a5c93bf729a | 54 | float *f0_; // 中心周波数を格納する配列のポインタ |
MikamiUitOpen | 0:e953eb392151 | 55 | GrEqParamsCalculator *calculator_; |
MikamiUitOpen | 0:e953eb392151 | 56 | GrEqualizerFrqResp *frqResp_; // フィルタの周波数応答に対応するオブジェクト |
MikamiUitOpen | 0:e953eb392151 | 57 | BiquadGrEq::Coefs *ck_; // フィルタの係数 |
MikamiUitOpen | 0:e953eb392151 | 58 | FrqRespDrawer *drawerObj_; |
MikamiUitOpen | 0:e953eb392151 | 59 | }; |
MikamiUitOpen | 0:e953eb392151 | 60 | } |
MikamiUitOpen | 0:e953eb392151 | 61 | #endif // F746_DISIGNER_AND_DRAWER_HPP |