Krotos Modules 3
Loading...
Searching...
No Matches
EMAFilter.cpp
Go to the documentation of this file.
1#include "EMAFilter.h"
2//=====================================================================================
4{
5 //
6}
7//=====================================================================================
8void krotos::EMAFilter::configure(float rate, float tau, float y0)
9{
10 const float W = rate * tau;
11 alpha = (W - 1) / (W + 1);
12 y = y0;
13 configured = true;
14}
15//=====================================================================================
17{
18 assert(configured);
19
20 y = (1 - alpha) * x + alpha * y;
21
22 return y;
23}
void configure(float rate, float tau, float y0=0.f)
Definition EMAFilter.cpp:8
EMAFilter()
Definition EMAFilter.cpp:3
float processSample(float x)
Definition EMAFilter.cpp:16