Skip to content
Tech News
← Back to articles

Recursive Filters: SMA, EMA, Low‑Pass, and a Tiny Kalman

read original more articles
Why This Matters

Recursive filters like SMA, EMA, low-pass, and Kalman filters are essential tools in the tech industry for real-time data smoothing, especially in resource-constrained environments such as embedded systems and mobile devices. They enable low-latency, efficient, and robust processing of noisy data streams, making them invaluable for applications requiring immediate responses and minimal computational overhead.

Key Takeaways

While exploring optimizers I fell down the rabbit hole of recursive filters. This post is a compact, practical tour of smoothers you can use when measurements are noisy but latency and compute are tight. We’ll keep the math minimal, the intuition high, and focus on when and why to use SMA, EMA/low‑pass, and a tiny 1D Kalman.

If you are here just for code, my Kaggle Notebook can be found here.

Why recursive filters

Recursive filters shine when compute and memory are scarce, or when data arrives as a stream and you must react immediately.

O(1) memory : you keep just the last state (and maybe a running sum) rather than a long buffer.

: you keep just the last state (and maybe a running sum) rather than a long buffer. O(1) compute per sample : one or two multiply‑adds per step—perfect for microcontrollers and tight loops.

: one or two multiply‑adds per step—perfect for microcontrollers and tight loops. Online, low‑latency : produce an updated estimate as soon as a sample arrives; no need to wait for a full window.

: produce an updated estimate as soon as a sample arrives; no need to wait for a full window. Simple, robust implementations : easy to port, vectorize, or run in reduced precision.

: easy to port, vectorize, or run in reduced precision. Graceful with irregular sampling: updates are incremental and don’t assume batch availability.

Intuition note Recursive filters that we’ll use, all use constant‑size state. That’s why they’re common in embedded systems, robotics control loops, mobile sensor smoothing and telemetry.

... continue reading