Professional Documents
Culture Documents
** University of Ioannina
Dept. of Computer Science
P.O. Box 1186, Ioannina 45110
Greece
Abstract1: This paper presents a hardware The rest of the paper is structured as follows. The
implementation of the Pan and Tompkins QRS following section outlines some interesting QRS
detection algorithm, described in Verilog HDL detection algorithms and describes in more detail the
(Hardware Design Language). The generated source one proposed by Pan and Tompkins. The next chapter
has been simulated for validation, synthesized and presents the general architecture of the proposed system,
tested on a Xilinx FPGA (Field Programmable Gate while implementation details are given in the next two
Array) board using the European ST-T database. To chapters. The final section summarizes this work.
the best of the authors knowledge this is the first
attempt for the hardware implementation of the Pan QRS Detection Algorithms
and Tompkins QRS detection algorithm, in
reconfigurable FPGA boards. The generated Several QRS detection algorithms have been
hardware achieves a speed up of 250% compared to proposed in the literature [22], [23]. Algorithms [4], [5]
the software implementation. Given that and the and [6] are based on the amplitude and the first
vital importance of a fast and accurate QRS derivative. In [4] a point is classified as QRS candidate
detection, the hardware implementation seems a when three consecutive points of the first derivative
promising approach. exceed a positive threshold (ascending slope) followed
within the next 100ms by two consecutive points which
Introduction exceed a negative threshold (descending slope). Fraden
and Neuman [5] developed a QRS detection scheme
The QRS detection algorithm introduced by Pan and where a threshold is calculated as a fraction of the peak
Tompkins [1] is the most widely used and often cited value of the ECG. Gustafson [6] suggested that a point
algorithm for the extraction of QRS complexes from is a QRS peak candidate when the first derivative and
electrocardiograms. The methodology followed is that the three next derivative values exceeds a threshold and
the ECG is passed through a low-pass and a high-pass the next two sample points have positive slope
filter in order to remove noise from the signal. Then the amplitude products.
filtered signal is passed through derivative, squaring and Algorithms [7] and [8] are based on the first
window integration phases. Finally, a thresholding derivative only. In [7] the first derivative is calculated
technique is applied and the R-peaks are detected. by a given formula and the slope threshold is calculated
This work presents the hardware implementation of as a fraction of the maximum slope for the first
the Pan-Tompkins algorithm. The Verilog [2] hardware derivative. In [8] the derivative and the derivative of the
description language has been used. The building blocks next three points should exceed the threshold.
and the actual implementation were designed, tested and Algorithms [9] and [10] are based on the first and
evaluated using the ISE tool available from Xilinx [3]. second derivatives. Balda [9] suggested searching
The comparison of our hardware implementation values exceeding the threshold in a weighted summation
with an equivalent software approach showed that the of the first and second derivative. Ahlstrom and
necessary clock cycles are significantly less for the Tompkins in [10] proposed that the absolute values of
hardware implementation. the first derivative are smoothed and added with the
absolute values of the second derivative. Two thresholds
are used, a primary and secondary one. A point is
1
This work is co - funded by the European Social Fund and candidate for QRS peak point when the primary
particularly the Program Pened 2003.
threshold is exceeded and the secondary threshold is After squaring, the algorithm performs sliding
exceeded for the next six consecutive points. window integration in order to obtain waveform feature
Algorithms [11] and [12] are based on digital filters. information.
Apart from the above referenced papers, a more detailed 1
description of those ([4]-[12]) algorithms can be found y ( n) [ x(n ( N 1)) x (n ( N 2)) ... x(n)]
N
in [13].
where N is the size of the sliding window and depends
QRS detection algorithms have been proposed by
on the sampling rate. For a sampling rate of 200
our research group based on the length transformation
samples/sec the size of the window can be 30 samples.
and on syntactic methods [14], [24], [25], [26], [27],
A temporal location of the QRS is marked from the
[28]. These algorithms calculate the length and energy
rising edge of the integrated waveform.
signals of the ECG and identify peaks using variations
In the last step two thresholds are adjusted. The
and thresholds in these signals. Relative work which
higher of the two thresholds identifies peaks of the
proposes alternative approaches to QRS detection
signal. The lower threshold is used when no peak has
includes [15-20].
been detected by the higher threshold in a certain time
interval. In this case the algorithm has to search back in
Pan & Tompkins QRS detection algorithm
time for a lost peak. When a new peak is identified (as a
local maximum change of direction within a
One of the most popular QRS detection algorithms,
predefined time interval) then this peak is classified as a
included in virtually all biomedical signal processing
signal peak if it exceeds the high threshold (or the low
textbooks, is that introduced by Pan and Tompkins in
threshold if we search back in time for a lost peak) or as
[1]. An overview of the algorithm follows. Figure 1
a noise peak otherwise. In order to detect a QRS
shows a graphical representation of the basic steps of
complex the integration waveform and the filtered
the algorithm.
signals are investigated and different values for the
above thresholds are used.
To be identified as a QRS complex, a peak must be
recognized as a QRS in both integration and filtered
waveform.
* factor
ld5ld1
* factor
Resister 1
* factor
Resister 2
Adder
* factor Resister 3
to memory
Resister 4
* factor
Resister 5
speed up %
this phase the computed values of the thresholds are
255
taken into account in order to identify the QRS peak in
each RR interval. The thresholds and the duration of the 250
expected RR interval are dynamically adjusting with the 245
shape of the signal. Once a peak is detected the system 240
generates a pulse.
235
The results of the implemented hardware system
0 10.000 20.000 30.000
are presented in figure 5 where the output of each stage
is shown for 1000 samples of the European ST-T number of samples
database.
Figure 7: The fluctuation of the speed-up factor
System Evaluation according to the number of samples