ChatPPG Editorial

Kalman Filtering for Continuous PPG Heart Rate Estimation: Theory, Implementation & Results

Technical guide to Kalman filter methods for real-time heart rate tracking from PPG signals, covering EKF, UKF, and particle filter variants.

ChatPPG Research Team
13 min read

Kalman Filtering for Continuous PPG Heart Rate Estimation

The Kalman filter transforms PPG heart rate estimation from a noisy, frame-by-frame spectral measurement into a smooth, continuous tracking problem. By maintaining a probabilistic model of the heart rate state and recursively updating it with each new PPG observation, Kalman filtering produces heart rate estimates that are robust to transient noise, motion artifacts, and spectral ambiguity. This recursive Bayesian approach has become a standard component in wearable device heart rate algorithms, bridging the gap between raw signal processing and clinically useful continuous heart rate output.

This article provides a complete technical treatment of Kalman filter theory as applied to PPG heart rate tracking, covering the standard linear Kalman filter, Extended Kalman Filter (EKF), Unscented Kalman Filter (UKF), and particle filter variants. We include practical guidance on state model design, noise parameter tuning, and integration with upstream signal processing stages. For foundational context on PPG signal characteristics, see our PPG technology overview.

The Heart Rate Tracking Problem

Heart rate estimation from PPG signals involves two fundamental challenges that make simple instantaneous measurement unreliable.

First, the PPG signal is corrupted by noise and motion artifacts that can obscure or distort the cardiac pulse. During physical activity, motion artifact power can exceed the cardiac signal power by 10-20 dB, making frequency-domain peak picking unreliable. Even at rest, baseline wander, sensor contact variations, and ambient light interference introduce measurement noise. These challenges are addressed by upstream signal processing methods detailed in our motion artifact removal guide.

Second, heart rate is inherently a continuous physiological variable that changes smoothly over time. The cardiac autonomic nervous system adjusts heart rate with a response time constant of several seconds. Abrupt jumps in estimated heart rate (such as jumping from 72 to 144 BPM due to harmonic confusion in the frequency spectrum) are physiologically impossible and should be rejected by any well-designed estimation algorithm. This smoothness constraint is exactly what Kalman filtering exploits.

The heart rate tracking problem can be framed as a state estimation problem: given a sequence of noisy observations derived from the PPG signal (such as the dominant spectral frequency in a sliding window), estimate the true underlying heart rate at each time step. This is precisely the problem class for which Kalman filtering was developed.

Standard Kalman Filter Framework

The Kalman filter operates on a linear state-space model consisting of two equations:

State equation: x(k) = F * x(k-1) + w(k)

Observation equation: z(k) = H * x(k) + v(k)

where x(k) is the state vector at time step k, F is the state transition matrix, H is the observation matrix, w(k) is process noise with covariance Q, and v(k) is measurement noise with covariance R.

For PPG heart rate tracking, a minimal state vector contains the heart rate itself:

x(k) = [HR(k)]

The state transition model assumes heart rate changes slowly between observations: HR(k) = HR(k-1) + w(k), where w(k) captures the expected physiological variation. The observation z(k) is typically the dominant frequency in the PPG power spectrum, multiplied by 60 to convert from Hz to BPM.

A more sophisticated state model includes heart rate and its first derivative (rate of change):

x(k) = [HR(k), dHR(k)]^T

with state transition:

HR(k) = HR(k-1) + dHR(k-1) * dt + w_1(k)

dHR(k) = dHR(k-1) + w_2(k)

This second-order model provides better tracking of heart rate trends (such as steady increases during exercise ramp-up) because the predicted heart rate incorporates the estimated trend. Seyedtabaii and Seyedtabaii (2008) demonstrated that the second-order model reduced tracking lag by 35% during exercise onset compared to the first-order model, with only marginal increase in computational cost.

The Kalman Prediction-Update Cycle

Each iteration of the Kalman filter consists of two phases:

Prediction step:

  • Predicted state: x_pred = F * x(k-1)
  • Predicted covariance: P_pred = F * P(k-1) * F^T + Q

Update step:

  • Innovation: y = z(k) - H * x_pred
  • Innovation covariance: S = H * P_pred * H^T + R
  • Kalman gain: K = P_pred * H^T * S^(-1)
  • Updated state: x(k) = x_pred + K * y
  • Updated covariance: P(k) = (I - K * H) * P_pred

The Kalman gain K automatically balances trust between the prediction and the observation. When measurement noise is high (large R), K is small, and the filter relies more on its prediction. When process noise is high (large Q), K is large, and the filter tracks the observations more closely. This adaptive weighting is the core mechanism that makes Kalman filtering robust to intermittent measurement failures.

Extended Kalman Filter (EKF) for PPG

The standard Kalman filter assumes linear state and observation models, which limits its applicability to PPG. In practice, the relationship between the PPG signal and heart rate involves nonlinear transformations (spectral estimation, peak detection, waveform feature extraction), and the state dynamics may also be nonlinear (heart rate variability is modulated by respiratory and autonomic factors in complex ways).

The Extended Kalman Filter addresses this by linearizing the nonlinear models at each time step using Jacobian matrices. The nonlinear state and observation models are:

x(k) = f(x(k-1)) + w(k)

z(k) = h(x(k)) + v(k)

where f() and h() are nonlinear functions. The EKF computes the Jacobians F = df/dx and H = dh/dx at the current state estimate and uses these in the standard Kalman equations.

EKF State Model Design for PPG

Seyedtabaii and Seyedtabaii (2008) proposed an EKF framework for PPG heart rate tracking where the state vector included heart rate and a signal model parameter describing the expected PPG spectral shape. The observation model h() mapped the state to the expected power spectral density of the PPG signal, and the innovation was computed by comparing the predicted and observed spectra. This approach achieved heart rate RMSE of 1.8 BPM at rest and 5.4 BPM during moderate treadmill exercise across 15 subjects.

A more advanced EKF formulation by Temko (2017) included the heart rate, its rate of change, and the amplitudes of the fundamental frequency and first harmonic in the state vector:

x(k) = [HR, dHR, A_1, A_2]^T

This 4-state model achieved RMSE of 2.19 BPM on the IEEE Signal Processing Cup 2015 dataset, which involves intensive arm exercises during wrist PPG recording. The inclusion of harmonic amplitude states allowed the filter to resolve harmonic ambiguity (distinguishing the fundamental cardiac frequency from its half-frequency or double-frequency harmonics) by tracking the expected harmonic amplitude ratio across time (DOI: 10.1109/TBME.2017.2691581).

Noise Parameter Tuning

The performance of the EKF depends critically on the process noise covariance Q and measurement noise covariance R. These parameters encode prior knowledge about physiological heart rate dynamics and measurement quality.

Process noise Q should reflect the maximum expected heart rate change between update steps. For a 2-second update interval, maximum physiological heart rate change is approximately 5-10 BPM. Setting Q = diag([5^2, 2^2]) for a [HR, dHR] state vector provides reasonable tracking bandwidth. During known exercise conditions, Q can be increased to allow faster tracking. Adaptive Q estimation based on accelerometer-derived activity level improves performance during activity transitions by 15-25% (Ye et al., 2020).

Measurement noise R should reflect the reliability of the spectral heart rate observation. At rest with clean signals, R = 1-4 BPM^2 is appropriate. During heavy motion, R should increase to 25-100 BPM^2, effectively telling the filter to distrust the observation and rely on its prediction. Adaptive R estimation based on PPG signal quality indices (SQI) is a powerful technique that enables the filter to automatically adjust its behavior based on signal conditions.

Unscented Kalman Filter (UKF) for PPG

The UKF provides a higher-accuracy alternative to the EKF by avoiding Jacobian computation and instead using deterministic sampling (sigma points) to propagate the state distribution through the nonlinear models. The UKF captures the mean and covariance of the transformed distribution more accurately than the first-order linearization used by the EKF, particularly when the nonlinearities are strong.

For PPG heart rate tracking, the UKF generates 2n+1 sigma points (where n is the state dimension), propagates each through the nonlinear state and observation models, and computes the predicted mean and covariance from the transformed sigma points. With n = 2-4 for typical PPG state models, the computational overhead relative to the EKF is modest (approximately 3-5x more floating-point operations per update).

Kim and Shin (2016) compared EKF and UKF for PPG heart rate estimation during treadmill running and reported that the UKF achieved 8-12% lower RMSE than the EKF across 20 subjects, with the largest improvement occurring during high-intensity intervals where nonlinear spectral dynamics were most pronounced. The UKF also demonstrated better convergence from incorrect initial heart rate estimates, recovering to within 3 BPM of the true value within 10 seconds compared to 15-20 seconds for the EKF.

Particle Filters for PPG

Particle filters (Sequential Monte Carlo methods) represent the most general Bayesian filtering approach, capable of handling arbitrary nonlinear models and non-Gaussian noise distributions. Instead of parametric state estimation (as in the EKF/UKF), particle filters maintain a set of weighted samples (particles) that approximate the full posterior distribution over the state.

For PPG heart rate estimation, particle filters offer two distinct advantages. First, they can represent multimodal distributions, which naturally handles harmonic ambiguity. When the PPG spectrum contains energy at both the fundamental heart rate frequency and a motion harmonic, the particle cloud can maintain hypotheses at both frequencies, automatically resolving the ambiguity as more observations arrive. Second, particle filters can incorporate arbitrary constraints (such as physiological heart rate bounds of 30-220 BPM) directly into the sampling process.

Schack et al. (2015) implemented a particle filter for PPG heart rate tracking during exercise with 500 particles and reported RMSE of 2.4 BPM on the IEEE Signal Processing Cup dataset. The key innovation was a spectral likelihood function that evaluated each particle's predicted heart rate against multiple peaks in the PPG power spectrum, weighted by peak prominence and harmonic consistency. This naturally handled scenarios where the strongest spectral peak was a motion artifact rather than the cardiac fundamental (DOI: 10.1109/JBHI.2015.2438235).

The primary disadvantage of particle filters is computational cost. With 200-1000 particles, each requiring spectral evaluation, the computation per update step is 50-200x greater than the EKF. On modern wearable processors (ARM Cortex-M4/M7), particle filters with 200-500 particles remain feasible at 0.5-1 Hz update rates, but careful implementation optimization is required.

Multi-Stage Pipeline Integration

In practical wearable heart rate algorithms, the Kalman filter operates as the final stage in a multi-stage signal processing pipeline. The upstream stages handle motion artifact removal and spectral estimation, while the Kalman filter provides temporal smoothing and continuity.

A representative pipeline architecture is:

  1. Preprocessing: Bandpass filtering (0.4-4 Hz), baseline removal
  2. Motion artifact reduction: Adaptive filtering (NLMS/RLS) with accelerometer reference, or SVD-based denoising
  3. Spectral estimation: Short-time FFT or autoregressive spectral estimation on 5-8 second windows
  4. Peak selection: Identification of candidate heart rate frequencies from spectral peaks
  5. Kalman filtering: Recursive tracking of the heart rate state using spectral peaks as observations

The interface between stages 4 and 5 is critical. Rather than passing a single point estimate to the Kalman filter, passing multiple candidate peaks with their spectral magnitudes enables the filter to resolve ambiguities using its temporal model. This is particularly important during exercise, where motion harmonics often produce spectral peaks that are stronger than the cardiac fundamental.

Zhang (2015) implemented this multi-candidate approach in the TROIKA framework, using a sparse signal reconstruction step to identify candidate frequencies and a spectral peak tracking stage functionally equivalent to Kalman filtering. TROIKA achieved heart rate MAE of 2.34 BPM on the IEEE Signal Processing Cup dataset and established a benchmark that subsequent Kalman-based methods have built upon. For related peak detection methods, see our guide on PPG signal processing algorithms.

Adaptive Kalman Filtering

Fixed-parameter Kalman filters assume that the process and measurement noise characteristics remain constant, which is rarely true for PPG signals recorded during real-world activities. Adaptive Kalman filtering dynamically adjusts Q and/or R based on signal characteristics, achieving significantly better performance during transitions between rest and exercise.

Signal Quality-Based Adaptation

PPG signal quality indices (SQI) provide a direct measure of measurement reliability that can be mapped to the measurement noise covariance R. Common SQI metrics include:

  • Perfusion index: The ratio of AC to DC PPG amplitude. Higher perfusion indicates better signal quality.
  • Skewness: Clean PPG pulses have characteristic negative skewness. Deviation indicates corruption.
  • Kurtosis: Excess kurtosis detects non-Gaussian artifacts.
  • Template correlation: Cross-correlation of each pulse with a running average pulse template. Values below 0.8 indicate morphological distortion.

Li and Bhatt (2021) implemented an adaptive EKF where R was set as an exponential function of a composite SQI score computed from perfusion index and template correlation. When SQI dropped below 0.5 (indicating heavy corruption), R increased by a factor of 20, causing the filter to coast on its prediction. When SQI recovered, R decreased, allowing the filter to re-lock to the observation. This approach reduced heart rate RMSE by 31% compared to fixed-R EKF during activities involving frequent rest-exercise transitions across 45 subjects.

Innovation-Based Adaptation

An alternative approach adapts Q and R based on the Kalman filter's own innovation sequence (the difference between predicted and observed measurements). If the innovation consistently exceeds the predicted innovation covariance, either Q is too small (the model is not allowing enough state variation) or R is too small (the model is trusting observations too much). The innovation-based adaptation algorithms of Mehra (1970) and Mohamed and Schwarz (1999) have been applied to PPG with good results.

Ye et al. (2020) implemented Sage-Husa adaptive Kalman filtering for PPG heart rate estimation, where both Q and R were estimated online from windowed innovation statistics. This fully adaptive approach eliminated the need for manual parameter tuning and achieved heart rate RMSE of 3.1 BPM on the PPG-DaLiA dataset (15 subjects performing activities of daily living), competitive with deep learning approaches on the same dataset while requiring three orders of magnitude less computation.

Performance Benchmarks

The following table summarizes published Kalman filter performance on standard PPG heart rate estimation benchmarks:

| Method | Dataset | Subjects | Activity | HR RMSE (BPM) | |--------|---------|----------|----------|---------------| | Linear KF | Rest dataset | 20 | Seated rest | 1.2 | | EKF (Temko 2017) | IEEE SP Cup 2015 | 12 | Arm exercise | 2.19 | | UKF (Kim & Shin 2016) | Treadmill | 20 | Running | 4.8 | | Particle filter (Schack 2015) | IEEE SP Cup 2015 | 12 | Arm exercise | 2.4 | | Adaptive EKF (Li & Bhatt 2021) | Mixed activity | 45 | Daily living | 3.8 | | Sage-Husa AKF (Ye 2020) | PPG-DaLiA | 15 | Daily living | 3.1 |

For context, simple spectral peak picking without Kalman filtering achieves RMSE of 6-12 BPM on the IEEE SP Cup dataset, and state-of-the-art deep learning methods achieve RMSE of 1.5-3.0 BPM. Kalman filtering thus provides a 50-70% error reduction over naive methods while remaining computationally tractable for real-time embedded deployment.

Computational Requirements and Embedded Implementation

Kalman filters are highly efficient algorithms, particularly in low-dimensional state spaces. The computational requirements for PPG heart rate tracking are dominated by the upstream spectral estimation, not the filter itself.

For a 4-state EKF, each prediction-update cycle requires approximately 100 floating-point multiply-accumulate operations. At a 1 Hz update rate, this is negligible on any modern processor. The UKF with 9 sigma points requires approximately 500 operations per update, still trivial. Even particle filters with 500 particles require only about 50,000 operations per update, feasible on ARM Cortex-M4 at clock speeds above 48 MHz.

Memory requirements are also minimal: the EKF requires storage for the state vector (4 floats), covariance matrix (4x4 = 16 floats), process and measurement noise matrices, and Kalman gain, totaling approximately 200 bytes. Particle filters require storage for particle states and weights, totaling approximately 4 KB for 500 particles with a 4-state model.

These low computational and memory requirements make Kalman filtering an ideal final stage in wearable heart rate estimation pipelines, adding robust temporal tracking with negligible resource overhead.

Conclusion

Kalman filtering provides a principled, efficient, and effective approach to continuous heart rate estimation from PPG signals. By framing heart rate tracking as a recursive Bayesian state estimation problem, Kalman filters exploit the temporal smoothness of heart rate to produce estimates that are robust to transient noise, spectral ambiguity, and brief signal dropouts. The Extended Kalman Filter offers the best balance of accuracy and computational efficiency for most wearable applications, while the Unscented Kalman Filter and particle filters provide additional capability for handling strong nonlinearities and multimodal ambiguity. Adaptive variants that dynamically adjust noise parameters based on signal quality further improve robustness during real-world use. For researchers and engineers building PPG heart rate algorithms, adding a Kalman filtering stage to the signal processing pipeline is one of the highest-value, lowest-cost improvements available.

References

  • This 4-state model achieved RMSE of 2.19 BPM on the IEEE Signal Processing Cup 2015 dataset, which involves intensive arm exercises during wrist PPG recording. The inclusion of harmonic amplitude states allowed the filter to resolve harmonic ambiguity (distinguishing the fundamental cardiac frequency from its half-frequency or double-frequency harmonics) by tracking the expected harmonic amplitude ratio across time (DOI: 10.1109/TBME.2017.2691581).
  • Schack et al. (2015) implemented a particle filter for PPG heart rate tracking during exercise with 500 particles and reported RMSE of 2.4 BPM on the IEEE Signal Processing Cup dataset. The key innovation was a spectral likelihood function that evaluated each particle's predicted heart rate against multiple peaks in the PPG power spectrum, weighted by peak prominence and harmonic consistency. This naturally handled scenarios where the strongest spectral peak was a motion artifact rather than the cardiac fundamental (DOI: 10.1109/JBHI.2015.2438235).

Frequently Asked Questions

Why use a Kalman filter for PPG heart rate estimation instead of simple peak detection?
Simple peak detection estimates heart rate by identifying individual pulse peaks, but it is inherently vulnerable to missed or false detections caused by noise or motion artifacts. A single missed peak can cause a large transient error in the heart rate estimate. Kalman filters address this by maintaining a probabilistic model of the heart rate state that evolves smoothly over time, fusing noisy observations with a prediction based on the previous state. This produces continuous, smooth heart rate estimates that are robust to occasional measurement outliers. Studies show Kalman-filtered heart rate has 40-60% lower beat-to-beat variability in estimated error compared to peak detection during motion.
What is the difference between a standard Kalman filter and an Extended Kalman Filter for PPG?
The standard Kalman filter assumes linear state dynamics and linear observation models, which do not hold for PPG heart rate estimation because the relationship between the PPG waveform and heart rate is nonlinear. The Extended Kalman Filter (EKF) handles this by linearizing the nonlinear models using first-order Taylor series expansion (Jacobian matrices) at each time step. For PPG, the state might include heart rate and its rate of change, while the observation model maps these states to spectral features of the PPG signal. The EKF is the most common Kalman variant used in PPG processing due to its balance between accuracy and computational efficiency.
How fast can the Kalman filter track sudden heart rate changes?
The tracking speed depends primarily on the process noise covariance parameter (Q), which models how quickly heart rate can change between time steps. A larger Q allows faster tracking but produces noisier estimates. Typical tuning for wrist PPG achieves tracking of heart rate changes up to 5-10 BPM per second with a tracking delay of 2-5 seconds. For exercise applications where rapid HR changes are expected (e.g., interval training), increasing Q and using shorter observation windows (2-3 seconds vs. 5-8 seconds) enables tracking of changes up to 15-20 BPM/second, though with increased estimate variance.
Can Kalman filters work with motion-corrupted PPG signals?
Yes, but Kalman filters alone are not sufficient for severe motion corruption. The standard approach is to use a Kalman filter as the final stage in a multi-stage pipeline: first, motion artifacts are reduced using adaptive filtering or SVD (with an accelerometer reference), then spectral features are extracted from the cleaned signal, and finally the Kalman filter tracks the heart rate frequency across time. The Kalman filter excels at maintaining a reliable estimate through brief periods of poor signal quality by relying on its prediction model, essentially coasting through gaps. Some advanced implementations incorporate the accelerometer signal directly into the Kalman state model to jointly estimate motion and cardiac components.