## Robust detection of R-wave in ECG signals

In the electrocardiograph (ECG), R-wave represents the positive upward deflection in the QRS complex generated by the depolarization of left and right ventricles. The heart rate variability (HRV), or the time series measuring the difference between two consecutive R-waves, is crucial to many physiological phenomenona, such as sympathovagal balances.

## Challenge

However, R-wave detection is a delicate task due to various factors, including abnormal beat configurations (premature ventricular contractions, polymorphic ventricular tachycardia/torsade de pointes), and several types of noises (e.g. baseline wander, muscle artifact, electrode motion, ...). The following illustrates a period of 16s ECG detection results during which a burst of motion electrode noise is the cause of several false negative (red ndes) and false positive (black nodes) detections.

## Bayesian detection

While most R-wave detection methods in the literature are deterministic and based on various adaptive thresholds, we propose an orignial Bayesian approach by calculating the probabilities of three ECG signal features and updating the statistical model parameters. The search for an optimal feature set falls out of the scope of the current study, but the proposed general structure is easily extensible to include further features given the appropriate statistic models (cf illustration below).

Typical distributions for selected ECG features are shown here : at the top, blue curves represent distributions for those from the valid R-waves, and red curves for those from invalid R-waves. The dsitributions are calculated during the analysis of the MIT noise stress database (baseline noise added with SNR equal to 24 dB).

These updated distributions are be used to update the posterior probability of a valid R-wave detection for each feature according to the Bayes rule :

in which in which A and ¬A are the two possible outcomes of a binary event (true QRS vs false QRS in our case), conditional probabilities P (B|A) and P (B|¬A) are evaluated using the parametric models for a feature indicator B, while P(A|B) measures the Bayesian (posterior) probability of a true detection.

## Achievements

Stress tests are used for the colleciton of periods of 25 minutes of ECG data sampled at 1024Hz. Subjects are required to perform 18 minutes of jogging, followed by 200M sprint and slow walking. The following graph is extracted from the sprint period for which rapid baseline drifts are the main artefacts observed. The upper panel contains the raw ECG data and the R-wave detection results marked by red squares while the lower panel traces the R-R duration in ms. Note that significant deviations appear in the stress tests and the information of instantaneous (baet-by-beat) R-R durations are crucial in clinical analysis.