2021-01-10 16:57:26 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
namespace Pinetime {
|
|
|
|
namespace Controllers {
|
|
|
|
/// Direct Form II Biquad Filter
|
|
|
|
class Biquad {
|
2021-04-24 09:00:45 +00:00
|
|
|
public:
|
2021-04-18 17:28:14 +00:00
|
|
|
Biquad(float b0, float b1, float b2, float a1, float a2);
|
2021-01-10 16:57:26 +00:00
|
|
|
float Step(float x);
|
|
|
|
|
2021-04-24 09:00:45 +00:00
|
|
|
private:
|
2021-01-10 16:57:26 +00:00
|
|
|
float b0;
|
|
|
|
float b1;
|
|
|
|
float b2;
|
|
|
|
float a1;
|
|
|
|
float a2;
|
|
|
|
|
|
|
|
float v1 = 0.0f;
|
|
|
|
float v2 = 0.0f;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|