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: mbed SerialTxRxIntr DSP_MultirateLinearphase
GraphicEqualizer/GraphicEqualizer.cpp
- Committer:
- MikamiUitOpen
- Date:
- 2022-03-30
- Revision:
- 2:e97eaf13aa89
- Parent:
- 0:b3c94b253ae5
File content as of revision 2:e97eaf13aa89:
//--------------------------------------------------------------
// グラフィックイコライザのクラス
// フィルらの係数を設定しない場合は,出力は出ない
//
// 2022/02/19, Copyright (c) 2022 MIKAMI, Naoki
//--------------------------------------------------------------
#include "GraphicEqualizer.hpp"
namespace Mikami
{
// コンストラクタ
GrEqualizer::GrEqualizer(int bands, float fs, float qVal)
: BANDS_(bands), Q_VAL_(qVal),
biquad_(bands), f0_(bands)
{
for (int n=0; n<BANDS_; n++) f0_[n] = 62.5f*powf(2, n);
SetOff();
Validate();
}
// グラフィック・イコライザの実行
float GrEqualizer::Filtering(float xn)
{
float yn = xn;
for (int n=0; n<BANDS_; n++)
yn = biquad_[n].Execute(yn);
return yn;
}
}