You are on page 1of 4

700 IEEE TRANSACTIONS ON BIOMEDICAL ENGINEERING, VOL. BME-26, NO.

12, DECEMBER 1979

A Digital Filter for the ORS Complex Detection


MASAHIKO OKADA, MEMBER, IEEE

Abstract-The five step digital filter has been developed which re- the drawbacks of the conventional methods listed above. The
moves components other than those of QRS complex from the re- algorithm which extracts QRS complexes from the recorded
corded electrocardiogram (ECG). The final step of the filter produces ECG will be described in detail. In this study, a single lead is
a square wave whose on-intervals correspond to the segments with QRS
complexes in the original wave. used to record ECG's.
ALGORITHM
INTRODUCTION As first step, high-frequency components are separated
a
UP to this time, special purpose analog equipments have from the sampled ECG. ECG is sampled at the rate of 1000
been used to conduct continuous care on arrhythmia. It points/s.
is, however, not a easy task to incorporate fairly complicated Step 1:
logical circuit into analog equipment, which is necessary in The averages for every four sampled points are computed
order to monitor and diagnose every pattern of arrhythmia in real time and are stored. Let {Yo0, Yo2, * , Yon } be the
precisely. Most of the existing equipments employ simple sequence of data points thus stored. {Jo,} (i = 1,.* , n)
judging criteria, and there have been unsatisfactory perfor- may be regarded as the data sampled at the rate of 250
mances with them such as raising an alarm too often and so points/s. (From here on, the notation {Yji} will be used to
forth [1]. denote the waveform consisting of the points yjijs.) Smooth
The awkwardness of analog equipment has stimulated the {y0j} (i = 1, 2, *, n) by three-point moving average
development of digital computer techniques for the processing weighted with coefficients { 1, 2, 1 }. The resultant waveform
and analysis of electrocardiograms (ECG's) in the patient care is represented as {y1j} (i = 1, 2, * , n).
system. Although there have been many softwares developed Step 2:
for the computer analysis of ECG, most of them will not be Let {YJiT denote the output from the low-pass filter. Com-
applicable to the system where monitoring of ECG is per- pute the squared differences between {Yi j} and {y)j} (i =
formed for a long period of time. To obtain the satisfactory m + 1, ,n- m)as
functioning from monitoring system for arrhythmia, further
reliability must be added to the existing techniques for the Y2i=(Yli-
Y-i)2 i=rm+ 1,* n-rm (1)
computer analysis of ECG. where
This paper reports the developed method for recognizing
QRS complex which is the most important part in the com- 1 i+m
puter ECG monitoring system. QRS complex contains relatively 2m + 1 k=i-m
high-frequency components compared with other waves. Sev-
eral algorithms have been devised based solely on the point that The data pointsY2mi1,Y2m+2,** ,Y2n-m are the output
[2]-[4]. Most of them, however, have some drawbacks such from the bandpass filter which forms peaks at locations where
as the following: they may fail to detect ventricular ectopic the spikes exist in {Yiy}. Fig. 1 shows frequency character-
beats with small amplitude; may mistake abrupt disturbance istics of the filter (1).
of base line for QRS complex. In case there exist several QRS In the obtained waveform {Y2i}, there are fault peaks, e.g.,
complexes with different amplitudes and T waves with high the peaks formed by the existence of sharp T waves from
amplitude at the same time, it is difficult to set up the bound- which QRS complexes must be differentiated.
ary to distinguish between these two different waves. More- Step 3:
over, the existing methods often record three leads simul- The high-frequency components of QRS complexes appear
taneously, and compute spatial velocity for detection of QRS for a long time period from the onset to the end compared
complexes [5] -[7], but it is desirable to use as small a num- with those of other waves. Noting this point, compute the
ber of leads as possible in a patient monitoring system. modified waveform {Y3i} as
The method developed here has achieved improved reliabil-
ity in the automatic detection of QRS complexes, eliminating y3-Y2i (i+M Y2k 12
64 klk-m 64
Manuscript received November 29, 1976; revised April 15, 1979. i=MT+bLmb+t2, ne (2)
The author is with the Department of Neurophysiology, Brain Re-
search Institute, Niigata University, Niigata, Japan. The division by 64 is to prevent overflow during computation

0018-9294/79/1200-0700$00.75 C 1979 IEEE

Authorized licensed use limited to: Achmad Arifin. Downloaded on November 13, 2008 at 23:05 from IEEE Xplore. Restrictions apply.
OKADA: QRS COMPLEX DETECTION 701

corresponds to ON segments of {y5j}. The fiducial points


m=4 may be detected by searching for the maximum amplitude of
30 p %.M=3
the first derivative. After the detection of fiducial points, the
20 onset and end of QRS complexes are identified by the existing
X 10 methods [2], [3], [6], [7].
63
-Z
APPLICATION
The developed algorithm was applied to the recorded ECG
&-o (Fig. 2). Standard lead II was used to record ECG. Fig. 2
-20
shows from the top
-30 1) {y1i}: output of step 1,
2) {Y2i}: output of step 2,
40 80
frequency (Hz)
120 160 3) {Y3i}: output of step 3,
4) {y5j}: output of step 5.
Fig. 1. Frequency characteristics of (1). The value of m in (1) was In this example, the value of m is set to 3 in (1)-(3). The
varied from 2 to 4.
waveform 3) in each (a), (b), and (c) of Fig. 2 has flat peaks
(12-bit word computer is used throughout the study). In which occurred because of the hardware limitation (0 < yi -
2047 for i = 4, 5, * * *, n - 3, since the value which exceeds
{y3Y}, the segments with QRS complexes are enhanced, but 2048 was represented as 2047 in memory during computa-
the peaks of short duration in {y21} are diminished.
There are cases, however, where some events, such as abrupt tion). The waveforms 2) and 3) are scaled down by 1/32 on
stepwise fluctuation of the base line, create extra peaks in the display screen to prevent the scaling out.
{Y31}. To solve this problem, the weight is placed on {Y3i} RELIABILITY
in the next step. Tolerance for Noise
Step 4:
Compute {Y4i} as follows: As an evaluation of tolerance for noise, 50 Hz noise of
various voltages was processed through the developed filter
y41=k'y3i i=m + 1,m +2,**,n-m (3) and the gain was computed. The result is shown in Fig. 3.
where The ordinate represents the output from Step 4 as described by
(3), while the abscissa reflects the noise level in units as pre-
k 1 if (Yi -Y i-m)(Yi-Y1gi+m)>° sented by the A/D converter. Assume now that the maximum of
k=s if (Yi-Y1ji-m)(Yi -Y1i+m)<0° Y4i is 2047. Then the threshold value h for setting segments
of {Ysi} ON is 64 (. 2047/32) and it can be seen from the
Here, Y1 i- m and y1 i+ m are the points located m points ahead figure that the noise would not interfere with the detection of
of and m points behind the point yIi in {y I}, respectively. m QRS complexes if its level is less than 6. If 1 mV is converted
should be so chosen that a segment of 2m + 1 successive points to 50 in A/D converter unit, the noise level 6 corresponds to
corresponds to the average of the duration of the Q, R, and S 0.12 mV (6/50 = 0.12).
waves. Then the sign of(yiny1 - i-m) (yli - Yli+m) is posi-
tive for QRS complexes and is negative for stepwise fluctua- Verification by the Quantity p,,
tion, since the elements of QRS complexes (i.e., Q wave, R As a verification of the surpassing performance of the de-
wave, and S wave) are each symmetric on the time axis veloped method in detecting QRS complexes the quantity V1,
whereas the waveform of stepwise fluctuation is not. For the was contrived and was applied to the developed and existing
sampling rate of 250 points/s, the choice of m = 3 produced methods. Now let {Y I, Y2, * * ,YN} be the data points sam-
the best performance. The final step is the identification of pled from one heart beat of ECG. Then Vu is defined as
the fiducial points.
Step 5: Vop
Search the waveform {Y4i} for the points which exceed the E (Yk - yV)2 /2p
threshold value h given as k=v-p
vrp+ l,p+2,* -,N-p
N
h =(max {y41i=m + l,m + 2, ,n- m})/32. (y,-_y)2/N- 1
i=l
Let Y4ij, Y4i2,. ,Y4h,.., Y4i1 be the points thus found
and SI, S2,.*. , SI be the segments of 144 ms duration with where
Y4i. being the starting point of S. Convert {Y4i} into the
square wave {Ysi} by setting the segments SI, S2 ,< * *, S, ON I v+p
and all the rest OFF. The duration of ON interval is short 2p +I1 kin p
enough compared with the absolute refractory period of a
ventricular muscle cell, which assures that there will never be
I N
more than one beat of QRS complex in one ON segment. A YN BY,.
fiducial point is found in each of the segments of {y1j} which

Authorized licensed use limited to: Achmad Arifin. Downloaded on November 13, 2008 at 23:05 from IEEE Xplore. Restrictions apply.
702 IEEE TRANSACTIONS ON BIOMEDICAL ENGINEERING, VOL. BME-26, NO. 12, DECEMBER 1979

iA
0 .1 150
A-fA WV_

.1

..1.
A- 92 A :A..
100

Of
0

(a)
: 0
50

A:. F~~~~~~~- I ."-'.


% *
0 1 2 3 4 5 5 7 a 9 10
AMPLITUDE OF NOISE (points)

Fig. 3. Tolerance versus noise. Ordinate and abscissa represent the out-
put from the filter and the amplitude of 50 Hz noise.

TABLE I
COMPARISON OF VK.
Intervals with Intervals without
(b) QRS complex QRS complex
I
I
1. original ECG 1.03487 1.01379 - 1.51009
. -
2. the first derivative* 1.58155 0.05629 - 0.24858
.0~ ~~~
y
3. a.m.a.l.f.** 0.97807 0.07443 - 1.32840
..

4. author's method 3.32622 0.00000


-L
,* e

z o' S .~;.. .0 *
The first derivative of 1.; ** waveform processed by-autoregressive-
moving average low-pass filter.

3) waveform processed by auto regressive-moving average low-


pass filter [81, and 4) {Y4 J, the output from Step 4 of the
developed method. VFt was computed over the intervals with
QRS complexes (the left column) and the intervals without
(c) QRS complexes (the right column). The difference between
Fig. 2. The top waveform represents smoothed ECG. The second and the two may be interpreted as representing how successfully
the third represent the respective ouput from Steps 2 and 3. The the existence of QRS complexes is displayed in each method.
fourth represents the final output from the filter. (a) Atrial flutter As for the original waveform {yli}, V, was 1.03487 and
with repeated ectopic beats. (b) ECG of the same patient as (c). The
baseline is fluctuated because of the body movement. (c) ECG with 1.01379 1.51009 for the intervals with and without QRS
stepwise fluctuation of the baseline. Fluctuation is caused manually. complexes, respectively. For the first derivative of the wave-
QRS complexes are detected correctly in each case. form, which is often employed in QRS complex detection [21,
[3], the difference between the two was enhanced.
We set p = 12 and N = 288 in actual computation. V. (v = p + The last row shows V, computed for {y'p}. V, was 3.32622
1, p + 2, - *, N - p) thus defined, each represents the ratio
-
for the intervals with QRS complexes. It was 0 up to five
of variance of 25-point segment to the variance of the entire decimal places for the intervals without QRS complexes.
288-point interval. V, is larger at segments with QRS com-
plexes than those without. False Positive and False Negative
Table I shows the values of V, computed for 1) original wave- Finally, the performance of the procedure was evaluated by
form {yi}, 2) the first derivative of sampled waveform, the application of the method to patient ECG monitoring. As

Authorized licensed use limited to: Achmad Arifin. Downloaded on November 13, 2008 at 23:05 from IEEE Xplore. Restrictions apply.
OKADA: QRS COMPLEX DETECTION 703

TABLE II ACKNOWLEDGMENT
THE DATA USED AND THE RESULTING PERFORMANCE
The author wishes to thank Dr. N. Maruyama and Miss M.
A*2 B.2 C*2 D*3 Okada for their helpful suggestions and Miss R. Sato for
typing the manuscript.
total number of 1818 857 1230 1085
beats analyzed REFERENCES
number of normal*I 1737 857 1105 605 [1] D. A. Frost, F. G. Yanowitz, and T. A. Pryor, "Evaluation of a
beats computerized arrhythmia alarm system," Aner. J. Cardiol., voL
39, pp. 583-587, 1977.
number of abnormal*' 81 0 125 480 (2] C. A. Caceres, "Electrocardiographic analysis by a computer sys-
beats tem," Arch. Intern. Med., voL 111, pp. 196-202, 1963.
[3] T. A. Pryor, R. Russell, A. Budkin, and W. G. Price, "Electrocar-
number of false 3 0 1 4 diographic interpretation by computer," Comput. Biomed. Rea.,
positives vol. 2, pp. 537-548, 1969.
number of false 0 0 2 0 [41 C. C. Wilton-Davies, "Computer-assisted monitoring of ECG's and
negatives heart sounds," Med. Biol. Eng., vol. 10, pp. 153-162, 1972.
[5] H. K. Wolf and P. M. Rautaharju, "An on4ine program for acquis-
tion and analysis of resting and exercise electrocardiograms," in
*1 The figures are obtained by careful doctor interpretation. Proc. XIth Int. Vectorcardlography Symp. Amsterdam, The
Netherlands: North-Holland, 1971, pp. 231-236.
*2 The cases with sporadic ventricular ectopic beats. [6] J. Cornfield, R. A. Dunn, C. D. Batchlor, and H. V. Pipberger,
"Multigroup diagnosis of electrocardiograms," Comput. Biomed.
*3 The case with atrial flutter with repeated multifocal ectopic beats. Res., vol. 6, pp. 97-120, 1973.
[7] M. L. Simoons, H. B. K. Boom, and E. Smallenburg, "On4ine pro-
cessing of orthogonal exercise electrocardiograms," Comput.
for performance evaluation, there have been some methods Biomed. Res., vol. 8, pp. 105-117, 1975.
reported [9]. In this study, we evaluated the performance by [8] C. H. Klingenmaier, P. R. Moyer, J. I. Aunon, M. L. Shaffer, F. A.
investigating the false positive and false negative which oc- Siegel, and J. C. Rios, "A method of computer-assisted pacemaker
surveillance from a patient's home via telephone," Comput. Bkob
curred in QRS complex detection. The procedure was applied med. Res., vol. 6, pp. 327-335, 1973.
to the data obtained from four patients in surgery. Table II [9] C. A. Swenne, J. S. Duisterhout, and N. M. V. Hemel, "Interactive
summarizes the performance. As for the data obtained from computerized CCU-monitoring," in MTends in Computer-Processed
Electrocardiograms, J. H. V. Bemmel and J. L Willems, Edi
the patients A, B, and C, the cases with sporadic ventricular Amsterdam, The Netherlands: North-Holland, 1977, pp. 59-63.
ectopic beats, a total of 3905 beats (3699 normal and 206 ab-
normal beats as judged by doctor interpretation) was analyzed. Masahiko Okada (M77) was born in Niigata,
As a result, detection of QRS complexes was falsely reported Japan, on July 28, 1946. He received the M.D.
four times (false positive) and was missed twice (false nega- degree from Niigata University, Nilgata, Japan,
tive). Every false positive was due to the abrupt fluctuation of hin 1972.
From 1972 to 1973 he received his tining
the base line. Every false negative occurred at widened QRS in internal medicine at the Department of Med-
complexes caused by bundle branch block. As for ECG of the icine, Niigata University School of Medicine,
patient D, there was atrial flutter with repeated multifocal Niigata, Japan. In 1973 he joined the Brain
Research Institute, Niigata University, for the
ectopic beats which made it difficult to visually identify nor- study of medical information processing. He
mal configuration of QRS complexes. The method was ap- has been working on computer diagnosis, data-
plied to 1085 beats of ECG of the patient (605 normal and base, patient monitoring system, microcomputer application, and so on.
Dr. Okada is a member of the Japanese Society of Medical Electronics
480 abnormal), and obtained was such satisfactory results as and Biological Engineering, the Institute of Electronics and Communi-
only four false positives and no false negatives. cation Engineers of Japan, the Japanese Circulation Society, ACM, etc.

You might also like