All projects

Case study · 2024

Real-time ECG Artifact Filter

A low-latency signal processing pipeline that strips motion artifacts from ambulance ECG traces in under 30 milliseconds, so paramedics see a clean trace mid-transport.

Year
2024
Role
Engineering lead
Status
still building
Stack
Python, NumPy, SciPy, C++, ARM Cortex-M, embedded DSP
01

Challenge

Ambulance ECG traces are dominated by motion noise. Standard FIR filters either lag too much to be useful in the field or smear the QRS complex enough to mislead a paramedic.

02

Process

I prototyped an adaptive notch + wavelet decomposition pipeline in Python, validated against an annotated dataset of 4,000 transport-recorded traces, and ported the inner loop to fixed-point C++ for a Cortex-M target. The compute budget was 30 ms per sample window on a single core.

03

Outcome

92.4% reduction in motion-induced false alarms in bench testing, with a 28 ms average end-to-end latency. The filter is currently being evaluated for integration into a partner monitor.

The first instinct on ambulance ECG is to throw bigger filters at it. That doesn’t work. Past a certain order, the latency itself becomes the safety problem. By the time the trace settles, the patient has moved again.

What actually worked was thinking about the signal in two layers: an adaptive notch tracking the baseline wander, and a wavelet-based reconstruction that preserves the steep slopes of the QRS complex even under aggressive smoothing.

The hardest part wasn’t the math. It was building a labeled dataset I could actually trust. I spent two months annotating traces with a paramedic colleague before any of the modeling work began. The eventual filter is only as good as that ground truth.