Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: F746_GUI F746_SAI_IO SD_PlayerSkeleton FrequencyResponseDrawer
GrEqualizerFrqResp.hpp
00001 //----------------------------------------------------------- 00002 // グラフィックイコライザで使う IIR フィルタの周波数応答 00003 // Frequency response for graphic equalizer 00004 // 00005 // 2017/03/28, Copyright (c) 2017 MIKAMI, Naoki 00006 //----------------------------------------------------------- 00007 00008 #ifndef GRAPHIC_EQUALIZER_FREQUENCY_RESPONSE_HPP 00009 #define GRAPHIC_EQUALIZER_FREQUENCY_RESPONSE_HPP 00010 00011 #include "FrequancyResponseBase.hpp" 00012 #include "BiquadGrEq.hpp" 00013 #include "Array.hpp" 00014 00015 namespace Mikami 00016 { 00017 class GrEqualizerFrqResp : public FrequencyResponse 00018 { 00019 public: 00020 GrEqualizerFrqResp(int bands) 00021 : BANDS_(bands), ck_(bands) {} 00022 00023 virtual ~GrEqualizerFrqResp() {} 00024 00025 // フィルタの係数設定 00026 void SetParams(BiquadGrEq::Coefs ck[]) 00027 { for (int n=0; n<BANDS_; n++) ck_[n] = ck[n]; } 00028 00029 void SetParam(BiquadGrEq::Coefs ck, int n) 00030 { ck_[n] = ck; } 00031 00032 // 周波数応答の絶対値を返す関数, 引数: z^(-1) 00033 virtual float AbsH_z(Complex u) 00034 { 00035 Complex h = 1; 00036 for (int k=0; k<BANDS_; k++) 00037 h = h*(ck_[k].b0 + (ck_[k].b1 + ck_[k].b2*u)*u) 00038 /(1.0f - (ck_[k].a1 + ck_[k].a2*u)*u); 00039 return abs(h); 00040 } 00041 00042 private: 00043 const int BANDS_; 00044 Array<BiquadGrEq::Coefs> ck_; 00045 00046 // disallow copy constructor and assignment operator 00047 GrEqualizerFrqResp(const GrEqualizerFrqResp&); 00048 GrEqualizerFrqResp& operator=(const GrEqualizerFrqResp&); 00049 }; 00050 } 00051 #endif // GRAPHIC_EQUALIZER_FREQUENCY_RESPONSE_HPP
Generated on Tue Jul 12 2022 22:59:37 by
