rusefi/firmware/controllers/lua/lua_biquad.h

24 lines
460 B
C
Raw Normal View History

2024-06-02 13:33:12 -07:00
#include "pch.h"
#include "biquad.h"
#pragma once
struct LuaBiQuad {
Biquad delegate;
float filter(float input) {
if (isFirstValue) {
delegate.cookSteadyState(input);
isFirstValue = false;
}
return delegate.filter(input);
}
void configureLowpass(float samplingFrequency, float cutoffFrequency) {
delegate.configureLowpass(samplingFrequency, cutoffFrequency);
isFirstValue = true;
}
bool isFirstValue = true;
};