ICD Sensing & Detection Algorithms

Nicole Chiou
May 13 · 8 min read
Image for post
Image for post

In this article, I will go over the basics of ICD algorithms and existing approaches. Then I will discuss alternative approaches to current methods and the benefits/drawbacks of both.


Implantable Cardioverter Defibrillators (ICDs) are medical devices used to monitor heart rhythm and detect irregularities in rhythm. These devices both have low-energy pacing and higher-energy shock (ATP) abilities. The signals used in this study are electrograms (EGMs), which are obtained from the leads placed directly on the cardiac tissue. The specific device used is a dual-chamber ICD, which has one lead in the right atrium and another in the right ventricle. Near- and far-field electrograms were measured. Inappropriate device-delivered therapy activations are typically caused by supraventricular tachycardias (SVTs). Inappropriate therapy can be decreased by the use of a high heart-rate threshold or delayed therapy [2]. This indicates that episodes of non-sustained ventricular tachycardia (NSVT) can be terminated under normal conditions without unnecessary therapy.


  1. Decrease inappropriate therapy by improving tachycardia discrimination by understanding ICDs and current approaches.
  2. Evaluate current ICD algorithms (Boston Scientific and Medtronic) to establish a baseline discriminator.
  3. Evaluate how changes to certain parameters affect the overall performance of the baseline algorithms.

Implementation of ICD Algorithms

Sensing algorithms are used to locate the peaks of each event, whereas detection algorithms are used to discriminate between the different classes of tachycardias (SVT/VT). Two main sensing and detection algorithms were explored: Boston Scientific and Medtronic.

Sensing in ICDs

Both sensing algorithms follow the same main steps:

  1. Difference amplifier — removes common noise from both input electrodes and amplifies the difference.
  2. Bandpass filter — removes lower frequency baseline signals and higher frequency noise.
  3. Rectifier — takes the absolute value of the entire signal.
  4. Threshold — dynamic threshold to capture each R-wave event.
  5. Blanking — time after sensing event occurs where peaks above threshold are ignored to make sure that each R-wave is only sensed once.
Sensing algorithm steps for Boston Scientific and Medtronic depicting input signals and the dynamic threshold. The rectified signal is depicted in blue while the red displays the dynamically adjusted sensing threshold. Sensed events are shown by the vertical red lines and false positives are present in both cases.

Active Gain Control

Fixed sensitivity leads to problems because some of the low-amplitude R-waves are not sensed; the discriminator would potentially classify the signal as normal when the low-amplitude parts might be in VT. Automatic Gain Control (AGC) corrects for this by increasing the gain the most for smaller input signals, so that these previously low-amplitude peaks are registered by the fixed sensitivity. An auto-adjusting threshold decreases the sensitivity after sensed ventricular events to better capture the low-amplitude peaks.

Dynamic Sensitivity Adjustments

  1. Longer blanking period — Blanking is used to avoid double-sensing of the R-peak. After a pacing pulse, there is a longer blanking period because an R-wave does not need to be measured immediately after the pacing pulse.
  2. Decay of sensing threshold — The sensing threshold is automatically adjusted and starts at the end of the blanking period with 75% of the magnitude of the most recently sensed R-peak (starts at some programmed value after a pacing event). The Medtronic algorithm has an exponential decay of the sensing threshold whereas the Boston Scientific algorithm decreases the sensing threshold in small steps, doubling the sensitivity every 200 ms after a sensing event.

Sensing Limitations

The Boston Scientific and Medtronic algorithms are both highly sensitive to noise and pre-programmed parameter values. Because of the algorithm’s sensitivity to noise, the R-peaks are not always properly located. This leads to complications with morphology discrimination, which requires the waveforms to be centered about the R-peak.

QRS Detection Algorithm

The motivation behind this algorithm is to decrease false-positive sensed events and the number of patient-specific parameters present in the Boston Scientific and Medtronic algorithms. This algorithm is modeled after the Pan and Tomkins algorithm for real-time QRS detection in ECG signals, and adapted to detect R-peaks in electrogram signals for the purpose of this project [3]. It can be used for pre-recorded signals as well as real-time signals.

  1. Bandpass filter — removes low frequency baseline signals and higher frequency noise.
  2. Differentiation — highlight segments with a large change in signal (QRS complex).
  3. Squaring — signal changes are emphasized and the signal is made positive.
  4. Integration — peaks are made more distinct, to eliminate false-positives.
  5. Peak identification — peaks of integrated signal are located using the Janko Slavic peak detection algorithm.
Image for post
Image for post
Step-by-step plot of the QRS detection algorithm performed on a pre-recorded raw ECG signal. The detected peaks do not exactly depict the R-peaks because of the shifting due to the integration window.


A low-cutoff of 1 Hz and a high-cutoff of 80 Hz was used to match the filtering effects of the Boston Scientific and Medtronic filtering steps. The filtered signal is then differentiated to highlight segments with a large change in signal, specifically the QRS complex. These changes are then squared to reduce false positives due to high-magnitude T waves and integrated to make them more distinct. Finally, the integrated signal is passed into a peak detection algorithm to identify possible peaks.

Peak Detection

The peak detection algorithm takes three inputs: the data, expected spacing between peaks (in samples), and a peak threshold. This algorithm compares the signal at various time-points to iteratively eliminate false peaks, increasing the spacing from 1 to expected spacing between R-R peaks.

Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Image for post
Visualization of peak detection algorithm signal comparisons at various spacing values to identify and isolate peak candidates. The number of potential peak candidates (marked in red) decreases as the iteration number and spacing increases, until false peaks are eliminated.

Dynamic Thresholding

The previously detected peaks are then classified as either a QRS peak or a noise peak, depending on whether the signal is greater than a dynamically set threshold. The thresholds are real-time adjusted: a threshold in a given moment is based on the signal value of the previously detected QRS and noise peaks, accounting for changes in the noise level. After a valid QRS peak detection, there is an absolute refractory period of 200 ms.

Image for post
Image for post
Dynamic thresholding to differentiate between QRS and noise peaks from the detected peak candidates.


For both EGM and ECG signals, the peak was not identified to be at the R-peak as desired, but rather at the end of the QRS complex. To compensate for this, the location of R-peak was identified by taking the location of maximum magnitude in a small window of 20 samples around the specified QRS peak. This allows for either positive or negative polarity peaks found in the atrial and ventricular lead electrograms.

Image for post
Image for post
Plot of the QRS detection algorithm with modified EGM-specific parameters performed on pre-recorded EGM signal. The integrated peaks are more distinct and the R-peaks are correctly identified at the location of maximum magnitude.


This algorithm was evaluated with NSR, SVT, and VT samples. Because the peak detection algorithm relies on the expected spacing between peaks, the algorithm is highly sensitive to irregular R-R interval lengths, since if multiple events occur in a single window, they are suppressed. Therefore, the window-length parameter must be specified in a non-automated fashion.

Detection in ICDs

Image for post
Image for post

Dual-chamber implantable cardioverter defibrillators (ICDs) can utilize atrio-ventricular timing algorithms to discriminate between VT and SVT. These algorithms implement a series of rule-based discriminators to either apply or inhibit therapy. The detection algorithm for Boston Scientific consists of a series of rule-based discriminators analyzing ventricular and atrial rates as well as the morphology of individual event waveforms.

Morphology Discriminator

The morphology discriminator is one of the rule-based discriminators used for discrimination between SVT and VT. It compares the morphology of a single-event input waveform to a Normal Sinus Rhythm (NSR) template waveform. If the correlation between the waveforms is high, this indicates that the episode is more likely to be an SVT episode than a VT episode. The Medtronic morphology discriminator uses wavelet decomposition to return a correlation coefficient computed from the compared detail coefficients from decomposition. First, a template is generated from an input NSR episode. For the generation of the NSR beat template, an EGM containing at least 6 beats was input. A rolling window was passed over the input signal to isolate a certain number of beats, where each beat is matched to the current template (initially the first beat). If the average of the match ratios of the beats in the window is better than the existing match ratio, the template is replaced by the average of all beats in the window. Prior to matching, the beats are aligned by their R-peaks. To calculate the correlation, individual sensed events are input and matched to the template.

Image for post
Image for post
Image for post
Image for post
Medtronic morphology discriminator uses wavelet decomposition and compares the detail coefficients of the input event against an NSR template. SVT event has a correlation of 0.83. VT event has a correlation of 0.0.


The algorithms were evaluated on a dataset of real electrogram episodes from the Ann Arbor Electrogram Libraries (AAEL) [1]. Each episode is 5 seconds in duration and the episode consists only of events specified by the class label. To evaluate the performance of the Medtronic morphology discriminator on the dataset of real electrograms, the average Medtronic wavelet morphology correlation was computed for each episode in the dataset. Before running the discriminator on the episodes, each episode’s events were determined once using the standard BS/MEDsensing algorithm and once using the QRS detection algorithm to compare the performance of the two sensing methods. The AUROC was computed by varying the Medtronic morphology correlation threshold for SVT/VT classification.

Image for post
Image for post
Image for post
Image for post

I am still learning about ICD algorithms and how ICDs work, but this semester I was able to understand the basics and explore some of the existing approaches and evaluate potential new ones. Next, I will use the baseline algorithms discussed in this post to see how they perform with optimized parameters.


[1] Medical Computing Laboratory at the University of Michigan in Ann Arbor. Ann arbor electrogram libraries. Available from http://electrogram.com/index.html.

[2] Arthur J. Moss, Claudio Schuger, Christopher A. Beck, Mary W. Brown, David S. Cannom, James P. Daubert, N.A. Mark Estes, Henry Greenberg, W. Jackson Hall, David T. Huang, Josef Kautzner, Helmut Klein, Scott McNitt, Brian Olshansky, Morio Shoda, David Wilber, and Wojciech Zareba. Reduction in inappropriate therapy and mortality through icd programming. New England Journal of Medicine, 367(24):2275–2283, 2012. PMID: 23131066.

[3] J. Pan and W. J. Tompkins. A real-time qrs detection algorithm. IEEE Transactions on Biomedical Engineering, BME-32(3):230–236, 1985.

Medical CPS

Research, ideas, knowledge about medical cyber-physical…

Medium is an open platform where 170 million readers come to find insightful and dynamic thinking. Here, expert and undiscovered voices alike dive into the heart of any topic and bring new ideas to the surface. Learn more

Follow the writers, publications, and topics that matter to you, and you’ll see them on your homepage and in your inbox. Explore

If you have a story to tell, knowledge to share, or a perspective to offer — welcome home. It’s easy and free to post your thinking on any topic. Write on Medium

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store