![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Output the audio signal (*.bin) with filtering by IIR filter in the SD card using onboard CODEC. For *.wav file, F746_SD_WavPlayer and F746_SD_GraphicEqualiser are published on mbed. SD カードのオーディオ信号 (*.bin) を遮断周波数可変の IIR フィルタを通して,ボードに搭載されているCODEC で出力する.*.wav 形式のファイル用には,F746_SD_WavPlayer と F746_SD_GraphicEqualiser を mbed で公開している.
Dependencies: BSP_DISCO_F746NG_patch_fixed F746_GUI LCD_DISCO_F746NG SDFileSystem_Warning_Fixed TS_DISCO_F746NG mbed
Diff: MyClasses_Functions/DesignerDrawer.hpp
- Revision:
- 0:6748e3332e85
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/MyClasses_Functions/DesignerDrawer.hpp Fri Apr 08 13:11:53 2016 +0000 @@ -0,0 +1,72 @@ +//------------------------------------------------------------------------------ +// IIR フィルタを双一次 z 変換で設計し,その周波数特性を描画するためのクラス -- Header +// +// 2016/04/06, Copyright (c) 2016 MIKAMI, Naoki +//------------------------------------------------------------------------------ + +#ifndef F746_DISIGNER_AND_DRAWER_HPP +#define F746_DISIGNER_AND_DRAWER_HPP + +#include "NumericLabel.hpp" +#include "TouchPanelDetectorX.hpp" +#include "BiquadFrqRespDrawer.hpp" +#include "BilinearDesignLH.hpp" + +namespace Mikami +{ + class DesignerDrawer + { + public: + // Constructor + DesignerDrawer(uint16_t x0, uint16_t y0, + uint16_t db10, int fs, int order, + float fc, uint16_t fL, uint16_t fH, + BilinearDesign::Type lpHp); + + ~DesignerDrawer(); + + // フィルタの再設計と周波数特性の再描画 + bool ReDesignAndDraw(Biquad::Coefs *ck, float &g0, + BilinearDesign::Type lpHp); + + // 周波数特性の描画 + void DrawResponse(); + + void GetCoefficients(Biquad::Coefs *ck, float &g0); + + uint16_t GetOrder() { return ORDER_; } + + private: + LCD_DISCO_F746NG *lcd_; + TS_DISCO_F746NG *ts_; + + const uint16_t X0_, Y0_; + const uint16_t DB10_; + const uint16_t ORDER_; + const uint16_t CURSOR_Y0_, CURSOR_LENGTH_; + const uint16_t LOWER_F_, HIGHER_F_; + const uint32_t CURSOR_COLOR_, CURSOR_TOUCHED_COLOR_; + + BilinearDesign::Coefs *coefs_; // 設計された係数 + Biquad::Coefs *ck_; + float g0_; // 設計された係数(利得定数) + + int fC_; // 遮断周波数 + + uint16_t cursorX_, oldCursorX_; + bool cursorRedraw_; + BilinearDesign::Type lp_; + + BiquadFrqRespDrawer *drawerObj_; + BilinearDesign *designObj_; + TouchPanelDetectorX *tp_; + NumericLabel<int> *lblFrq_; + + // 周波数を 10, 20, 50, 100 Hz の倍数にする + int Frq10(float f); + + // 周波数特性の目盛線と目盛値の描画 + void DrawAxisNum(); + }; +} +#endif // F746_DISIGNER_AND_DRAWER_HPP