Procedia Technology 25 ( 2016 ) 497 – 504
ScienceDirect
2212-0173 © 2016 The Authors. Published by Elsevier Ltd. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/).
Peer-review under responsibility of the organizing committee of RAEREST 2016 doi: 10.1016/j.protcy.2016.08.137
Global Colloquium in Recent Advancement and Effectual Researches in Engineering, Science and
Technology (RAEREST 2016)
High Frequency Electromyogram Noise Removal from
Electrocardiogram Using FIR Low Pass Filter Based On FPGA
Mr.P.C.Bhaskar
a*, Dr.M.D.Uplane
b aDepartment of Technology, Shivaji University, Kolhapur, 416004, India.bDepartment of Instrumentation Science, Savitribai Phule, Pune University, Pune, 411 007, India.
Abstract
With improvements in capacity and performance and a decrease in cost, FPGAs have become a viable solution for making custom chips and programmable DSP devices. This paper presents an efficient implementation of Finite Impulse Response Filter (FIR) using Distributed Arithmetic (DA) architecture based on FPGA with the help of Xilinx system generator software. Here, the multipliers in FIR filter are replaced with multiplier less DA based technique to remove high frequency Electrocardiogram (EMG) noise from ECG signal. As digital filters plays very significant role in the analysis of the low frequency components in Electrocardiogram (ECG) signal. The ECG is susceptible to noise and it is essential to remove the noise to support decision making for specialist and automatic heart disorder diagnosis systems. We proposed that the signals under experiment has been added with muscle noise and after applying different FIR method, the signals according to signal noise ratio (SNR) and MSE(mean square error) are evaluated. It introduces an effective technique for the denoising of ECG signals corrupted by High frequency muscles contraction noise. The performances of the system were evaluated using the Massachusetts Institute of Technology University and Beth Israel Hospital (MIT-BIH) database. Muscle noise is taken from MIT-BIH noise stress database .Simulation results shows that High frequency EMG noise from ECG was removed effectively by using FIR low pass filter. The implementation is done on a Xilinx chip of Spartan 3E XC3S500e-4fg320 using Xilinx system generator 10.1 with Matlab version7.4.0 (2007a).
© 2015 The Authors. Published by Elsevier Ltd.
Peer-review under responsibility of the organizing committee of RAEREST 2016.
Keywords: ECG, EMG, MATLAB, MIT-BIH database, FPGA, DA- FIR.
* Corresponding author- P.C.Bhaskar, Tel.: +91-231-2020020; fax: +91-231-2692333.
E-mail address: [email protected]
© 2016 The Authors. Published by Elsevier Ltd. This is an open access article under the CC BY-NC-ND license (http://creativecommons.org/licenses/by-nc-nd/4.0/).
1. Introduction
The heart is comprised of muscle that is rhythmically driven to contract and relax to drive the circulation of blood throughout the body; this electrical activity of the heart can be measured by Electrocardiogram (ECG). It is one of the most important physiological parameter, which is being used at considerable extent for knowing the state of cardiac patients. The major concern of biomedical signal processing is the extraction of pure cardio-logical signals from noisy measurements. The content and accuracy of information extracted from a recording require proper characterization of waveform morphologies, which require the preservation of the phase and amplitude important clinical features and high attenuation of noise [1]. ECG signals are usually corrupted with undesired interference such as electrode artefacts, muscle noise, line noise, and respiration, power line, base line [2, 3, 4]. The frequency range of ECG signal lies between 0.05-100 Hz and voltage levels of 0.5-4mV. EMG noise is one of the major noise having frequency range varies from 1-10000Hz and voltage levels of 0.1-10mV, depending upon the muscle movement rate and pressure on it. Thus EMG signal causes distortion of ECG signal and induces random noise in it. The spectrum of EMG signals overlap the spectrum of ECG signals and hence it is hard to distinguish the peaks of ECG signal and peaks of noisy signal induced by patient’s movement. The presence of undesired interferences cause serious problem in the ECG diagnosis [5].
Fig.1. Pure ECG signal [1]
Many methods were proposed in the past for the removal of Electromyogram interference in the ECG. P Raphisak, SC Schuckers, A de Jongh Curry et al. [6] suggested an automated algorithm for detecting EMG noise in large ECG data. The algorithm extracts EMG artifact from the ECG by using a morphological filter. Rakesh Chand, Pawan Tripathi, Abhishek Mathur et al. [7] shows implementation of fast FIR low pass filter for EMG removal from ECG signal. They designed the architecture having less critical delay than convention FIR design and fast enough to remove EMG from ECG signal. They used branched tree architecture for adder connection to reduce the critical delay. Castillala Mancha et al. [8] use neural network to remove Muscular and Artefacts Noise from the Electrocardiogram (ECG). As the result, we are careful while removing the EMG noise so that we do not eliminate vital components of the ECG signal [9]. Finite impulse response (FIR) digital filters are commonly used components in many digital signal processing (DSP) systems. Throughout the years, with the increasing development in very large scale integration (VLSI) technology, the real time realization of FIR filter with less hardware essential and less latency has become more and more important. As the complications of implementation extends with the length of filter, various algorithms have been mapped into effective architectures using ASIC’s and FPGA’s; one of them being distributed arithmetic (DA).The main portion of DA-based computation is lookup table (LUT) which stores the pre computed values and can be read out easily, which makes DA-based computation well suited for FPGA realization, because the LUT is the basic component of FPGA.[10] Fig. 1 shows an example of normal ECG trace, which consists of P wave, QRS complex and T wave. The small U wave may also be sometimes visible. P wave generates the sequential depolarization of right and left atria. Depolarization of right and left ventricular produces QRS complex and T wave will be form by repolarization of ventricular.PR interval represents the duration of the conduction through the atria to the ventricles. The PR segment represents the duration of conduction from AV node
down the bundle of its end through the bundle branches to the muscle .The ST segment due the time between ventricular depolarization and the repolarization [11]. In this paper, we have implemented using FPGA a FIR filter method-based on Distributed Arithmetic to remove the EMG noise from the ECG signal using Xilinx System Generator. It is high-level software tool that enables the use of Matlab/Simulink environment to create and verify hardware designs for Xilinx FPGAs.
2. Material and methods 2.1 MIT-BIH
The dataset used in this study is obtained from Physiobank entitled MIT-BIH Arrhythmia Database available on-line. The recordings were digitized at 360 samples per second per channel with 11-bit resolution over a 10 mv range. MIT-BIH Arrhythmia Database where annotated ECG signals are described by a text header file (.hea), a binary file (.dat) and a binary annotated file (.atr). Header file consists of detailed information such as number of samples, sampling frequency, format of ECG signal, type and number of ECG leads, patient’s history and the detailed clinical information. In binary data signal file, the signal is stored in 212 format which means each sample requires number of lead times 12 bits to be stored and the binary annotation file consists of beat annotation about half (25 of 48 complete records, and reference annotation files for all 48 records) of this database has been freely available . For EMG dataset is obtained from MIT-BIH Noise stress database from Physiobank. This database includes 12 half-hour ECG recordings and 3 half-hour recordings of noise typical in ambulatory ECG recordings. The noise recordings were made using physically active volunteers and standard ECG recorders, leads, and electrodes; the electrodes were placed on the limbs in positions in which the subjects' ECGs were not visible. 2.2 MATLAB
MATLAB is a powerful, comprehensive, and easy to use environment for technical computations. One of its greatest strengths is that MATLAB allows building its own reusable tools. Matlab is being used for ECG database extraction which is stored at www.physiobank.org. Stored ECG signal can be called in Simulink model from workspace of Matlab. Real time EMG noise is accessed from MIT-BIH noise stress database in the form of .mat file then it is imported into workspace which is added with pure ECG in Simulink model. For designing of FIR low pass filter FDATool from Matlab has been used. Different types of FIR digital filter designed to remove high frequency EMG noise.
2.3 FIR Filter
FIR filters are widely used due to the powerful design algorithms that exist for them, their inherent stability. When implement in non-recursive form, the ease with which one can attain linear phase. Equiripple filter, least square method, windowing method for designing of FIR low pass filter is there. A windowing method is used, where Kaiser, Rectangular, Hamming, Hanning and Blackman functions are designed.
The basic specifications for design of filter are: x Cut-off frequency 100 Hz
x Sampling frequency 360Hz (MIT/BIH database sampled at 360 Hz )
In the FIR window filters, cut-off frequency at the 3 dB point is approximately 91.8333 Hz. The window length in case of Rectangular, Hanning and Hamming is 18 and 16(window length is order plus one). In case of Bartlett and Blackman order of the filter is 37 and 19 respectively. Kaiser window have filter length 14 with phase delay 0.1047 rad/Hz and cut off frequency at 3db is 89.60449Hz.
2.4 Distributed Arithmetic (DA) FIR filter
Distributed arithmetic is a very efficient method for implementing digital FIR filters in FPGA structures. DA technique is extensively used in computing sum of product with constant coefficients. In such a case partial product term becomes a multiplication with constant (i.e. scaling). DA approach significantly increases the performance of implemented filter, by removing general purpose multipliers and introducing Look up Table (LUT), shift registers and scaling accumulator. These blocks have to be efficiently mapped onto FPGA’s logic cells. The proposed
architecture provides an efficient area-time-power implementation which involves significantly less latency and less area-delay complexity when compared with existing structures for FIR Filter.
XN-1 [0] . . X1[0] X0[0]
XN-1 [1] . . . X1[1] X0[1]
XN-1[M-1] .. X1[M-1] X0[M-1]
Fig.2. Simple implementation of Distributed Arithmetic (DA) [10]
3. Equations
Distributed Arithmetic (DA) FIR filter Equations
DA is a bit-serial computational operation that forms an inner product of a pair of vectors in a single direct step. We consider the following sum of products:
ൌ σିଵ୩୩ǡሺͳሻ
The Ak are fixed coefficients, and the Xkare the input data words. If each Xkis a 2's-complement binary number
scaled (for convenience, not as necessity) such that mod (Xk)< 1, then express each Xkas
୩ൌ െ୩ σିଵ୬ୀଵ୩୬ʹି୬ǡሺʹሻ
Where the bkn are the bits, 0 or 1, bk0 is the sign bit, and bk,N-1 is the least significant bit (LSB).Combining Equations
1 and 2 in order to express Y in terms of the bits of :
ൌ ሺ୩െ ୩ σିଵ୬ୀଵ୩୬ʹି୬ሻ
୩ୀଵ ሺ͵ሻ
Equation 3 is the conventional form of expressing the inner product. Direct mechanization of this equation defines a "lumped" arithmetic computation. Interchanging the order of the summations, we get
ൌ ൫σ୩ୀଵ୩୩୬൯ʹି୬
ିଵ
୬ୀଵ σ ୩
୩ୀଵ ሺെ୩ሻሺͶሻ
Equation 4 defines a distributed arithmetic computation. Consider the bracketed term of Equation 4, which is referred here as equation (5).As each bkn may take on values of 0 and 1 only, expression (4) may have only 2k
possible values .Rather than computing these values on line, it may be pre-computed and stored in a ROM. The
. . . .. . . . . .
Bit shift register
+/- R Y 2-1 ACC A/S L U T
input data can be used to directly address the memory and the result, i.e., it can be dropped into an accumulator. After N such cycle, the memory contains the result, Y as shown in Figure 2.
σୀଵ୩ܾ୩୬ሺͷሻ Result Equations ൌ ͳͲଵ σ୧ୀሺ୰ୟ୵ሻଶ σ୧ୀሺ୰ୟ୵െ ϐ୧୪୲ୣ୰ୣୢሻଶ ሺሻ ൌ ͳͲଵ σ୧ୀሺ୰ୟ୵െ ϐ୧୪୲ୣ୰ୣୢሻଶ ሺሻ 4. Experimental setup 4.1 Design Flow:
Fig.3. Design flow of implementation of FIR low pass filter
Design flow is as shown in fig.3, selecting pure ECG from www.physiobank.org using MIT –BIH Arrhythmia database and muscle noise is accessed from MIT-BIH noise stress database. Simulation is done in Simulink available with Matlab version 7.4.0.(2007a) . Fig. 4 shows the Simulink model of project. In that ECG signal corrupted with high frequency EMG noise is accessed from workspace .By applying different FIR method result has been calculated w.r.t. SNR and MSE.
Fig.4. Simulink model to remove EMG noise from ECG signal Matlab Environment
Simulink Model
Code Generation (system generator) for Hardware co-simulation
Xilinx Implementation Flow
BIT Stream
Download to FPGA (Spartan 3E-–XC3S500e-4fg320)
ECG noise3 FDATool
ECG Signal from
Workspace Digital low pass
Filter Design1 Filter Scope1 ECG noise
Denoised ECG
4.2 FPGA implementation:
For hardware co-simulation on Spartan 3E XC3S500e-4fg320 Xilinx system generator software version 10.1 is used. This software install the Xilinx block set required for hardware implementation in Matlab Simulink Library Browser. Fig.5 shows the Simulink model with Xilinx blockset.IN and OUT block decide the boundary of hardware after applying different FIR method resource utilization has been calculated with the help of system generator token net list, bit stream, time analysis.
Fig.5. Hardware co-simulation Simulink model
5. Result and discussion 5.1 MATLAB simulation result:
Clean ECG is taken from MIT-BIH which is added with high frequency muscle noise .Simulation was done on SIMULINK available with MATLAB. Fig. 6 (a) shows pure ECG from MIT-BIH Arrhythmia database of patient record number 100, shows noisy ECG with SNR of -5.5039db which is added with real time muscle noise accessed from MIT-BIH noise stress database. Fig.6 (b) shows the application of window methods (kaiser) of FIR filter on High frequency EMG noise. Equation (6) is used to calculate SNR of filtered signal and mean square error (MSE) from equation (7) is calculated.
Fig.6. Typical filtering results with an input signal of -5.5039db (a) noisy ECG ,(b) Kaiser window with order=13
Table 1.Performances and evaluation of FIR low pass filter on MIT-BIH database. The value shows SNR in DB
In Table 1 comparison of different low pass FIR window methods for SNR and MSE is given. Here it can be concluded that low pass FIR window methods effectively remove the EMG noise without distortion of the ECG signal. In case of Hamming, Hanning, Bartlett order of the filter was increased which increases the complexity of filter designing. Kaiser window method has an adjustable parameter ȕ which controls the trade of between main lobe and side lobes. So that SNR of FIR filter with Kaiser is (0.6438) more, than other type of filter. In case of other window methods the order of the filter easily grow very much .It increases the number of filter coefficient which leads to the large memory requirement and problems in hardware implementation.
5.2 Hardware implementation Result:
Fig. 7 (a) Experimental setup of hardware co simulation (b) Result of filtration on wave scope of system generator
After implementation on Spartan FPGA kit, the experimental setup of hardware co simulation as shown in fig 7(a). The utilization of resources i.e. no of LUTs, Slices, Bonded I/O has been calculated for different window types of FIR filter. Table 3 shows that, Kaiser Window method have minimum utilization of resources. As it require 87 slices, 156 slices flip flop, 111 LUTs, 17 bonded IOB, with 1 GCLK. Also the wave scope of system generator shows the result of filtration as shown in fig.7 (b).
Table 2. Comparison of Spartan 3E FPGA and DSP [13, 14]
To implement FIR filter on DSP it requires 50ns/tap [13] and for RISC type of Architecture DSP requires 40ns/tap [14].as shown in table (2).
Table 3.Utilation of resource of Spartan XC3S500e-4fg320 for different FIR method Window Filtering Method order of filter SNR = -5.5039 MSE
Kaiser 13 0.6438 0.0501 Rectangular 17 0.5347 0.0591 Hanning 15 0.5448 0.0596 Hamming 15 0.5643 0.0597 Blackman 19 0.5093 0.0652 Bartlett 37 0.5575 0.05888
SR.NO Device Time
1. Spartan 3E XS3S500e-4fg320 6.011 ns 2. 16 bit DSP 50 ns/tap 3. 32 bit RISC/DSP 40 ns/tap
6. Conclusion & Future Scope
In this Paper, an implementation of Distributed Arithmetic (DA) low pass FIR filter on FPGA has been introduced. It has been investigated that, the improvement of noisy ECG, disturbed due to high frequency noise signals, can be achieved by combination of low pass FIR filters. In order to measure the performance of de-noising, SNR of processed ECG is calculated and MSE was determined to find the degree of mismatch between noisy ECG and filtered. The designed low pass FIR filter with Kaiser Window works excellent in removing High frequency EMG interference from noisy ECG conditions utilizing low order of filter. It has been deduced that utilization of hardware resources using DA FIR has been minimized.
The extension activity for this research is to cascading FIR and IIR and understanding the optimum performance along with A/D and D/A converter interfaced within the FPGA. Selective filters using fuzzy can be studied to reduce the noises. Also the attention needs to pay for reduction in leakage power as a VLSI backend activity, where near about 90 % power is leakage power.
References
[1] B. Pradeep Kumar and S. Balambigai, February 2012, ‘ A Survey on ECG De-Noising Techniques, Bonfring International Journal of advances in Image Processing’, Vol. 2, Special Issue 1, Part 1.
[2] Omid Sayadi, Mohammad Bagher Shamsollahi , september 2008, ‘ECG Denoising and Compression Using a Modified extended Kalman Filter Structure’, IEEE Transactions on Biomedical Engineering, VOL 55, NO. 9..
[3] N. V. Thakor and Y.-S. Zhu, Aug. 1991, ‘Applications of adaptive filtering to ECG analysis: Noise cancellation and arrhythmia detection’, IEEE Trans. Biomedi. Eng., vol . 38, no. 8, pp. 785–794.
[4] P. Laguna, R. Jane, O. Meste, P. W. Poon, P. Caminal, H. Rix, and N. V. Thakor, Oct. 1992’Adaptive filter for Event related bioelectric signals using an impulse correlated reference input: Comparison with signal averaging techniques’, IEEE Trans. Biomed. Eng. vol. 39, no. 10, pp. 1032–1044.
[5] Alka Gautam, Hoon-Jae Lee, April- June 2010, ’ ECG signal De- noising with Asynchronous averaging and filtering algorithm, 30 International Journal of Healthcare Information Systems and Informatics’, 5(2), 30-36,.
[6] P Raphisak, SC Schuckers1, A de Jongh Curry, 2004,’An Algorithm or EMG Noise Detection in Large ECG Data ,Lane Computers in Cardiology ‘,31:369í372.
[7] Rakesh Chand, Pawan Tripathi, Abhishek Mathur, 1-5-2010,’FPGA implementation of fast FIR low pass filter for EMG removal from ECG signal, power ,control and embeeded systems (ICPCES) international Conference.
[8] Castillala Mancha and César Sánchez Meléndez, Jorgeateo Sotos, 2007,’ Removal of Muscular and Artefacts Noise from the Electrocardiogram (ECG) by a Neural Network’, 5th IEEE International Conference on Industrial Informatics, pp no : 687 – 692 . [9] Berney Montavon, Mehmet Ergezer, Paul Lozovyy, Arun Venkatesan, May 14 - 16, 2012 Baltimore, USA , ‘Adaptive Filtering For Detecting Myocardial Infarction Using Noninvasive Conducting Polymer Composite Sensors’, Proceedings of the IASTED International Symposia Imaging and Signal Processing in Health Care and Technology (ISPHT 2012) .
[10] V. Sudhakar, N.S. Murthy , L. Anjaneyulu , 2012, ‘Area Efficient Pipelined Architecture For Realization of FIR Filter Using Distributed Arithmetic’, International Conference on Industrial and Intelligent Information (ICIII 2012) IPCSIT vol.31 (2012) IACSIT
Press, Singapore.
[11] Sridhathan Chandramouleeswaran, Ahmed M. A. Haidar, Fahmi Samsuri, 2012,’Wavelet diagnosis of ECG signals with kaiser based noise diminution’, J. Biomedical Science and Engineering, 5, 705-714
[12] www.physionet.org
[13] K. Kaneko, “A 50ns DSP with Parallel Processing Architecture, 1987, ‘ Digest of Tech. Papers, 1987 Int’l Solid-State Circuits Conf., IEEE Press’,Piscataway, N.J.,pp. 158-159
[14] K. Nadehara, M. Hayashida, I. Kuroda, 1995, ‘A Low-Power, 32-bit RISC Processor with Signal Processing Capability and Its Multiply- Adder’,VLSI Signal Processing, IEEE Press, Piscataway, N.J., pp.51-60.
Windowing Filtering
Method order of filter slices slices flip flop 4 input LUTs
bonded IOB GCLK Kaiser 13 87 156 111 17 1 Rectangular 17 98 176 126 17 1 Hanning 15 89 160 117 17 1 Hamming 15 89 160 117 17 1 Blackman 19 108 194 135 17 1 Bartlett 37 148 269 218 17 1 Available Resources -- 4656 9312 9312 17 1