There are a range of available algorithms for QRS detection, based on various methods such as peak detection, slope transform analysis, and length transform analysis. Most of these algorithms involve the use of adaptive filters, and others use non-adaptive filters. Adaptive filters are preferred when it comes to heart rate analysis, largely because ECG signals are non-linear. For this reason, it is necessary to periodically analyze the output and modify the filter parameters accordingly.
We aim in this project to give a brief overview of the existing literature and algorithms, and compare the robustness of two leading QRS detection algorithms in accurately detecting heartbeats.
Algorithms for ECG Analysis
There is an extensive library of QRS detection algorithms available in the medical literature, since QRS detectors are the most important signal processing algorithm involved in ECG analysis. We will here analyze three primary algorithm methods: Peak Detections, Slope transform analysis, and length transform analysis.
Particular Peak Detection Algorithm
The peak detection algorithm that we chose to analyze specifically looks at a 160ms window, splits the window into three segments, and finds if the maximum value is contained within the center segment; if so, a beat is annotated. If no beat is detected for longer than 200ms, the threshold is updated using an adaptive filter that functions according to the rate described below:
We were unable to generate a working peak detection algorithm in order to insert it into the algorithm tester; however, an in-depth review of the literature indicated that it was overall less accurate than the other two algorithms.
SQRS
The slope-detection algorithm that we chose uses a Finite Impulse response filter with the following filter mask:
[1 4 6 4 1 −1 −4 −6 −4 −1];
This filter mask corresponds to the basic shape of a QRS wave. After low-pass filtering to eliminate any remaining noise, this QRS “template” is convolved with the actual signal; the output of the convolution thus provides information about the places in which the signal best matches the QRS shape, wherein the peaks of the convolution correspond to the best matches.
![]() |
WQRS:
Finally, the second filter that we are investigating and testing is based on what is called the WQRS algorithm. This algorithm is different from the SQRS algorithm in the information it extracts from the raw ECG signal and the manner in which it does so. The main step in this algorithm that makes it different from the SQRS algorithm is that this takes a length transform of the ECG signal. This is a transformation that essentially serves to convert the erratic ECG signal into another signal from which it is easier to analyze and extract useful information. When applied to a potential QRS complex, the length transform can tell us how wide the distance from Q to S is, and where the onset and the end of the complex are located in time. The length transformation also introduces a non-linear scaling factor into the mix, which scales different parts of the signal differently. This results in areas that we are interested in, i.e. the QRS complex being accentuated, and the areas that we do not require, such as noise and the P and T waves, being suppressed. Thus, we are able to obtain the information necessary to determine the heart rate whilst not letting noise interfere.
![]() |
The first step in the algorithm is to low pass filter the signal in order to eliminate noise. Following this, the length transform is applied and a threshold value of the algorithm is set as three times the mean value of the length transform of the first set of data points. After 10 seconds have elapsed, the threshold value is readjusted to be one-third the threshold base value. Following this, the threshold base value is periodically adjusted.
![]() |