Output the audio signal with filtering by IIR filter in the *.wav file on the SD card using onboard CODEC. SD カードの *.wav ファイルのオーディオ信号を遮断周波数可変の IIR フィルタを通して,ボードに搭載されているCODEC で出力する.
Dependencies: BSP_DISCO_F746NG F746_GUI LCD_DISCO_F746NG SDFileSystem_Warning_Fixed TS_DISCO_F746NG mbed FrequencyResponseDrawer F746_SAI_IO Array_Matrix
DesignerDrawer.hpp
00001 //------------------------------------------------------------------------------ 00002 // IIR フィルタを双一次 z 変換で設計し,その周波数特性を描画するためのクラス -- Header 00003 // 00004 // 2016/05/01, 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 "TouchPanelDetectorX.hpp" 00012 #include "FrquencyResponseDrawer.hpp" 00013 #include "BilinearDesignLH.hpp" 00014 #include "IIR_CascadeFrqResp.hpp" 00015 00016 namespace Mikami 00017 { 00018 class DesignerDrawer 00019 { 00020 public: 00021 // Constructor 00022 DesignerDrawer(uint16_t x0, uint16_t y0, 00023 float db1, int fs, int order, 00024 float fc, uint16_t fL, uint16_t fH, 00025 BilinearDesign::Type lpHp); 00026 00027 ~DesignerDrawer(); 00028 00029 // フィルタの再設計と周波数特性の再描画 00030 bool ReDesignAndDraw(Biquad::Coefs *ck, float &g0, 00031 BilinearDesign::Type lpHp); 00032 00033 // 周波数特性の描画 00034 void DrawResponse(); 00035 00036 void GetCoefficients(Biquad::Coefs *ck, float &g0); 00037 00038 uint16_t GetOrder() { return ORDER_; } 00039 00040 private: 00041 LCD_DISCO_F746NG *lcd_; 00042 TS_DISCO_F746NG *ts_; 00043 00044 const uint16_t X0_, Y0_; 00045 const uint16_t ORDER_; 00046 const uint16_t CURSOR_Y0_, CURSOR_LENGTH_; 00047 const uint16_t LOWER_F_, HIGHER_F_; 00048 const uint32_t CURSOR_COLOR_, CURSOR_TOUCHED_COLOR_; 00049 00050 IIR_CascadeFrqResp *frqResp_; // IIR フィルタの周波数応答に対応するオブジェクト 00051 BilinearDesign::Coefs *coefs_; // 設計された係数 00052 Biquad::Coefs *ck_; 00053 float g0_; // 設計された係数(利得定数) 00054 00055 int fC_; // 遮断周波数 00056 00057 uint16_t cursorX_, oldCursorX_; 00058 bool cursorRedraw_; 00059 BilinearDesign::Type lp_; 00060 00061 FrqRespDrawer *drawerObj_; 00062 BilinearDesign *designObj_; 00063 TouchPanelDetectorX *tp_; 00064 NumericLabel<int> *lblFrq_; // 遮断周波数表示用 00065 00066 // 周波数を 10, 20, 50, 100 Hz の倍数にする 00067 int Frq10(float f); 00068 }; 00069 } 00070 #endif // F746_DISIGNER_AND_DRAWER_HPP
Generated on Wed Jul 27 2022 22:49:01 by 1.7.2