RLS (Recursive Least Squares) Filter for PPG

The Recursive Least Squares (RLS) algorithm is an adaptive filtering technique that minimizes the weighted sum of past squared errors using an exact inverse covariance matrix update, achieving faster convergence than LMS at the cost of higher computational complexity.

RLS maintains an estimate of the inverse correlation matrix P(n) and updates it recursively using the matrix inversion lemma: P(n) = λ⁻¹P(n-1) - λ⁻¹k(n)x^T(n)P(n-1), where λ is a forgetting factor (typically 0.95–0.999) and k(n) is the Kalman gain vector. The forgetting factor allows RLS to track nonstationary processes by exponentially weighting past data.

For PPG motion artifact removal, RLS outperforms LMS particularly during transient motion bursts and rapidly changing motion patterns. Benchmarks on the MIMIC-III dataset and the 2015 Computing in Cardiology Challenge show RLS achieving 4–8 bpm mean absolute error in heart rate estimation during treadmill running, versus 8–15 bpm for standard LMS. The TROIKA framework by Zhang et al. (2015) combines NLMS with spectral peak tracking and demonstrated that adaptive filtering alone, without Fourier-based frequency selection, is insufficient for strenuous exercise scenarios.

The primary drawback of RLS for embedded wearable implementation is O(N²) computation per sample for an N-tap filter. Fast RLS variants (FRLS) and QR-decomposition-based RLS (QRD-RLS) reduce complexity but complicate implementation. For IoT wearable chips with limited FLOPS budget, a cascade of lower-order RLS stages often outperforms single high-order implementation.

Frequently Asked Questions

What forgetting factor should be used for PPG RLS?

Forgetting factors of 0.97–0.999 are typical for PPG. Lower values (0.97–0.98) track rapidly changing motion but increase steady-state noise. Higher values (0.99+) provide smoother output but miss fast transitions.

Is RLS real-time capable on wearable MCUs?

Yes, for moderate filter orders. An 8-tap RLS requires ~64 multiply-accumulate operations per sample — feasible at 100 Hz on ARM Cortex-M4. Filter orders above 32 taps may require hardware acceleration on constrained devices.

How does RLS handle non-stationary PPG signals during exercise?

The forgetting factor allows RLS to track non-stationarities. However, when motion frequency crosses the cardiac band (1–3 Hz), RLS cannot separate motion from cardiac signal and additional frequency-domain constraints are required.

Related Algorithms