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

Revision:
8:12aa05f3cc24
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MyClasses_Functions/DesignerDrawer.hpp	Mon May 09 08:54:09 2016 +0000
@@ -0,0 +1,64 @@
+//------------------------------------------------------------------------------
+//  イコライザ用フィルタのパラメータを設定し,その周波数特性を描画するためのクラス -- Header
+//  
+//  2016/05/09, Copyright (c) 2016 MIKAMI, Naoki
+//------------------------------------------------------------------------------
+
+#ifndef F746_DISIGNER_AND_DRAWER_HPP
+#define F746_DISIGNER_AND_DRAWER_HPP
+
+#include "NumericLabel.hpp"
+#include "FrquencyResponseDrawer.hpp"
+#include "GrEqParamsCalculator.hpp"
+#include "GrEqualizerFrqResp.hpp"
+
+namespace Mikami
+{
+    class DesignerDrawer
+    {
+    public:
+        // Constructor
+        DesignerDrawer(uint16_t x0, uint16_t y0,
+                       int stages, float f0, int fs, float db1);
+
+        ~DesignerDrawer();
+
+        // 周波数特性の描画
+        void DrawResponse();
+
+        // 周波数特性の平坦化と描画
+        void DrawFlat();
+
+        // 特定のバンドのイコライザ用フィルタのパラメータの設定と周波数特性の再描画
+        void DesignAndRedraw(float gainDb, int n);
+
+        void GetCoefficients(BiquadGrEq::Coefs ck[])
+        {   for (int n=0; n<BANDS_; n++) ck[n] = ck_[n]; }
+        
+        BiquadGrEq::Coefs GetCoefficient(int n) { return ck_[n]; }
+
+        uint16_t GetX0()
+        {   return drawerObj_->X(f0_[0]); }
+        
+        uint16_t GetSpaceX()
+        {   return (uint16_t)(drawerObj_->X(f0_[1])
+                            - drawerObj_->X(f0_[0])); }
+
+        int GetStages() { return BANDS_; }
+
+    private:
+        LCD_DISCO_F746NG *lcd_;
+        TS_DISCO_F746NG *ts_;
+
+        const uint16_t X0_, Y0_;
+        const int BANDS_;
+        const float Q_VAL_;
+
+        float *f0_;         // 中心周波数を格納する配列のポインタ
+        GrEqParams *calculator_;
+        GrEqualizerFrqResp *frqResp_;   // フィルタの周波数応答に対応するオブジェクト
+        BiquadGrEq::Coefs *ck_;         // フィルタの係数
+        FrqRespDrawer *drawerObj_;
+    };
+}
+#endif  // F746_DISIGNER_AND_DRAWER_HPP