Output the audio signal with filtering by graphic equalizer in the *.wav file on the SD card using onboard CODEC. SD カードの *.wav ファイルのオーディオ信号をグラフィック・イコライザを通して,ボードに搭載されているCODEC で出力する.
Dependencies: F746_GUI F746_SAI_IO SD_PlayerSkeleton FrequencyResponseDrawer
MyGraphicEqualizer/GrEqualizerFrqResp.hpp
- Committer:
- MikamiUitOpen
- Date:
- 2017-04-10
- Revision:
- 24:f78f9d0ac262
- Parent:
- 23:878419f8638b
File content as of revision 24:f78f9d0ac262:
//----------------------------------------------------------- // グラフィックイコライザで使う IIR フィルタの周波数応答 // Frequency response for graphic equalizer // // 2017/03/28, Copyright (c) 2017 MIKAMI, Naoki //----------------------------------------------------------- #ifndef GRAPHIC_EQUALIZER_FREQUENCY_RESPONSE_HPP #define GRAPHIC_EQUALIZER_FREQUENCY_RESPONSE_HPP #include "FrequancyResponseBase.hpp" #include "BiquadGrEq.hpp" #include "Array.hpp" namespace Mikami { class GrEqualizerFrqResp : public FrequencyResponse { public: GrEqualizerFrqResp(int bands) : BANDS_(bands), ck_(bands) {} virtual ~GrEqualizerFrqResp() {} // フィルタの係数設定 void SetParams(BiquadGrEq::Coefs ck[]) { for (int n=0; n<BANDS_; n++) ck_[n] = ck[n]; } void SetParam(BiquadGrEq::Coefs ck, int n) { ck_[n] = ck; } // 周波数応答の絶対値を返す関数, 引数: z^(-1) virtual float AbsH_z(Complex u) { Complex h = 1; for (int k=0; k<BANDS_; k++) h = h*(ck_[k].b0 + (ck_[k].b1 + ck_[k].b2*u)*u) /(1.0f - (ck_[k].a1 + ck_[k].a2*u)*u); return abs(h); } private: const int BANDS_; Array<BiquadGrEq::Coefs> ck_; // disallow copy constructor and assignment operator GrEqualizerFrqResp(const GrEqualizerFrqResp&); GrEqualizerFrqResp& operator=(const GrEqualizerFrqResp&); }; } #endif // GRAPHIC_EQUALIZER_FREQUENCY_RESPONSE_HPP