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