Professional Documents
Culture Documents
3, MARCH 1997
159
I. INTRODUCTION
160
where
(2)
is the noise power spectrum. The frequency
where
response can be calculated and the impulse response obtained
using inverse Fourier transform, if the signal and the noise
spectra are known. the practical method is to use a whitening
prefilter and a matched filter for the prefiltered signal. In
such case, the impulse response for the matched filter can be
defined from the prefiltered signal waveform. For the ultimate
solution the QRS detection the properties of the matched
filter should adapt continuously to temporal variations in the
QRS complex and noise properties. This, however, leads to
increased complexity in realization.
2) Decision Rule: Principles from communications theory
can be applied in defining the threshold level. In communications theory the optimum threshold level is calculated for the
on-off signal corrupted by Gaussian distributed noise. If equal
probabilities of false negatives and false positives are desired,
for the on-off signal is [4]
the optimum threshold level
(3)
and
are the probabilities of two signal values,
where
is the signal amplitude, and
the noise variance (mean noise
power). In binary data transmission where the probability of
ones and zeros are equal, the optimum threshold level is 50%
of the symbol one amplitude.
Similarly, in QRS detection the QRS complex (or preprocessed QRS complex) can be thought of as symbol one
and the silent segment between the two QRS complexes as
161
and digital domains. The block diagram for the signal processing path is shown in Fig. 2. The device was fitted with
an amplifier stage with automatic gain control (AGC) and a
fourth-order analog prefilter which attenuates the components
of the measured signal outside the 0.535-Hz frequency band.
The frequency response is shown in Fig. 3(a). This enhances
the SNR enough so that the ECG signal can be amplified
to approximately 75% of the maximum input range of the
analog/digital (A/D) converter without baseline variation or
motion artifacts driving the amplifier or A/D converter out of
its dynamic range. The band-limited and amplified signal is
then fed to a 10-bit A/D converter which samples the signal
at 500 samples/s. The AGC algorithm is shown below.
Variable definitions:
HIGH: positive envelope
LOW: negative envelope
ACG TD: AGC decay time constant (2 s.)
AGC MAX, AGC MIN: AGC limit constants
(0.75 and 0.25 of the ADC range)
For (each input sample
at the ADC output)
If (
HIGH) then HIGH =
.
If (
LOW) then LOW =
.
If (AGC TD seconds have passed since
previous update of HIGH or LOW)
then HIGH = 0.9*HIGH,
LOW = 0.9*LOW.
If (HIGH ACG MAX) or
(LOW
AGC MAX) then (decrease
the preamplifier gain by a step).
If (HIGH AGC MIN) and
(LOW
AGC MIN) then (increase
the preamplifier gain by a step).
b) Filtering: The initial sampling speed of 500 Hz and
interpolation to 2 kHz in subsequent stages was selected
because it was believed to provide sufficiently accurate timing
information. As this frequency is an integral multiple of the
50-Hz power-line frequency being used in Europe, it allows
for a simple implementation of a 50-Hz notch filter which
removes any residual power-line interference from the sampled
signal. The notch filter is realized using a comb filter, which
introduces a transmission zero at 50 Hz by summing the
current and a 10-ms delayed sample together. The amplitude
response in shown in Fig. 3(b).
The second digital filter stage after the comb filter is
a bandpass filter which attenuates the low-frequency noise
caused by, for example, motion artifacts. The passband (1540
(4)
This stage also introduces a transmission zero at a frequency
near 60 Hz to attenuate the mains-noise of 60 Hz used in
some countries. The amplitude response is shown in Fig. 3(c).
Complex-resonator/comb-filter was chosen for easy implementation. More sophisticated filters based on infinite impulse
response (IIR) or finite impulse response (FIR) structures
could also be used and these would allow more freedom in
choosing the transfer function for the whitening filter. All
the multiplications and divisions required in the comb and
complex resonator filters are by a power of two so they can
implemented with bit shifting. This allows for the filters to
be implemented very efficiently in assembly language. The
combined amplitude response is shown in Fig. 3(d).
The final filtering stage is a matched filter providing an optimal SNR and, more importantly, a symmetrical output pulse
waveform. The matched filter output for the filter impulse
128 is calculated as
response length
(5)
162
(a)
(b)
(c)
(d)
Fig. 3. (a) The amplitude responses of the analog prefilter, (b) digital comb filter, (c) digital bandpass filter, and (d) the combination of these.
Fig. 4. The matched filter impulse response for a prefiltered QRS complex.
163
(a)
(b)
(c)
Fig. 5. (a) Almost noiseless ECG signal, which is (b) bandpass filtered, and (c) matched filtered.
pseudo-code as follows.
Variable definitions:
ENV: matched filter output envelope
THR: threshold constant (0.40.6)
THRES: threshold coefficient
DET: binary value detection signal
ETR: envelope rise rate constant (2 s)
ETD: envelope decay rate constant (515 s)
EHC: envelope hold time constant (2 s)
T LASTP: detection threshold keep time (200 ms)
For (each output sample
from the matched filter)
If (
THRES * ENV)
then DET
else DET
.
If (
ENV) then ENV = ENV + ETR*
.
If (
ENV) and (EHC seconds has passed
since the previous update)
then ENV = 0.9*ENV.
If (DET
) and (DET
)
then THRES = 0.9.
If (more than T LASTP has passed
since the previous detection) and
(THRES THR) then
THRES = 0.9*THRES.
As the matched filter has the additional property of providing a symmetrical output for the desired inputs, dual edge
threshold detection can be applied successfully, Fig. 7. In dual
edge detection the vertical center-line of the signal exceeding
as
the threshold level value is calculated by
being the fiducial point for the QRS complex. This is known
to reduce the timing error by reducing the sensitivity to lowfrequency additive and multiplicative noise, i.e., the baseline
and amplitude modulation caused by breathing [5]. With such
164
(a)
(b)
(c)
Fig. 6. (a) Noisy ECG signal, which is (b) bandpass filtered, and (c) matched filtered.
TABLE I
NOISE TYPES USED IN TESTS
Fig. 7. The dual edge detection principle with amplitude modulated pulse.
165
TABLE IV
TEST RESULTS WITH MIT-BIH RECORDS 103
= 70120
TABLE II
THE QRS DETECTION TIMING ACCURACY WITH 5-HZ ADDITIVE NOISE
TABLE III
THE QRS DETECTION TIMING ACCURACY WITH ADDITIVE GAUSSIAN NOISE
this type of noise, the detection timing error is less than 0.9
ms (sd) with pulse rates of 50200 bpm and noise amplitudes
up to 80% (160% peak-to-peak) of QRS complex amplitude.
The maximum timing error of all detections was 2 ms.
The 5-Hz sine wave represents a noise signal with a
frequency in the upper frequency range of noise due to motion
artifact. The timing error of less than 1 ms (sd) with maximum
error of 2 ms was achieved with sine noise amplitude of
40% (80% peak-to-peak) relative to QRS complex amplitude.
Greater noise amplitude of 80% increased timing error (sd
4 ms) at highest pulse rate of 200 bpm markedly, Table II.
The detector exhibits good tolerance to mains interference
as the comb filter effectively removes the 50-Hz mains-noise,
the timing error is less than 0.5 ms at noise levels up to 80%
(sd) at all pulse rates tested. The maximum timing error of all
1 ms.
detections was 2
Gaussian noise simulates noise due to electromyogram
(EMG) signals and motion artifacts. With a Gaussian noise
level of 25% (rms) of QRS complex amplitude the timing error
is less than 1 ms (sd), maximum timing error for all detections
at this noise level is 3 3 ms. With higher levels of noise
the timing error increased, the results are shown in Table III.
The detector is insensitive to amplitude modulation of the
QRS complex which is important even in HRV measurement
at rest due to amplitude modulation caused by respiration.
Amplitude modulation up to 30% allows the QRS complex
to be detected with timing error less than 0.7 ms (sd). The
AND
105
166
TABLE V
THE DETECTION TIMING ACCURACY WITH TYPICAL
NOISE LEVELS AND HEART RATES OF 50200 BPM
TABLE VI
TEST RESULTS WITH MIT-BIH RECORDS 105 (TOTAL OF 2572 QRS COMPLEXES)
167
REFERENCES
[1] M. Malik, T. Cripps, T. Farrell, and A. J. Camm, Prognostic value
of heart rate variability after myocardial infarction. A comparison of
different data-processing methods, Med. Biol. Eng. Comput., vol. 27,
pp. 603611, 1989.
[2] Y. Yamamoto, R. L. Hughson, and J. C. Peterson, Autonomic control
of heart rate during exercise studied by heart rate variability spectral
analysis, J. Appl. Physiol., vol. 71, no. 3, pp. 11361142, 1991.
[3] P. Z. Peebles, Probability, Random Variables, and Random Signal
Principles. New York: McGraw-Hill, 1980, ch. 9, pp. 257267.
[4] M. Schwarz, Information Transmission, Modulation, and Noise. New
York: McGraw-Hill, 1970, ch. 8, pp. 577584.
[5] G. J. H. Uijen and J. P. C. de Weerd, Accuracy of QRS detection in relation to the analysis of high-frequency components in the
electrocardiogram, Med. Biol. Eng. Comput., vol. 17, pp. 492502,
1979.
[6] MIT-BIH Database Distribution, Massachusetts Institute of Technology,
77 Massachusetts Avenue, Room 20A-113, Cambridge, MA 02139.
[7] Standard for Cardiac Monitors, Heart Rate Meters and Alarms (draft),
Association for the Advancement of Medical Instrumention (AAMI),
Aug. 1981.
[8] Polar Sport Tester manufactured by Polar Electro Oy, Professorintie 5,
FIN-90440 Kempele, Finland.
[9] G. M. Friesen et al., A comparison of the noise sensitivity of nine
QRS detection algorithms, IEEE Trans. Biomed. Eng., vol. 37, no. 1,
pp. 8598, 1990.
[10] N. V. Thakor et al., Estimation of QRS complex power spectra for
design of a QRS filter, IEEE Trans. Biomed. Eng., vol. BME-31, pp.
702705, Nov. 1984.
[11] V. Barbaro, P. Bartolini, and M. Fierli, New algorithm for the detection
of the ECG fiducial point in the averaging technique, Med. Biol. Eng.
Comput., vol. 21, pp. 129135, 1991.
Seppo Nissila received the Diploma Engineer, Licentiate of Technology, and Doctor of Technology
degrees in electronics engineering from the University of Oulu, Finland, in 1987, 1990, and 1995,
respectively.
He is an Acting Professor of Optoelectronics in
the Department of Electrical Engineering, University of Oulu. His current research interests include
electrooptical measurements, especially fiber-optics;
and biomedical measurements and devices, especially noninvasive, ambulatory heart rate, and blood
pressure instruments.