0
1
mirror of https://github.com/radio95-rnt/fm95.git synced 2026-02-27 03:23:54 +01:00
This commit is contained in:
Kuba
2025-08-08 22:51:08 +02:00
committed by GitHub
parent af44ad2448
commit 3192ba4dd4

View File

@@ -19,11 +19,11 @@ void tilt_init(TiltCorrectionFilter* filter, float alpha) {
// Leaky integrator for DC estimation: dc[n] = alpha*dc[n-1] + (1-alpha)*x[n] // Leaky integrator for DC estimation: dc[n] = alpha*dc[n-1] + (1-alpha)*x[n]
// Tilt correction: y[n] = x[n] - dc[n] // Tilt correction: y[n] = x[n] - dc[n]
if (correction_strength >= 1.0f) { if (alpha >= 1.0f) {
correction_strength = 0.99999f; alpha = 0.99999f;
} }
if (correction_strength < 0.0f) { if (alpha < 0.0f) {
correction_strength = 0.0f; alpha = 0.0f;
} }
filter->alpha = alpha; // Leaky integrator coefficient filter->alpha = alpha; // Leaky integrator coefficient