American Journal of Engineering & Natural Sciences (AJENS) Volume, Issue 3, April 7 A Lower Transition Width FIR Filter & its Noise Removal Performance on an ECG Signal Israt Jahan Department of Information & Communication Technology Comilla University Comilla, Bangladesh israt.ict@gmail.com Orvila Sarker Department of Information & Communication Technology Comilla University Comilla, Bangladesh orvilasarker@cou.ac.bd Abstract A fixed based on an exponential function is proposed. This is derived from well-known and. Characteristic comparisons show that proposed exhibits lower transition width compared to those previously mentioned s. This proposed is used to filter an ECG signal contaminated with two most common types of noise namely baseline wandering noise and electromyography noise. Simulation results demonstrate that compared to and significant signal to noise ratio improvement and lesser mean square error has been obtained with our proposed while filtering baseline wandering noise. But in case of electromyography noise reduction proposed provides better signal to noise ratio but the mean square error was slightly greater than. Keywords Filter; Window; Transition width; Baseline wandering noise; Electromyography noise. I. INTRODUCTION Filter is a very important component in the signal processing field. In broader sense, a filter is a device that discriminates, according to some attribute of the object at its input, what passes through it []. Filters are broadly classified in two types: Analog and Digital filter. Analog filter works with continuous time signal. Digital filter is a system that performs mathematical operation on a sampled discrete time signal to reduce or enhance certain aspect of that signal. Digital Filters are preferred because they are highly programmable and can handle low frequency signal accurately []. Digital filters are further classified as Infinite Impulse Response (IIR) Digital Filter and Finite Impulse Response (FIR) Digital Filter. Filters with infinite length impulse responses are called Infinite Impulse Response (IIR) digital filter. On the other hand filters whose impulse responses are finite in duration are called Finite Impulse Response (FIR) digital filter. FIR Filter makes best choice when exact linear phase response is strictly required [3]. Ideal filters are physically unrealizable because of their infinite number of impulse response coefficients. In order to practically implement them the coefficients need to be truncated. Direct truncation results excessive ripples in the resultant filter s passband and stopband. Inspite of direct truncation, the coefficients are truncated using a time domain weighting function named. Among several Finite Impulse Response filter design techniques, method is the simplest. This paper introduces a fixed based on an exponential function. It is always required that a filter will possess higher minimum sidelobe attenuation and lower mainlobe width. But these two requirements are contradictory [4]. Considering the importance of lower mainlobe width, this paper focuses such a which shows lower mainlobe width compared to conventional,. In order to evaluate the performance of our proposed, an ECG signal corrupted with baseline wandering noise and electromyography noise [5, 6] are filtered using the proposed. Three most important parameters in signal processing for measuring the output signal quality are Signal to Noise Ratio (SNR), Mean Squared Error (MSE), and Percentage Root-Mean-Square Difference (PRD). We calculate these parameters and obtained satisfactory results compared to and. Ideal filters possess extremely flat passband and no attenuation at the stopband [7]. It falls sharply from unity to zero that s why its transition width is zero. Unfortunately, they are practically non-realizable. To obtain physically realizable filters, we need to truncate the impulse response at a certain point. But this direct truncation results in excessive ripples at the passband and stopband. Figure (a) illustrates the infinite duration impulse response of ideal filters. Figure (b) shows the extremely flat passband and stopband of ideal filters. Figure (c) shows the impulse response after direct truncation
7 and figure (d) shows the ripples at the passband and stopband results from the direct truncation. To get rid of this problem the method used is popularly known as Window Function. Window method is a mathematical function defined as.8.6.4.4..8.6.4.. ()) 4 6 8..4.6.8 a. Window in time domain b. Response 5-5..5.8 (db) -5 - Phase (degrees) - -5..5.6.4-5 -..4.6.8 - -5..4.6.8 ( rad/sample). c. Frequency Response d. Phase Response -.5 4 6 8..5..5..4.6.8 a. Ideal Impulse Response b. Ideal Response -.5 4 6 8.4..8.6.4...4.6.8 c. Truncated Impulse Response d. Direct Truncated Response Fig.. Characteristics of some conventional II. DERIVATION OF PROPOSED WINDOW Proposed is derived from a general format of and. and is defined by equations () and (3) as given below:.54-.46cos.5-.5cos We may write these equations in a common format as represented by the equation (4) below: () (3) Fig.. Characteristics of Ideal and practical filter α-βcos (4) Window method provides the most simple and easy way to design FIR digital filter. But it cannot remove the ringing effect of the direct truncation completely. It maintains a tradeoff relation between the stopband attenuation and the transition width. Some commonly existing s are,, etc. Among these s the provides best output in terms of minimum stopband attenuation but it suffers from a wider transition width. Figure (a) depicted the shape for these three s. Figure (b) shows the magnitude response. Figure (c) and figure (d) represents the frequency response and the phase response respectively. After choosing the value for α and β we take another arbitrary value k such as k.8-.95cos (5) Taking the inverse exponential of k and subtracting it from.75, results a symmetric function on both sides from the peak amplitude. (6) This creates a smoothly tapered curve defined in equation (6), is our proposed as shown in figure 3(a). It exhibits nearly flat magnitude response and low transition width which is shown in figure 3(b). Figure 3(c) and figure 3(d) represents the frequency and phase response of the filter designed with the proposed. From the phase response it is clear that the proposed satisfies the linear phase response characteristics in the passband.
Jahan et al; A Lower Transition Width FIR Filter & its Noise Removal Performance on an ECG Signal.4..8.6.4. 4 6 8.4..8.6.4...4.6.8 a. Proposed Window in time domain b. Response (db) - -4-6 -8 - - -4-6..4.6.8 Phase (degrees) -5 - -5 - -5..4.6.8 ( rad/sample) c. Frequency Response d. Phase Response Fig. 3. Characteristic properties of Proposed III. COMPARISON AMONG PROPOSED, HANNING AND HAMMING WINDOW (db) - -4-6 -8 - Proposed -..4.6.8 ( rad/sample) (db) - -4-6 -8 - Proposed -..4.6.8 ( rad/sample) a b Fig. 4. Frequency Response Comparison among Proposed, and The frequency response comparison among the Proposed, and are illustrated in figure 4. Figure 4(a) shows the comparison between Proposed and and figure 4(b) shows the frequency response comparison between Proposed and. From the table I, it is clear that proposed provides narrower half mainlobe width compared to and which is highly desirable but suffers from poor stopband attenuation. TABLE I. COMPARISON AMONG HANNING, HAMMING AND PROPOSED WINDOW Window Proposed Minimum stopband attenuation (db) -43.95-5.5-9.7 Half mainlobe width (normalized).3.4. IV. ECG SIGNAL AND ITS NOISES ECG is a graphic that displays time variant voltages produced by the myocardium during the cardiac cycle [8]. An ECG signal is shown in figure 5(a). It is an indispensible part of biomedical technology in regards to heart disease. Very often it is corrupted with various types of noise. One of the most common noises is Baseline Wandering (BW) Noise. Baseline wandering noise is caused by the variation in the position of the heart with respect to the electrodes and the changes in the propagation medium between the heart and the electrodes [9]. It results in sudden changes in the amplitude of the ECG signal and low frequency baseline shift. The cutoff for baseline wandering noise is.5hz. A highpass filter having cutoff.5hz is required to remove baseline wandering noise. Figure 5(b) shows the baseline wandering noise signal. Another cause of ECG signal corruption is electromyography (EMG) noise shown in figure 5(c). This is caused by the contraction of other muscles beside the heart. The frequency range of.3-5hz comprises the electromyography noise. Obviously it requires bandstop filter to reduce this type of noise..4..8.6.4. -. -.4 -.6 5 5 5 3 35 4.5 -.5 - -.5 5 5 5 3 35 4.5.5 -.5 - -.5 5 5 5 3 35 4 a. Noisy ECG signal b. BW Noise c. EMG Noise Fig. 5. Effect of noise on ECG signal and individual noise characteristics V. RESULTS AND DISCUSSIONS An ECG signal mixed up with two basic types of noise - baseline wandering and electromyography noise in the time and frequency domain has been generated in MATLAB environment. The corresponding filtering operations are performed successively using Proposed, and. As we derived our proposed from these two s, comparison has been depicted for these three s only. The parameters we take to evaluate the filtering operation are briefly outlined below. Signal to Noise Ratio (SNR): SNR (db) = Percentage Root-Mean-Square Difference (PRD): % PRD = Mean Square Error (MSE): MSE = (9) By definition we know that greater the value of Signal to Noise Ratio (SNR) better the signal output. On the other hand a lower value of Mean Square Error (MSE) and Percentage Root-Mean-Square Difference (%PRD) is always desirable. A. Baseline Wandering Noise Removal This type of noise shifts the base value of ECG signal from zero level to some other level. We have selected our proposed lowpass filter s cut off frequency to.5 Hz which is the prerequisite for baseline wandering noise cancelation. Figure 6 (7) (8)
9 show the ECG signal corrupted with Baseline Wandering noise in time domain and frequency domain respectively. Figure (a) and (b) show the filtered signal with the Proposed, and in time domain and frequency domain respectively. The filters effectively retain the base of ECG signal to zero axis. The corresponding data are tabulated in table II. From the data we observe that our proposed provides better MSE and worst SNR value compared to others..5.8.6 B. Electromyography Noise Removal Electromyography noise gets added to original ECG signal within the frequency range between.3 5 Hz. We have applied bandstop filter within a cutoff frequency of.3 5 Hz to suppress this kind of noise. Figure 7 shows the time and frequency domain input and output ECG signals for proposed, and. The calculated SNR, %PRD and MSE values are listed in table III. The proposed provides better MSE and %PRD value compared to..5.4 5.5 -.5 -. -. -.4.5.5 -.5 5-5 - -.5 5 5 5 3 35 4 -.6 5 5 5 3 35 4 - -.5-5 -.8.6.4. -. -.4 Noisy Signal -.6 5 5 5 3 35 4 Filtered Signal with 8 6 4..4.6.8 Noisy Signal Filtered Signal with Proposed.8.6.4. -. -.4 -.6 5 5 5 3 35 4 Filtered Signal with (a) 7 6 5 4 3..4.6.8 Filtered Signal with Proposed - 5 5 5 3 35 4 3 - - -5 5 5 5 3 35 4 Noisy Signal Filtered Signal with Proposed -3 5 5 5 3 35 4-3 5 5 5 3 35 4 Filtered Signal with Filtered Signal with (a) 4 8 6 4 3 - - 5 4 3 7 6 5 4 3..4.6.8 7 6 5 4 3..4.6.8 Filtered signal with Filtered Signal with (b) Fig. 6. Baseline wandering noise filtrations from ECG signal by various s in the time and frequency domain (a)time domain (b) Frequency domain TABLE II. FILTERING OPERATION ON BASELINE WANDERING NOISE CANCELLATION Window SNR(dB) %PRD MSE -3.7689.66e+3 95.7566 6 5 4 3..4.6.8..4.6.8 Noisy Signal Filtered Signal with Proposed..4.6.8 8 x 4 7 6 5 4 3..4.6.8 Filtered signal with Filtered Signal with (b) Fig. 7. Electromyography noise filtrations from ECG signal by various in the time and frequency domain (a) Time domain (b) Frequency domain -3.758.667e+3 95.698 Proposed -3.593.654e+3 94.3976
Jahan et al; A Lower Transition Width FIR Filter & its Noise Removal Performance on an ECG Signal TABLE III. FILTERING OPERATION ON ELECTROMYOGRAPHY NOISE CANCELLATION Window SNR(dB) %PRD MSE. 68.938.83 -.97e-4 85.68.43 Proposed. 76.68.345 [7] C. Britton Rorabaugh, Digital Filter Designers Handbook, Division of Mc Graw-Hill, Inc.. [8] Arthur C. Guyton and John E. Hall, Textbook of Medical Physiology, th ed., Elsevier Inc., 6. [9] Yurong Luo, Rosalyn H. Hargraves, Ashwin Belle, Ou Bai, Xuguang Qi, Kevin R. Ward, Michael Paul Pfaffenberger, and Kayvan Najarian, A Hierarchical Method for Removal of Baseline Drift from Biomedical Signals: Application in ECG Analysis, The Scientific World Journal, vol. 3, 3. VI. CONCLUSIONS We have addressed an exponential function to design digital filter based on method and perform filtering operation on an ECG signal. The proposed in this paper satisfies the properties of method for example phase linearity, tradeoff relation between transition width and stopband attenuation. And also we make comparison among other existing s. It provides better performance in terms of transition band than these s. Narrower mainlobe width is an essential pre-requisite while signals of closely spaced frequency are being to be separated. It is especially useful in bio-medical signal processing such as E.C.G., E.K.G., E.E.G. We have considered here two special types of noise that often contaminated with ECG signal baseline wandering noise and electromyography noise and examine the filtering operation by calculating some common parameters - SNR, %PRD and MSE. Our proposed filter results improved SNR, %PRD and MSE in case of baseline wandering noise filtering and a moderate SNR, %PRD and MSE value while filtering electromyography noise. REFERENCES [] J. Proakis and D. G. Manolakis, Digital Signal Processing, 4 th ed., Prentice-Hall, 7. [] Steven W. Smith, The Scientist and Engineer s Guide to Digital Signal Processing, nd ed., California Technical Publication, 999. [3] Jose C. Principe, and Jack R. Smith, Design and Implemention of Linear Phase FIR Filters for Biological Signal Processig, IEEE Transaction on Biomedical Signal Processig, vol. BME-33, pp. 55-559, June 986. [4] A. V. Oppenheim, R. W. Schafer, and J. Buck, Discrete-Time Signal Processing, 3 rd ed., Prentice-Hall, Inc., 9. [5] Nitish V. Thakor and Yi-Sheng Zhu, Applications of Adaptive Filtering to ECG Analysis: Noise Cancellation and Arrhythmia Detection, IEEE Transl.on Biomedical Engineering, vol. 38, pp. 785 794, August 99. [6] R. Gut and G. S. Moschytz, High-precision EMG signal decomposition using communication techniques, IEEE Transl.on Signal Processing, vol. 48, pp. 487 494, September.