International INTERNATIONAL Journal of Electronics and JOURNAL Communication OF Engineering ELECTRONICS & Technology (IJECET), AND ISSN 976 6464(Print), ISSN 976 6472(Online) Volume 4, Issue 4, July-August (23), IAEME COMMUNICATION ENGINEERING & TECHNOLOGY (IJECET) ISSN 976 6464(Print) ISSN 976 6472(Online) Volume 4, Issue 4, July-August, 23, pp. 3-25 IAEME: www.iaeme.com/ijecet.asp Journal Impact Factor (23): 5.8896 (Calculated by GISI) www.jifactor.com IJECET I A E M E NOISE REDUCTION IN ECG BY IIR FILTERS: A COMPARATIVE STUDY Imteyaz Ahmad, F Ansari 2, U.K. Dey 3 Dept of ECE, 2 Dept of Electrical Engg., 3 Dept of Mining Engg. BIT Sindri, Dhanbad-82823, Jharkhand, India ABSTRACT Background: In monitoring mode only two leads are used so that ECG waveform has large R wave amplitude so lead II is chosen. The monitoring mode bandwidth is.5-5 Hz as only rhythmic information is required. The present paper deals with the digital filtering method to reduce noise artifacts in the ECG signal. 4 th order Butterworth, Chebyshev, Chebyshev 2 and elliptic filters are used to reduce noise interference from ECG signals. Method: ECG signal is taken from physionet database. A ECG signal (without noise) is added with 5 Hz interference, base line wander noise of.5 Hz and high frequency noise of 5 Hz and processed by low pass filter of cutoff frequency of 5 Hz, High pass filter of cutoff frequency of.5 Hz and notch filter of 3 db stop band bandwidth.2(49.9 5.) Hz. The order of filter is taken as 4. In this paper 4th order Butterworth, Chebyshev, Chebyshev 2 and elliptic filters are applied on the noisy ECG signal. Simulation results are also shown. Comparison of these filters are done. All the designs are implemented using MATLAB FDA tool. Result: Performance of filters are analyzed by comparing signal power before and after filtration and distortion to ECG waveform. It is found that digital filters works satisfactory. Conclusion: 4 th order Butterworth filter gives best performance as compared to others as it introduces minimum distortion to ECG waveform. Key Words: Electrocardiogram, Butterworth, Chebyshev, elliptic and notch Filter. 3
976 6464(Print), ISSN 976 6472(Online) Volume 4, Issue 4, July-August (23), IAEME INTRODUCTION The electrocardiogram is the graphic recording or display of time variant voltage produced by the myocardium during Cardiac cycle. The electrocardiogram is used clinically is diagnosing various diseases and conditions associated with the heart. It also serves as a timing reference for other measurements. Figure : ECG waveform Engineers working in the medical profession are encouraged to learn as much as possible about medical and hospital practices and in particular about physiology of human body. It is only by gaining such an understanding that they can communicate intelligently with medical professionals. This interaction between the two fields has led to the development of sophisticated medical equipment and systems. In monitoring mode only two leads are used so that ECG waveform has large R wave amplitude so lead II is chosen. The monitoring mode bandwidth is.5-5 Hz as only rhythmic information is required. The tracing of voltage difference at any two sites due to the electrical activity of the heart is called a lead. Although two electrodes can be attached to any part of the body to lead the heart current to the galvanometer, it is customary to make use of the forearms, the left leg and the pericardium. Each chamber of the heart produces a characteristics electrocardiographic pattern. Since the electrical potentials over the various areas of the heart differ, the recorded tracing from each limb vary accordingly []. 4
976 6464(Print), ISSN 976 6472(Online) Volume 4, Issue 4, July-August (23), IAEME Figure 2: The Einthoven triangle for defining ECG lead ECG measurements may be corrupted by many sorts of noise. The ones of primary interest are: Power line interference Electrode contact noise Motion artifacts EMG noise Instrumentation noise These artifacts strongly affects the ST segment, degrades the signal quality, frequency resolution, produces large amplitude signals in ECG that can resemble PQRST waveforms and masks tiny features that are important for clinical monitoring and diagnosis. Cancelation of these artifacts in ECG signals is an important task for better diagnosis. While designing the ECG amplifiers bandwidth requirements should be considered [2]. Van Alste JA, van Eck W, Herrmann OE has proposed the linear filtering method for base line wonder reduction [4]. The time varying filtering is also proposed by Sornmo L. for the reduction of the baseline wonder [5]. For the baseline wander filter presented is a linear phase high-pass filter having a cutoff frequency lower than the heart rate [6]. Alarcon G, Guy CN, Binnie CD has applied the recursive butterworth filter for reducing the noise contaminations [7]. Choy TT, Leung PM, has developed notch filter ECG signal since its analog version is difficult to design [8]. Gaydecki P. has described a simple but highly integrated digital signal processing system for real time filtering of biomedical signals. Filters are realized using a finite impulse response; no phase distortion is introduced into the processed signals [9].McManus CD, Neubert K D, Cramer E, has compared filtering methods for elimination of AC noise in electrocardiograms[]. Cramer E te.al has given global filtering approach in which two different filters are designed and are compared for power line estimation and removal in the ECG []. Electromyogram (EMG) artifacts often contaminate the electrocardiogram (ECG). They are more difficult to suppress or eliminate, compared for example to the power line interference, due to their random character and to the considerable overlapping of the frequency spectra of ECG. For filtering of electromyogram signal from the ECG signal Christov II, Daskalov IK has given the solution by designing Low pass digital filter of 35 Hz cutoff frequency[2]. Mahesh S. Chavan, R.A. Agarwala, M.D. Uplane has given a comparative study of Butterworth, chebyshev, chebyshev 2 and elliptic filter and analyzed the performance by comparing signal power before and after filtration[3]. In this paper filter performance based on time and frequency domain analysis was done. 5
976 6464(Print), ISSN 976 6472(Online) Volume 4, Issue 4, July-August (23), IAEME Input ECG: Input ECG ECG signal is taken from physionet ECG database with sampling frequency of 5 Hz as shown below in Figure 3. A ECG signal (without noise) is added with 5 Hz interference, base line wander noise of.5 Hz and high frequency noise of 5 Hz is shown in Figure 4..4 Pure ECG.2.8 Amplitude(mV).6.4.2 -.2 -.4 2 3 4 5 6 7 8 9 Time(s) Figure 3: Input ECG signal with sampling frequency of 5 Hz.6 Noisy ECG.4.2 Amplitude(mV).8.6.4.2 -.2 -.4 2 3 4 5 6 7 8 9 Time(s) Figure 4: Noisy ECG signal (contain 5 Hz interference, base line wander noise of.5 Hz and high frequency noise of 5 Hz) Design of low pass filter In the present paper all design is performed using Matlab FDA tool. Figure 5 shows basic Matlab model used in the filtration of the noise in ECG. Time scopes are configured to store up to 5 ECG samples. The 4 th order Butterworth low pass filter has cutoff frequency of 5 Hz for monitoring mode. The magnitude response is flat and all poles are inside the unit circle so design filter is stable. The phase response is nonlinear and impulse response decay with time as shown in Figure 6. 6
976 6464(Print), ISSN 976 6472(Online) Volume 4, Issue 4, July-August (23), IAEME Figure 5: basic Matlab model used in the filtration of the power line noise in ECG Magnitude Response (db) Phase Response -2 - Magnitude (db) -4-6 -8 Phase (radians) -2-3 -4 - -2-5 -6 5 5 2 Frequency (Hz) 5 5 2 Frequency (Hz) Pole/Zero Plot Impulse Response I m a g in a r y P a r t.8.6.4.2 -.2 -.4 -.6 -.8-4 -.5 - -.5.5.5 Real Part A m p litu d e.2.5..5 -.5 2 3 4 5 6 7 8 Time (mseconds) Figure 6: magnitude response, phase response, pole-zero diagram, impulse response, step response of the Butterworth low pass filter with cutoff frequency of 5 Hz 7
976 6464(Print), ISSN 976 6472(Online) Volume 4, Issue 4, July-August (23), IAEME Figure 7: time and frequency domain response of before and after filtration of low pass Butterworth filter with cutoff frequency of 5 Hz 8
976 6464(Print), ISSN 976 6472(Online) Volume 4, Issue 4, July-August (23), IAEME Design of High pass filter The 4 th order Butterworth high pass filter has cutoff frequency of.5 Hz for monitoring mode. The phase response is linear. Impulse response is at t= and is for rest of time. Poles lies on unit circle of the z plane. Designed filter is stable. Magnitude Response (db) Phase Response 6-5 M a g n itu d e ( d B ) -2-3 -4-5 -6 Phase ( radians ) 4 3 2 5 5 2 Frequency (Hz) 5 5 2 Frequency (Hz) Pole/Zero Plot Impulse Response.8.9.6.8.4.7 Imaginary Part.2 -.2 4 Amplitude.6.5.4 -.4.3 -.6.2 -.8. - -.5 - -.5.5.5 Real Part 2 3 4 5 6 7 8 Time (seconds) Figure 8: the magnitude response, phase response, pole-zero diagram, impulse response of the Butterworth high pass filter with cutoff frequency of.5 Hz 9
976 6464(Print), ISSN 976 6472(Online) Volume 4, Issue 4, July-August (23), IAEME Figure 9: time and frequency domain response of before and after filtration of high pass Butterworth filter with cutoff frequency of.5 Hz Design of Notch filter 3- db stop band bandwidth and the order of the filter were defined to design the Butterworth notch filter. In the present case, order of the filter is 4 and the 3- db stop band bandwidth of.2(49.9 5.)Hz were considered. Figure shows the magnitude, phase response pole-zero diagram, impulse response, step response of the Butterworth notch filter with the 3- db stop band bandwidth of.2(49.9 5.). The magnitude response shows sharp cutoff at 5 Hz. The phase response is nonlinear. All zeros lies on the unit circle. The zeros are located at ±.6 radians. 2
976 6464(Print), ISSN 976 6472(Online) Volume 4, Issue 4, July-August (23), IAEME Magnitude Response (db) 3 Phase Response -5 2 M a g n it u d e ( d B ) - -5-2 -25 P h a s e ( r a d ia n s ) - -3-35 -4 5 5 2 Frequency (Hz) -2-3 5 5 2 Frequency (Hz) Pole/Zero Plot Impulse Response.8.6.4 2.9.8.7 Im a g in a r y P a r t.2 -.2 -.4 2 -.6 -.8 - -.5 - -.5.5.5 Real Part A m p litu d e.6.5.4.3.2. 5 5 2 Time (seconds) Figure : the magnitude response, phase response, pole-zero diagram, impulse response of the Butterworth notch filter with the 3- db stop band bandwidth of.2(49.9 5.) 2
976 6464(Print), ISSN 976 6472(Online) Volume 4, Issue 4, July-August (23), IAEME Figure : time and frequency domain response of before and after filtration of Butterworth notch filter with 3- db stop band bandwidth of.2(49.9 5.) Hz Simulation result Butterworth Low pass filter The time domain response shows that high frequency noise is considerably reduced and amplitude of R wave is also reduced slightly. The frequency domain response shows that high frequency noise is considerably reduced and ECG signal power before filtration of - 8.34 db drops to -68.5 db after filtration at 5 Hz as shown in Figure 7. 22
976 6464(Print), ISSN 976 6472(Online) Volume 4, Issue 4, July-August (23), IAEME Butterworth High pass filter The time domain response shows that low frequency noise i.e. baseline wander noise is reduced to minimum. The frequency domain response shows that low frequency noise is considerably reduced as shown in Figure 9. Butterworth Notch filter The time domain response shows that ECG noise at 5 Hz is effectively reduced. From frequency domain response,the ECG signal spectrum before and after Butterworth notch filtering with the 3- db stop band bandwidth of.2(49.9 5.)Hz shows power reduction from -8.45 db to -37.5 db as shown in Figure. Figure 2: shows noisy ECG, pure ECG, output of 4 th order Butterworth filter Figure 3: shows noisy ECG, pure ECG, output of 4 th order Chebyshev filter 23
976 6464(Print), ISSN 976 6472(Online) Volume 4, Issue 4, July-August (23), IAEME Figure 4: shows noisy ECG, pure ECG, output of 4 th order Chebyshev 2 filter CONCLUSION Figure 5: shows noisy ECG, pure ECG, output of 4 th order elliptic filter 4 th order Butterworth, Chebyshev, Chebyshev 2 and elliptic filters were designed for sampling frequency of 5Hz. It is observed from time domain analysis of Figure 2, Figure 3, Figure 4, Figure 5 that PQRST distortion in ECG waveform is lowest in Butterworth filter as compared to other filters. In case of Butterworth low pass filter the frequency domain response shows that high frequency noise is considerably reduced and ECG signal power before filtration of -8.34 db drops to -68.5 db after filtration at 5 Hz as shown in Figure 7.After low pass filtering this signal is applied to Butterworth high pass filter to reduce baseline wander. From time and frequency domain response it is observed that baseline wander is completely removed as shown in Figure 9.After this ECG signal is applied to Butterworth notch filter for reducing 5 Hz noise. From time and frequency domain response it is observed that 5 Hz noise is completely removed as shown in Figure. It is observed that the signal power at 5 Hz before filtration is -8.45dB and after filtration power is reduced from-8.45 db to 37.5 db. Simulation result shows that while filtering the noise in ECG the PQRST segment of the ECG signal is modified. 24
976 6464(Print), ISSN 976 6472(Online) Volume 4, Issue 4, July-August (23), IAEME REFERENCES [] Khandpur, R.S., Biomedical Recorders, Handbook of Biomedical Instrumentation, chapter 5, TMH, 27 [2] Carr, J.J. and J.M. Brown, Introduction to Biomedical Equipment Technology. Prentice Hall, Inc., 3 rd ed., 998. [3] John G. Webster, Encyclopedia of Medical Devices and Instrumentation.Vol. 2. [4] Van Alste JA, van Eck W, Herrmann OE, ECG baseline wander reduction using linear phase filters, Comput. Biomed Res. 986 Oct;9(5):47-27. [5] Sornmo L, Time-varying digital filtering of ECG baseline wander, MedBiol. Eng Comput. 993 Sep; 3(5):53-8. [6] De Pinto V, Filters for the reduction of baseline wander and muscle artifact in the ECG, J Electrocardiol. 992; 25 Suppl: 4-8. [7] Alarcon G, Guy CN, Binnie CD, A simple algorithm for a digital three pole Butterworth filter of arbitrary cut-off frequency: application to digital electroencephalography, J Neurosci Methods. 2 Dec 5;4():35-44. [8] Choy TT, Leung PM, Real time microprocessor-based 5 Hz notch filterfor ECG, J Biomed Eng. 988 May;(3):285-8. [9] Gaydecki P, A real time programmable digital filter for biomedical signal enhancement incorporating a high-level design interface, Physiol. Meas. 2 Feb; 2():87-96. [] McManus CD, Neubert KD, Cramer E, Characterization and elimination of AC noise in electrocardiograms: a comparison of digital filtering methods, Comput Biomed Res. 993 Feb;26():48-67. [] Cramer E, McManus CD, Neubert D, Estimation and removal of powerline interference in the electrocardiogram: a comparison of digital approaches, Comput Biomed Res. 987 Feb;2():2-28. [2] Christov II, Daskalov IK, Filtering of electromyogram artifacts from the electrocardiogram, Med. Eng. Phys. 999Dec; 2():73-6. [3] Mahesh S. Chavan, R.A. Agarwala, M.D. Uplane, Comparative Study of Chebyshev I and Chebyshev II Filter used For Noise Reduction in ECG Signal, International Journal of Circuits, Systems and Signal Processing Issue, Volume 2, 28 [4] www.physionet.org/physiobank/database/#ecg [5] Mohammed Salman Ullah Khan and Prof. F.I. Shaikh, Suppression of Power Line Interference Correction of Baseline Wanders and Denoising ECG Signal Based on Constrained Stablity Least Mean Sqaure Algorithm, International Journal of Electronics and Communication Engineering & Technology (IJECET), Volume 4, Issue 3, 23, pp. 85-92, ISSN Print: 976-6464, ISSN Online: 976 6472. [6] Samir Elouaham, Rachid Latif, Boujemaa Nassiri, Azzedine Dliou, Mostafa Laaboubi and Fadel Maoulainine, Analysis Electrocardiogram Signal using Ensemble Empirical Mode Decomposition and Time-Frequency Techniques, International Journal of Computer Engineering & Technology (IJCET), Volume 4, Issue 2, 23, pp. 275-289, ISSN Print: 976 6367, ISSN Online: 976 6375. 25