Sie sind auf Seite 1von 4

The Pretreatment and Feature Data Extraction of ECG

Based on Matlab

Lina Zhang Xinhua Jiang


College of Physics and Electronic Information College of Computer and Information Engineering
Inner Mongolia Normal University Inner Mongolia Agricultural University
Hohhot, China Hohhot, China
linanazhang@126.com Jiang-xh@163.com

Abstract—The basis of ECG analysis and diagnosis is detection of typical value is 1mV. Frequency of ECG signal is low, and
reliable QRS wave group. In this paper, filtered the EMG contains a large amount of DC component. When removing
interference and frequency interference in the ECG, and the DC component, its main frequency range is 0.05Hz ~
eliminated noise using wavelet threshold denoising method, and 100Hz, and most of the energy concentrated in the 0.05Hz ~
distinguished the QRS wave group of pretreated ECG, Extracted 40Hz. Q, R and S waves are the most basic and crucial three
heart rate, R-R interval and QRS interval data. Using the basic characteristics of ECG, which are the basis of ECG. The
standard MIT-BIH arrhythmia database for algorithm ECG signal pretreatment and feature data extraction system
verification, the results show that the denoising algorithm could chart is shown in figure 1.
effectively eliminate noise, and feature points recognition
accuracy achieved 99.8%. More important, extracted feature
data provided a reliable data source for the automatic diagnosis
of ECG.

Keywords- ECG; Wavelet Transform; Pretreatment; Feature


Data Extraction

I. INTRODUCTION Figure 1. ECG signal pretreatment and feature data extraction system chart
In recent years, heart disease has become the major diseases
threatening human life. Therefore, the diagnosis of III. PRETREATMENT OF ECG SIGNAL
cardiovascular diseases and prevention has become the most
important issue in the medical profession. The ECG is a nonlinear, non-stationary signal, and noise
ratio is low. It will be interfered by many kind noises in
The ECG signal is one of bio-electric used in human collection, such as frequency interference, EMG interference
medicine early, and now the medical profession has been and baseline drift. They mixed The ECG with additive or
through the analysis of ECG studies to predict cardiovascular- multiplicative way, and cause the ECG distortion. Therefore,
related disease and diagnostic. However, ECG as a human the pretreatment ECG carried out in four. The first pretreatment
bioelectricity, the magnitude is only mV, and usually mixed is to eliminate baseline drift, the second pretreatment is to
with other biological signals, such as the EMG interference eliminate 50Hz frequency interference, the third pretreatment is
with main energy in the 35Hz, and with electromagnetic to eliminate 35Hz EMG interference, and the last pretreatment
interference of 50Hz frequency interference outside body, is to eliminate other noise using wavelet threshold denoising
those make the ECG with strong noise background, and method. The ECG signal pretreatment flow chart is shown in
measurement conditions are relatively complicated. Therefore, figure 2.
the pretreatment of ECG is basis of extracting accurately ECG
feature.
The ECG signal feature extraction is a hot research topic of
ECG signal analysis, and effective characteristic data will
provide an important basis for automatic diagnosis of heart
disease.

II. PRETREATMENT AND FEATURE DATA EXTRACTION


SYSTEM OF ECG SIGNAL
The ECG signal collected mainly from the surface of
human body, and it is very weak. Using surface electrodes as
sensors, the signal amplitude range is 10uV ~ 4mV, and its

978-1-4244-5089-3/11/$26.00 ©2011 IEEE


Pretreatment B. Design of notch filter
The notch filter is designed to filter out a range of

Wavelet Threshold Denoising


Filter Frequency Interference
frequency interference, but the basic requirements in the

Filter EMG Interference

Feature Data Extraction


filtering process is not changing the other frequency
Read the ECG Signal

Filter Base Line Drift components, Therefore, the required filter frequency response
jwt ⎧1, w ≠ w0
is H d (e )=⎨ .
⎩0, w ≠ w0
The transfer formula of digital filter can be expressed
bi + b1 z −1 + b2 z −2
m
as H ( z ) =∏
−1
, supposing the pole point
i =1 1 + a1 z + a2 z −2
jw
of second stage formula is pi = ri e i ,( ri < 1 ), in formula
Figure 2. The ECG signal pretreatment flow chart
every second stage formula is calculated by under formula:
A. Eliminating Baseline Drift ( z − e jwe )( z − e − jwe )
H i ( z) = . Each second stage unit
The baseline drift is usually from breathing, frequency is ( z − ri e jwe )( z − ri e − jwe )
between 0.15 ~ 0.3Hz, can filter by the superposition average corresponds to a stop-band. When actual filter is done,
method. Suppose the comprehensive ECG signals from body according to the need number of the filter stop-band, location,
surface is composed of pure ECG and random noise two parts, bandwidth, and etc, each unit is calculated the parameters.
and expressed as: xi (t ) = si (t ) + ni (t ) , and Subscript i Finally, the same structure second stage unit are cascaded to
complete filtering system. 50Hz, 35Hz filter frequency
represents the i cardiac, si (t ) represents pure ECG signal, characteristic curves are shown in figure 4.
ni (t ) represents random noise. If N cardiac comprehensive
100
Magnitude(dB)

ECG signals is gathered continuously from body surfer, then


the N cardiac signal overall average: 0

N N
n(t )
x(t ) = ∑ xi (t ) / N =s (t ) + ∑ ni (t ) / N = s (t ) +
-100
0 50 100 150
Frequency (Hz)
i =1 i =1 N
Phase(degrees)

100
. The amplitude or root mean square of the noise component
above ECG signal was reduced N times, and improve noise 0

ratio of the signal. The result of eliminating baseline drift using -100
superimposed average filter is shown in figure 3. 0 50 100
Frequency (Hz)
150

(a) 50Hz Notch Filter Frequency Characteristic Curve

100
Magnitude (dB)

-100
0 50 100 150
Frequency (Hz)
Phase (degrees)

100

-100
0 50 100 150
Frequency (Hz)

(b) 35Hz Notch Filter Frequency Characteristic Curve

Figure 4. 50Hz, 35Hz Notch Filter Frequency Characteristic Curve

Figure 3. The result of eliminating baseline drifts using superimposed


average filter
To make the ECG signal with frequency interference and different features of valid signal and noise signal to remove
EMG interference through the notch filter, the filtering results noise, and to retain effective signal.
are shown in figure 5.
Because db wavelet is a set of compactly supported wavelet
with extremal phase and maximum vanishing rule. These
Input signal features greatly increase the feasibility of the filtering. After
several simulations, db4 wavelet is selected as a transformation
1 function. ECG signal denoised by bd4 is shown in figure 6.
Amplitude

0.5

2500 3000 3500


Sampling points
Filter output
1.5
Amplitude

0.5

2500 3000 3500


Sampling points

(a) Filtering the 50Hz Frequency Interference

Input signal Figure 6. ECG signal denoised by db4


1.5
Amplitude

1 IV. FEATURE DATA EXTRACTION


0.5 The Q, R, S wave are three most fundamental and critical
0 feature of the ECG signal, and are ECG basis. The Q, R, S
wave are high amplitude wave, however, due to interference
2600 2800 3000 3200 3400 and individual differences, likely to cause misjudgment or
Sampling points missing. The R wave detection is basic of the other wave, and
1.5
Filter output the R wave detection is the most critical part of ECG.
Amplitude

1
A. The Location Principle of the Singular Point of Signal
0.5
All singular point of the signal f (x ) is along the modulus
0
maxima line on the scale-time space, and wavelet transform
2600 2800 3000 3200 3400 Ws f (x) modulus maxima point is mutation of signal when s
Sampling points is sufficiently close to zero. The signal mutation detection is a
(b) Filtering the 35Hz EMG Interference very important aspect of the signal wavelet transform. The
signal mutation point is corresponding to the extreme point or
Figure 5. The ECG Signals Filtered the frequency interference and the EMG crossing point of the wavelet transforms modulus in wavelet
interference transform domain, and singularity of the signal correspond
with the scale of transformation law of extremum of wavelet
C. Wavelet Threshold Denoising transform coefficients. Therefore, the wavelet transform
applied to describe the transient characteristics of the signal is
The threshold denoising is to compress wavelet variant
very significant.
coefficient of signal according to a certain reset threshold, and
then uses compressed coefficient to reconstruct signal to The QRS detection using wavelet transform has the
achieve noise reduction. The most widely used is hard following characteristics:
threshold and soft threshold denoising method proposed by
Donoho. In the wavelet domain, the signal energy is relatively • Because wavelet transform 2
W i f ( n)
can represent the
concentrated in certain locations, while the noise is generally signal components of different frequencies, on the
more widely distributed. According to the transient 3
characteristics of signal, signal is mainly shown in large scale of S = 2 , high frequency noise is attenuation,
coefficient, while small coefficient is more generated by the while low frequency component, such as baseline drift
mutation of noise and signal energy. Therefore, wavelet and P wave, has small attenuation on this scale, so the
threshold denoising is to use the performance of singularity detection rate of QRS is greatly improved on this scale.
• Pseudo-trace of ECG very likely to cause miscarriage C. Extraction of feature data
of justice. There is a good solution to this problem by Because ECG waveforms are different, for computer
removing isolated extreme points in detection. automatic diagnosis system, it needs feature data to identify the
types of ECG. Here, RR interval and QRS interval data are
B. Implementation of QRS wave detection extracted as characteristic parameters. For MIT-BIH database
QRS wave has the largest wavelet transform amplitude in (Record: No.100) example, extracted feature parameters are
3 shown in table 1.
scale of S = 2 , while low frequency and high frequency
components are significant attenuation, and peak point of QRS, R Wave 1 2 3 4 5 6 7 8 9 10
Number
that is R point, corresponds to the point that is the zero- RR 0.817 0.814 0.789 0.789 0.789 0.817 0.653 0.995 0.842 0.811
crossing point of positive and negative value point of wavelet Interval

23 − 1 QRS
Width
0.117 0.097 0.086 0.108 0.089 0.097 0.117 0.106 0.094 0.117
transform plus offset . Similarly, the Q wave, R wave
2
TABLE I. THE PREVIOUS 10 WAVEFORM PARAMETERS OF THE MIT-BIH
can be detected as above method. Detection algorithm flow (RECORD: NO.100)
chart of QRS is shown in figure 7.
ECG Signal after Pretreatment V. ANALYSES
Selected typical 8 signals from the MIT-BIH arrhymia
Wavelet Decomposition (j=1,2,3,4) database as the detection object, and took samples within 90s,
and compared actual number of its R-peak with the detected
Testing positive-negative maximum value (j = 3) number of its R-peak, then computed the detection accuracy.
The results are shown in table 2.
Seeking QRS wave starting point and end point
TABLE II. RESULTS OF WAVELET DETECTION

MIT-BIH 100 103 109 202 208 209 212 215 total
R wave interval is (Record:
less than the No.)
threshold? Actual R 111 105 134 79 157 141 135 170 1031
Remove Multi-Detection Wave Peak
Number
Point Detect R 111 105 134 78 157 141 135 169 1029
Wave Peak
Number
R wave interval is more False and 0 0 0 1 0 0 0 1 2
than the threshold? Missed
Number
Add missed points Accuracy 100 100 100 98.7 100 100 100 99.4 99.8
(%)
End
Data analysis is shown that detection accuracy of QRS is
99.8%, that is, this method can well detect QRS wave.
Figure 7. Detection algorithm flow chart of QRS
VI. CONCLUSION
Detected results of QRS are shown in figure 8.
ECG is important basis for clinical diagnosis of
cardiovascular disease. ECG automatic diagnosis can make
medical personnel is freed from the tedious pattern recognition
and data processing. At the same time, it can greatly improve
efficiency. So, improving the recognition rate, and extracting
effective feature data has an important practical significance.

REFERENCES
[1] Wang Jiawang, Wu Lingyan, etc. The implement and the relative of
several kinds of arithmetic to take base-line excursion for ECG signal.
China medical device information. 2008, Vol.14, No.6
[2] Li Kunyang, Hu Guangshu, Arrhythmia classification based on ECG
Figure 8. Detected results of QRS anslysis, J Tsinghua Univ (Sci & Tech), 2009, Vol.49, No.3
[3] Feisi technology R&D center. Auxiliary wavelet analysis and
application based on Matlab 6.5. Publishing House of Electronics
Industry. Beijing. 2003.1

Das könnte Ihnen auch gefallen