ECG DE-NOISING TECHNIQUES FOR DETECTION OF ARRHYTHMIA · ECG DE-NOISING TECHNIQUES FOR DETECTION OF...

6
International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395 -0056 Volume: 02 Issue: 09 | Dec-2015 www.irjet.net p-ISSN: 2395-0072 © 2015, IRJET ISO 9001:2008 Certified Journal Page 2528 ECG DE-NOISING TECHNIQUES FOR DETECTION OF ARRHYTHMIA Rezuana Bai J 1 1 Assistant Professor, Dept. of Electronics& Communication Engineering, Govt.RIT, Kottayam. ---------------------------------------------------------------------***--------------------------------------------------------------------- AbstractRemoving motion artifacts from an electrocardiogram (ECG) is one of the important issues to be considered during real-time heart rate measurements in telemetric health care. However, motion artifacts are part of the transient baseline change caused by the electrode motions that are the results of a subject’s movement. Baseline correction and noise suppression are the two important pre-requisites for conditioning of the ECG signal and thereby detecting Arrhythmia. In this paper, morphological filtering technique for removing baseline drift using a non-flat structuring element is used. Later, we compare different methods which will eliminate the remaining noise. To extract the quality ECG signal from the raw noisy ECG signal Descrete Wavelet Transform based denoising were employed by using three wavelet function and four thresholding rules. Keywords arrhythmia; sinus rhythm; Savitzky- Golay Filter; Morphological Filter; Wavelet Transformation 1. Introduction According to the World Health Organization, cardiovascular diseases are among the top three leading causes of death worldwide regardless of country income levels. In 2005, 17 million people died from cardiovascular diseases globally and the World Health Organization expects this number to reach 20 million by 2017. Therefore, it is necessary to have proper methods to determine the cardiac condition of the patient. Electrocardiography (ECG) is a tool that is widely used to understand the condition of the heart. The electrocardiograph signal is the electrical representation of the heart’s activity. Computerized ECG analysis is widely used as a reliable technique for the diagnosis of cardiovascular diseases. However, ambulatory ECG recordings obtained by placing electrodes on the patient’s chest are inevitably contaminated by several different types of artifacts. Commonly encountered artifacts include : Power line interference, Electrode contact noise, Motion artifacts, Baseline drift, Instrumentation noise generated by electronic devices and electro-surgical devices. 2. ELECTRICAL CONDUCTION SYSTEM OF THE HEART Each heart beat originates as an electrical impulse from a small area of tissue in the right atrium of the heart called the sinus node or sino-atrial node or SA node. The impulse initially causes both atria to contract, then activates the atrio-ventricular node which is normally the only electrical connection between the atria and the ventricles. The impulse then spreads through both ventricles via the Bundle of His and the Purkinje fibres causing a synchronized contraction of the heart muscle and, thus, the pulse. In adults the normal resting heart rate ranges from 60 to 80 beats per minute. The resting heart rate in children is much faster. In athletes though, the resting heart rate can be as slow as 40 beats per minute, and be considered as normal. 3. CARDIAC RHYTHM DIAGNOSIS Study of a patient's cardiac rhythms using an ECG may indicate normal or abnormal conditions. Abnormal rhythms are called arrhythmia or sometimes, dysrhythmia. Arrhythmia is an abnormally slow or fast heart rate or an irregular cardiac rhythm. During a single heart beat, several electrical events occur. These events are part of an ECG tracing and are called P, Q, R, S, T and U. 3.1 DIFFERENTIATING P, QRS and T WAVES Because of the anatomical differences between the atria and the ventricles, their sequential activation, depolarization, and re-polarization produce clearly differentiable deflections. Identification of the normal QRS-complex from the P- and T-waves does not create difficulties because it has a characteristic waveform and dominating amplitude. This amplitude is about 1 mV in a normal heart. The normal duration of the QRS is 0.08- 0.09s.

Transcript of ECG DE-NOISING TECHNIQUES FOR DETECTION OF ARRHYTHMIA · ECG DE-NOISING TECHNIQUES FOR DETECTION OF...

Page 1: ECG DE-NOISING TECHNIQUES FOR DETECTION OF ARRHYTHMIA · ECG DE-NOISING TECHNIQUES FOR DETECTION OF ARRHYTHMIA Rezuana Bai J1 1Assistant Professor, Dept. of Electronics& Communication

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395 -0056

Volume: 02 Issue: 09 | Dec-2015 www.irjet.net p-ISSN: 2395-0072

© 2015, IRJET ISO 9001:2008 Certified Journal Page 2528

ECG DE-NOISING TECHNIQUES FOR DETECTION OF ARRHYTHMIA

Rezuana Bai J1

1Assistant Professor, Dept. of Electronics& Communication Engineering, Govt.RIT, Kottayam.

---------------------------------------------------------------------***---------------------------------------------------------------------

Abstract—Removing motion artifacts from an

electrocardiogram (ECG) is one of the important issues to be

considered during real-time heart rate measurements in

telemetric health care. However, motion artifacts are part of

the transient baseline change caused by the electrode

motions that are the results of a subject’s movement.

Baseline correction and noise suppression are the two

important pre-requisites for conditioning of the ECG signal

and thereby detecting Arrhythmia. In this paper,

morphological filtering technique for removing baseline

drift using a non-flat structuring element is used. Later, we

compare different methods which will eliminate the

remaining noise. To extract the quality ECG signal from the

raw noisy ECG signal Descrete Wavelet Transform based

denoising were employed by using three wavelet function

and four thresholding rules.

Keywords — arrhythmia; sinus rhythm; Savitzky-Golay Filter; Morphological Filter; Wavelet Transformation

1. Introduction

According to the World Health Organization,

cardiovascular diseases are among the top three leading

causes of death worldwide regardless of country income

levels. In 2005, 17 million people died from cardiovascular

diseases globally and the World Health Organization

expects this number to reach 20 million by 2017.

Therefore, it is necessary to have proper methods to

determine the cardiac condition of the patient.

Electrocardiography (ECG) is a tool that is widely used to

understand the condition of the heart. The

electrocardiograph signal is the electrical representation

of the heart’s activity. Computerized ECG analysis is

widely used as a reliable technique for the diagnosis of

cardiovascular diseases. However, ambulatory ECG

recordings obtained by placing electrodes on the patient’s

chest are inevitably contaminated by several different

types of artifacts. Commonly encountered artifacts include

: Power line interference, Electrode contact noise, Motion

artifacts, Baseline drift, Instrumentation noise generated

by electronic devices and electro-surgical devices.

2. ELECTRICAL CONDUCTION SYSTEM OF THE HEART

Each heart beat originates as an electrical impulse from a small area of tissue in the right atrium of the heart called the sinus node or sino-atrial node or SA node. The impulse initially causes both atria to contract, then activates the atrio-ventricular node which is normally the only electrical connection between the atria and the ventricles. The impulse then spreads through both ventricles via the Bundle of His and the Purkinje fibres causing a synchronized contraction of the heart muscle and, thus, the pulse. In adults the normal resting heart rate ranges from 60 to 80 beats per minute. The resting heart rate in children is much faster. In athletes though, the resting heart rate can be as slow as 40 beats per minute, and be considered as normal.

3. CARDIAC RHYTHM DIAGNOSIS

Study of a patient's cardiac rhythms using an ECG may

indicate normal or abnormal conditions. Abnormal

rhythms are called arrhythmia or sometimes,

dysrhythmia. Arrhythmia is an abnormally slow or fast

heart rate or an irregular cardiac rhythm. During a single

heart beat, several electrical events occur. These events

are part of an ECG tracing and are called P, Q, R, S, T and U.

3.1 DIFFERENTIATING P, QRS and T WAVES

Because of the anatomical differences between the atria

and the ventricles, their sequential activation,

depolarization, and re-polarization produce clearly

differentiable deflections. Identification of the normal

QRS-complex from the P- and T-waves does not create

difficulties because it has a characteristic waveform and

dominating amplitude. This amplitude is about 1 mV in a

normal heart. The normal duration of the QRS is 0.08-

0.09s.

Page 2: ECG DE-NOISING TECHNIQUES FOR DETECTION OF ARRHYTHMIA · ECG DE-NOISING TECHNIQUES FOR DETECTION OF ARRHYTHMIA Rezuana Bai J1 1Assistant Professor, Dept. of Electronics& Communication

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395 -0056

Volume: 02 Issue: 09 | Dec-2015 www.irjet.net p-ISSN: 2395-0072

© 2015, IRJET ISO 9001:2008 Certified Journal Page 2529

R

P

QS

T

J

S–T segment

P–R interval

U

0.18–0.2 s

S–T interval

Q–T interval 0.28–0.43 s

0.11–0.16 s

Fig.1. Typical ECG waveform

Normally, the P-wave has an amplitude of about 0.1mV

and duration of 0.1s. For the T-wave, it is about 0.2mV and

0.2s. The T-wave can be differentiated from the P-wave by

observing that the T-wave follows the QRS-complex after

about 0.2s.

3.2 Normal sinus rhythm

Normal sinus rhythm is the rhythm of a healthy normal

heart, where the sinus node triggers the cardiac activation.

This is easily diagnosed by noting that the three

deflections, P-QRS-T, follow in this order and are

differentiable. The sinus rhythm is normal if its frequency

is between 60 and 100/min.

Fig.2.Normal sinus rhythm

4 Arrhythmia

An irregular heartbeat is an arrhythmia (also called

dysrhythmia). Heart rates can also be irregular. A normal

heart rate is 60 to 100 beats per minute. Arrhythmias and

abnormal heart rates will not necessarily occur together.

Arrhythmias can occur with a normal heart rate, or with

heart rates that are slow (called bradyarrhythmias -- less

than 60 beats per minute). Arrhythmias can also occur

with rapid heart rates (called tachyarrhythmias -- faster

than 100 beats per minute). Different types of arrhythmia

are as follows:

(i) Atrial Fibrillation

(ii) Atrial Tachycardia

(iii) Ventricular Tachycardia (iv)

Ventricular Fibrillation

4.1 Atrial fibrillation

The activation in the atria may also be fully irregular and

chaotic, producing irregular fluctuations in the baseline. A

consequence is that the ventricular rate is rapid and

irregular, though the QRS contour is usually normal. Atrial

fibrillation occurs as a consequence of rheumatic disease,

atherosclerotic disease, hyperthyroidism, and pericarditis.

Fig.3: Atrial Fibrillation

4.2 Atrial Tachycardia

A sinus rhythm of higher than 100/min is called sinus

tachycardia. It occurs most often as a physiological

response to physical exercise or psychical stress, but may

also result from congestive heart failure.

Fig.4: Atrial Tachycardia

4.3 Ventricular Tachycardia

A rhythm of ventricular origin may also be a consequence

of a slower conduction in ischemic ventricular muscle that

leads to circular activation (re-entry). The result is

activation of the ventricular muscle at a high rate (over

120/min), causing rapid, bizarre, and wide QRS-

complexes; the arrythmia is called ventricular tachycardia.

As noted, ventricular tachycardia is often a consequence of

ischemia and myocardial infarction.

Page 3: ECG DE-NOISING TECHNIQUES FOR DETECTION OF ARRHYTHMIA · ECG DE-NOISING TECHNIQUES FOR DETECTION OF ARRHYTHMIA Rezuana Bai J1 1Assistant Professor, Dept. of Electronics& Communication

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395 -0056

Volume: 02 Issue: 09 | Dec-2015 www.irjet.net p-ISSN: 2395-0072

© 2015, IRJET ISO 9001:2008 Certified Journal Page 2530

Fig.5 : Ventricular Tachycardia

4.4 Ventricular fibrillation

When ventricular depolarization occurs chaotically, the

situation is called ventricular fibrillation. This is reflected

in the ECG, which demonstrates coarse irregular

undulations without QRS-complexes. The cause of

fibrillation is the establishment of multiple re-entry loops

usually involving diseased heart muscle. The lack of blood

circulation leads to almost immediate loss of

consciousness and death within minutes. The ventricular

fibrillation may be stopped with an external defibrillator

pulse and appropriate medication.

Fig.6 :Ventricular fibrillation

5 DE-NOISING OF ECG SIGNAL

Block diagram for denoising the ECG signal is shown

below. The step by step procedure for denoising is

explained as follows.

Fig.7: Block diagram representation

5.1 Simulation Of ECG Signal

For simulation purposes in the present work, ECG signals

are adapted from internationally accepted Massachusetts

Institute of Technology – Beth Israel Hospital (MIT-

BIH) database that consists of recordings which are

observed in clinical practice.

5.2 Creating a Noisy ECG Signal

The ECG recordings were created using two clean

recordings from the MIT-BIH Arrhythmia Database to

which calibrated amounts of noise from record 'em' and

from record 'bw' were added which are termed as Noise

Stress Databases.

5.3 Removal Of Noise Using Filters

(i) Savitzky-Golay Filter

The Savitzky–Golay smoothing filter is a filter that

essentially performs a local polynomial regression (of

degree k) on a series of values (of at least k+1 points

which are treated as being equally spaced in the series) to

determine the smoothed value for each point. The main

advantage of this approach is that it tends to preserve

features of the distribution such as relative maxima,

minima and width, which are usually 'flattened' by other

adjacent averaging techniques.

(ii) Moving Average Filter

A moving average filter is a type of finite impulse response

filter used to analyze a set of data points by creating a

series of averages of different subsets of the full data set.

Given a series of numbers and a fixed subset size, the first

element of the moving average is obtained by taking the

average of the initial fixed subset of the number series.

Then the subset is modified by "shifting forward", that is

excluding the first number of the series and including the

next number following the original subset in the series.

This creates a new subset of numbers, which is averaged.

This process is repeated over the entire data series. The

plot line connecting all the (fixed) averages is the moving

average. A moving average is a set of numbers, each of

which is the average of the corresponding subset of a

larger set of datum points. A moving average may also use

unequal weights for each datum value in the subset to

emphasize particular values in the subset.

(iii) FIR Filter

A finite impulse response (FIR) filter is a filter whose

impulse response (or response to any finite length input)

is of finite duration, because it settles to zero in finite time.

This is in contrast to infinite impulse response (IIR) filters,

which may have internal feedback and may continue to

respond indefinitely (usually decaying). The impulse

response of an Nth-order discrete-time FIR filter lasts for

N + 1 samples, and then settles to zero.

Page 4: ECG DE-NOISING TECHNIQUES FOR DETECTION OF ARRHYTHMIA · ECG DE-NOISING TECHNIQUES FOR DETECTION OF ARRHYTHMIA Rezuana Bai J1 1Assistant Professor, Dept. of Electronics& Communication

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395 -0056

Volume: 02 Issue: 09 | Dec-2015 www.irjet.net p-ISSN: 2395-0072

© 2015, IRJET ISO 9001:2008 Certified Journal Page 2531

(iv) Butterworth Filter

The Butterworth filter is a type of signal processing filter

designed to have as flat a frequency response as possible

in the pass band and monotonic overall. Butterworth

filters sacrifice rolloff steepness for monotonicity in the

pass- and stop bands. The smoothness of the Butterworth

filter output is maximum when compared with other

digital filters. It is also referred to as a maximally flat

magnitude filter.

(v) Morphological Filter

Morphological filtering is a non-linear transformation

technique in which shape information (of features) is

extracted by using a structuring element (of appropriate

dimensions) to operate on the input signal. Erosion,

dilation, opening and closing are the common

morphological operators used. Erosion of a signal by

structuring element is defined as moving local minima of

the signal inside the structuring element or mask.

Similarly dilation is defined as moving local maxima of the

signal inside the structuring element. Therefore dilation

enlarges the maxima of the signal while erosion enlarges

the minima of the signal. Opening (erosion followed by

dilation) by structuring element smoothes the signal from

below by cutting down its peaks. Similarly, closing

(dilation followed by erosion) by structuring element

smoothes the signal from above by filling up its valleys.

Hence, opening and closing operations can be used for

detection of peaks and valleys in the signal. Improper

selection of size of structuring element may distort the

adjacent wave in the ECG signal. Hence, the size of

structuring element should be greater than the width of

the characteristic wave. Flat structuring elements often

lead to distortion due to overlap of low frequency ST

segment with the baseline wandering, thereby causing loss

of relevant information. Hence, a non-flat (ball-shaped)

structuring element is proposed as it improves the

performance of morphological filtering in terms of smooth

opening and closing of ECG signal. After removing the

baseline wandering, any noise left is also suppressed using

the morphological operation.

(vi)Wavelet Transformation

In Short Time Fourier Transform (STFT), the window

should always have a constant size, and thereby it does not

give multi resolution information on the signal. However,

the wavelet transform holds the property of multi

resolution to give both time and frequency domain

information in a simultaneous manner through variable

window size. The wavelet transform is scaled and shifted

version of the time mother wavelet (a signal with tiny

oscillations).The mother wavelet DWT is expressed by:

0,,

1)(,

aRba

a

at

atba

where, 'a' and ‘b’ are the scaling and the shifting factor,

respectively and R is the wavelet space. The mother

wavelet must satisfy the condition (admissibility) in Eqn.

dC

2

where, ψ (ω) is the Fourier transform of the mother

wavelet function (ψa,b (t)).

5.4 Wavelet Denoising Algorithm

In practice, the raw signal acquired using data acquisition

system is expressed by

)()()( nunsnX

In assumption, the raw signals are usually contaminated

with noise as shown in the above equation ,

(i) Initially, decompose the input signal using

DWT: Choose a wavelet and determine the decomposition

level of a wavelet transform N, then implement N layers

wavelet decomposition of signal S.

(ii) Select the thresholding method and thresholding rule

for quantization of wavelet coefficients. Apply the

thresholding on each level of wavelet decomposition

and this thresholding value removes the wavelet

coefficients above the threshold value.

(iii) Finally, the denoised signals reconstructed without

affecting any features of signal interest. The

reconstruction was done by performing the Inverse

Discrete Wavelet Transform (IDWT) of various

wavelet coefficients for each decomposition level.

Out of the above three steps, the most critical is to select

the proper threshold. Because, it directly reflects the

quality of the de-noising

6 RESULTS

Firstly, the input ECG signal is corrupted only with the

baseline wandering signal. It is observed that

Page 5: ECG DE-NOISING TECHNIQUES FOR DETECTION OF ARRHYTHMIA · ECG DE-NOISING TECHNIQUES FOR DETECTION OF ARRHYTHMIA Rezuana Bai J1 1Assistant Professor, Dept. of Electronics& Communication

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395 -0056

Volume: 02 Issue: 09 | Dec-2015 www.irjet.net p-ISSN: 2395-0072

© 2015, IRJET ISO 9001:2008 Certified Journal Page 2532

morphological filtering is the best solution to remove

baseline wandering without losing the characteristic

shape of the QRS complex in the signal. In all the other

methods (S-Golay, Moving Average, FIR and Butterworth

filters), some of the baseline wandering is seen to remain

and also the distinctive shape of the QRS complex is lost

(that portion of the signal becomes more triangular in

shape). Hence morphological filtering is the best solution

put forward to remove the baseline wandering.

Another kind of signal examined is the ECG signal

corrupted with just noise and no baseline wandering. Here

it is observed that morphological filtering technique fails

to preserve the distinctive shape of the QRS complex

whereas all the other techniques reduces the noise to a

great extent without compromising the shape of the QRS

peak.

Fig.8 : Denoised output of different filters

Hence, for any kind of noise other than baseline

wandering, the other filters are preferred depending on

the case considered.

Fig.9:Denoised output with high frequency noise

Next we employed different types of wavelet thresholding

methods to remove noises from the ECG signal. Previous

researchers have used:"db4", "coif5" and "sym7" wavelet

function for genetic algorithm based denoising in ECG

signal. The soft thresholding method investigated with

four different thresholding rules (fixed, rigrsure, heursure

and minimax) to analyze the denoising performance of

ECG signals. Here we used “db4” and the fixed

thresholding rules to extract the denoised ecg signal. 16

level decomposition using DWT has been carried out to

effectively remove the low frequency noises (baseline

wanders). Figure 9 shows the wavelet decomposition on

the input ECG signals. On each level of wavelet

decomposition, the value of threshold has been calculated

by applying the threshold selection rules and the wavelet

coefficient above the value of threshold has been removed.

Fig.10 : Denoising using Wavelet Transform

Page 6: ECG DE-NOISING TECHNIQUES FOR DETECTION OF ARRHYTHMIA · ECG DE-NOISING TECHNIQUES FOR DETECTION OF ARRHYTHMIA Rezuana Bai J1 1Assistant Professor, Dept. of Electronics& Communication

International Research Journal of Engineering and Technology (IRJET) e-ISSN: 2395 -0056

Volume: 02 Issue: 09 | Dec-2015 www.irjet.net p-ISSN: 2395-0072

© 2015, IRJET ISO 9001:2008 Certified Journal Page 2533

7 DETECTION OF ARRHYTHMIA

7.1 Selection of characteristic scales

factorscalingtheisswhere

dts

txtf

sxxfxfW ss ,)(

1)()()(

According to the power spectra of the ECG signal, that

most energies of the QRS complex are at the scales of 23

and 24, and the energy at scale 23 is the largest. Here we

select scales from 21 to 24. The modulus maximum lines

corresponding to R waves are determined iteratively at

these different scales.

Step 1: Find all of the maxima larger than a threshold at

scale 24.

Step 2: Find a maximum larger than the threshold at scale

23 on the neighbourhood of the scale 24. If several maxima

exist, then the largest one is selected. But if the largest one

is not larger than 1.2 times the others, then the maximum

nearest to the maximum of the 24 scale is taken.

Step 3: Similarly, the locations of maxima at scales 22 and

21 are also found. Thus we obtain the location sets of the

maximum value points.

8 CONCLUSION

In this paper, various methods to remove the noise from

the ECG signal are implemented and compared. The

various methods tested are Morphological filter, S-Golay

filter, Moving Average filter, FIR1 filter and Butterworth

filter. Each technique was found to have its own merits

and de-merits and the choice of selection of any one

technique depend on the output required.

It was found upon implementation that morphological

filtering is the best solution to remove the baseline

wandering but it does not perform well in case of other

noises like power line interference, instrumentation noise

etc. Whereas the other filters tested removed such noises

considerably, but failed to preserve the signal shape in

case of baseline wandering.

So the best method to undertake would be to use a

combination of morphological filtering and filtering

technique such as S-Golay, Moving Average, FIR1 and

Butterworth filters to eliminate both baseline wandering

and other noises. The choice of the latter filter will depend

on the specifications of the output desired. Also it must be

taken care that the use of both the filters should be in a

compromise so as not to degrade the signal, but only

enhance it. Such a satisfactorily de-noised ECG signal can

be used for diagnostic purposes, including the detection of

arrhythmia, as proposed in this paper.

References

[1] “A Comparative Study On Removal Of Noise In ECG Signal Using Different Filters” – Vidya M J, Sruthi Sadasiv – International Journal for Innovative Research & Development – April 2013 Vol.2 Issue:4

[2] “An Integration of Improved Median and Morphological Filtering Techniques for Electrocardiogram Signal Processing” - Rishendra Verma, Rini Mehrotra and Vikrant Bhateja - 2013 3rd IEEE International Advance Computing Conference (IACC)

[3] “Wavelet diagnosis of ECG signals with kaiser based noise diminution” - Sridhathan Chandramouleeswaran Research Online 2012

[4] “Detection of ECG Characteristic Points Using Wavelet Transforms”- Cuiwei Li, Chongxun Zheng, and Changfeng Tai

[5] http://www.mathworks.com [6] http://www.bem.fi/book/19/19.htm

Mrs. Rezuana Bai J1 is a holder of Masters Degree in Control and Instrumentation from IIT Madras, India. She has 19 years of teaching experience in India and Oman. She is the winner of the best hardware project award from the Electrical department of IIT

Madras(2005). Her areas of research include control engineering, Fuzzy Logic, Medical instrumentation etc. Currently she is working as Assistant Professor, Dept. of Electronics and Communication Engineering, Govt.Rajiv Gandhi Institute of Technology, Kottayam.