![](/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
MyClasses_Functions/DesignerDrawer.hpp@4:76aa20fb326a, 2016-04-16 (annotated)
- Committer:
- MikamiUitOpen
- Date:
- Sat Apr 16 13:53:53 2016 +0000
- Revision:
- 4:76aa20fb326a
- Child:
- 5:4a99dabc9180
4
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
MikamiUitOpen | 4:76aa20fb326a | 1 | //------------------------------------------------------------------------------ |
MikamiUitOpen | 4:76aa20fb326a | 2 | // IIR フィルタを双一次 z 変換で設計し,その周波数特性を描画するためのクラス -- Header |
MikamiUitOpen | 4:76aa20fb326a | 3 | // |
MikamiUitOpen | 4:76aa20fb326a | 4 | // 2016/04/16, Copyright (c) 2016 MIKAMI, Naoki |
MikamiUitOpen | 4:76aa20fb326a | 5 | //------------------------------------------------------------------------------ |
MikamiUitOpen | 4:76aa20fb326a | 6 | |
MikamiUitOpen | 4:76aa20fb326a | 7 | #ifndef F746_DISIGNER_AND_DRAWER_HPP |
MikamiUitOpen | 4:76aa20fb326a | 8 | #define F746_DISIGNER_AND_DRAWER_HPP |
MikamiUitOpen | 4:76aa20fb326a | 9 | |
MikamiUitOpen | 4:76aa20fb326a | 10 | #include "NumericLabel.hpp" |
MikamiUitOpen | 4:76aa20fb326a | 11 | #include "TouchPanelDetectorX.hpp" |
MikamiUitOpen | 4:76aa20fb326a | 12 | #include "FrquencyResponseDrawer.hpp" |
MikamiUitOpen | 4:76aa20fb326a | 13 | #include "Biquad.hpp" |
MikamiUitOpen | 4:76aa20fb326a | 14 | #include "BilinearDesignLH.hpp" |
MikamiUitOpen | 4:76aa20fb326a | 15 | #include "IIR_CascadeFrqResp.hpp" |
MikamiUitOpen | 4:76aa20fb326a | 16 | |
MikamiUitOpen | 4:76aa20fb326a | 17 | namespace Mikami |
MikamiUitOpen | 4:76aa20fb326a | 18 | { |
MikamiUitOpen | 4:76aa20fb326a | 19 | class DesignerDrawer |
MikamiUitOpen | 4:76aa20fb326a | 20 | { |
MikamiUitOpen | 4:76aa20fb326a | 21 | public: |
MikamiUitOpen | 4:76aa20fb326a | 22 | // Constructor |
MikamiUitOpen | 4:76aa20fb326a | 23 | DesignerDrawer(uint16_t x0, uint16_t y0, |
MikamiUitOpen | 4:76aa20fb326a | 24 | uint16_t db10, int fs, int order, |
MikamiUitOpen | 4:76aa20fb326a | 25 | float fc, uint16_t fL, uint16_t fH, |
MikamiUitOpen | 4:76aa20fb326a | 26 | BilinearDesign::Type lpHp); |
MikamiUitOpen | 4:76aa20fb326a | 27 | |
MikamiUitOpen | 4:76aa20fb326a | 28 | ~DesignerDrawer(); |
MikamiUitOpen | 4:76aa20fb326a | 29 | |
MikamiUitOpen | 4:76aa20fb326a | 30 | // フィルタの再設計と周波数特性の再描画 |
MikamiUitOpen | 4:76aa20fb326a | 31 | bool ReDesignAndDraw(Biquad::Coefs *ck, float &g0, |
MikamiUitOpen | 4:76aa20fb326a | 32 | BilinearDesign::Type lpHp); |
MikamiUitOpen | 4:76aa20fb326a | 33 | |
MikamiUitOpen | 4:76aa20fb326a | 34 | // 周波数特性の描画 |
MikamiUitOpen | 4:76aa20fb326a | 35 | void DrawResponse(); |
MikamiUitOpen | 4:76aa20fb326a | 36 | |
MikamiUitOpen | 4:76aa20fb326a | 37 | void GetCoefficients(Biquad::Coefs *ck, float &g0); |
MikamiUitOpen | 4:76aa20fb326a | 38 | |
MikamiUitOpen | 4:76aa20fb326a | 39 | uint16_t GetOrder() { return ORDER_; } |
MikamiUitOpen | 4:76aa20fb326a | 40 | |
MikamiUitOpen | 4:76aa20fb326a | 41 | private: |
MikamiUitOpen | 4:76aa20fb326a | 42 | LCD_DISCO_F746NG *lcd_; |
MikamiUitOpen | 4:76aa20fb326a | 43 | TS_DISCO_F746NG *ts_; |
MikamiUitOpen | 4:76aa20fb326a | 44 | |
MikamiUitOpen | 4:76aa20fb326a | 45 | const uint16_t X0_, Y0_; |
MikamiUitOpen | 4:76aa20fb326a | 46 | const uint16_t DB10_; |
MikamiUitOpen | 4:76aa20fb326a | 47 | const uint16_t ORDER_; |
MikamiUitOpen | 4:76aa20fb326a | 48 | const uint16_t CURSOR_Y0_, CURSOR_LENGTH_; |
MikamiUitOpen | 4:76aa20fb326a | 49 | const uint16_t LOWER_F_, HIGHER_F_; |
MikamiUitOpen | 4:76aa20fb326a | 50 | const uint32_t CURSOR_COLOR_, CURSOR_TOUCHED_COLOR_; |
MikamiUitOpen | 4:76aa20fb326a | 51 | |
MikamiUitOpen | 4:76aa20fb326a | 52 | IIR_CascadeFrqResp frqResp; // IIR フィルタの周波数応答に対応するオブジェクト |
MikamiUitOpen | 4:76aa20fb326a | 53 | BilinearDesign::Coefs *coefs_; // 設計された係数 |
MikamiUitOpen | 4:76aa20fb326a | 54 | Biquad::Coefs *ck_; |
MikamiUitOpen | 4:76aa20fb326a | 55 | float g0_; // 設計された係数(利得定数) |
MikamiUitOpen | 4:76aa20fb326a | 56 | |
MikamiUitOpen | 4:76aa20fb326a | 57 | int fC_; // 遮断周波数 |
MikamiUitOpen | 4:76aa20fb326a | 58 | |
MikamiUitOpen | 4:76aa20fb326a | 59 | uint16_t cursorX_, oldCursorX_; |
MikamiUitOpen | 4:76aa20fb326a | 60 | bool cursorRedraw_; |
MikamiUitOpen | 4:76aa20fb326a | 61 | BilinearDesign::Type lp_; |
MikamiUitOpen | 4:76aa20fb326a | 62 | |
MikamiUitOpen | 4:76aa20fb326a | 63 | FrqRespDrawer *drawerObj_; |
MikamiUitOpen | 4:76aa20fb326a | 64 | BilinearDesign *designObj_; |
MikamiUitOpen | 4:76aa20fb326a | 65 | TouchPanelDetectorX *tp_; |
MikamiUitOpen | 4:76aa20fb326a | 66 | NumericLabel<int> *lblFrq_; // 遮断周波数表示用 |
MikamiUitOpen | 4:76aa20fb326a | 67 | |
MikamiUitOpen | 4:76aa20fb326a | 68 | // 周波数を 10, 20, 50, 100 Hz の倍数にする |
MikamiUitOpen | 4:76aa20fb326a | 69 | int Frq10(float f); |
MikamiUitOpen | 4:76aa20fb326a | 70 | |
MikamiUitOpen | 4:76aa20fb326a | 71 | // 周波数特性の目盛線と目盛値の描画 |
MikamiUitOpen | 4:76aa20fb326a | 72 | void DrawAxisNum(); |
MikamiUitOpen | 4:76aa20fb326a | 73 | }; |
MikamiUitOpen | 4:76aa20fb326a | 74 | } |
MikamiUitOpen | 4:76aa20fb326a | 75 | #endif // F746_DISIGNER_AND_DRAWER_HPP |
MikamiUitOpen | 4:76aa20fb326a | 76 |