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 不韋 呂

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers DesignerDrawer.hpp Source File

DesignerDrawer.hpp

00001 //------------------------------------------------------------------------------
00002 //  イコライザ用フィルタのパラメータを設定し,その周波数特性を描画するためのクラス -- Header
00003 //  
00004 //  2016/05/09, 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 "FrquencyResponseDrawer.hpp"
00012 #include "GrEqParamsCalculator.hpp"
00013 #include "GrEqualizerFrqResp.hpp"
00014 
00015 namespace Mikami
00016 {
00017     class DesignerDrawer
00018     {
00019     public:
00020         // Constructor
00021         DesignerDrawer(uint16_t x0, uint16_t y0,
00022                        int stages, float f0, int fs, float db1);
00023 
00024         ~DesignerDrawer();
00025 
00026         // 周波数特性の描画
00027         void DrawResponse();
00028 
00029         // 周波数特性の平坦化と描画
00030         void DrawFlat();
00031 
00032         // 特定のバンドのイコライザ用フィルタのパラメータの設定と周波数特性の再描画
00033         void DesignAndRedraw(float gainDb, int n);
00034 
00035         void GetCoefficients(BiquadGrEq::Coefs ck[])
00036         {   for (int n=0; n<BANDS_; n++) ck[n] = ck_[n]; }
00037         
00038         BiquadGrEq::Coefs GetCoefficient(int n) { return ck_[n]; }
00039 
00040         uint16_t GetX0()
00041         {   return drawerObj_->X(f0_[0]); }
00042         
00043         uint16_t GetSpaceX()
00044         {   return (uint16_t)(drawerObj_->X(f0_[1])
00045                             - drawerObj_->X(f0_[0])); }
00046 
00047         int GetStages() { return BANDS_; }
00048 
00049     private:
00050         LCD_DISCO_F746NG *lcd_;
00051         TS_DISCO_F746NG *ts_;
00052 
00053         const uint16_t X0_, Y0_;
00054         const int BANDS_;
00055         const float Q_VAL_;
00056 
00057         float *f0_;         // 中心周波数を格納する配列のポインタ
00058         GrEqParams *calculator_;
00059         GrEqualizerFrqResp *frqResp_;   // フィルタの周波数応答に対応するオブジェクト
00060         BiquadGrEq::Coefs *ck_;         // フィルタの係数
00061         FrqRespDrawer *drawerObj_;
00062     };
00063 }
00064 #endif  // F746_DISIGNER_AND_DRAWER_HPP