Introduction lectrocardiography (ECG) plays an important role in monitoring and diagnosing cardiovascular diseases. The frequency bandwidth for therapy of the ECG signal is from 0.05Hz to 100Hz, and the highest peak is about 1mV [1].During recording of ECG signals, the ECG signals get contaminated such as power supply harmonic 50Hzor power line interference (Most country including Viet Nam use 50Hz electric system)with the amplitude approaches 50% the highest peak of the ECG signal, artifacts caused by losing the direct contact between electrodes and the skin, or by EMG-this artifact's amplitude is 10% of the highest peak's amplitude of the ECG signal, or by respiratory with noise's amplitude is 15% of the highest peak of the ECG signal at 0.3 Hz frequency [2].In the listed noises, the power line noise affects P wave and Q wave of the ECG signal. That causes errors in arrhythmia and myocardial infarctiondiagnosis [3].In recent years, a few adaptive filters with different approaches are investigated to remove the power line noise 50 Hz in the ECG signal such asdesign of an adaptive filter with a dynamic structure for ECG signal processing [3], adaptive filtering in ECG denoising: a comparative study [4], denoising ECG signals using adaptive filter algorithm [5], denoising ECG signals with adaptive filtering algorithm & patch based method [6], investigation of adaptive filtering for noise cancellation in ECG signals [7], designing and implementation of algorithms on Matlab for Adaptive noise cancellation from ECG signal [8], performance comparison of adaptive filter algorithms for ECG signal Enhancement [9], performance evaluation of different adaptive filters for ECG signal processing [10].Most of the researches use Least Mean Square (LMS) and Normalize Least Mean Square algorithm (NLMS). These algorithms enable to change filter coefficients with given order; the algorithms are quite reliable and effective with small convergent time. However, in case of the power line noise's amplitude equals to 40-50% amplitude of the highest (QRS peak) of the ECG signal, these algorithms give not effective results, and the filtered signal still contains noise. To overcome this problem, the authors propose an adaptive filter algorithm based on Fast Fourier Transform (FFT). This algorithm is experimented with ECG database such as number of record 117 and aVL lead of patient279/s0532 from ECG database MIT-BIH [11]. The results of this algorithm are compared with that of LMS, NLMS by SNR criterion. The process and experiments are performed by LabVIEW software. # II. # Methodology The aim of adaptive filter based on Fast Fourier Transform (FFT) is detecting the power line noise frequency, and determining threshold of this noise's magnitude. Fourier transform: If x(n) is a discrete signal satisfying the condition (1), ? |??(??)| < ? +? ??=?? (1) So Fourier transform equation for x(n) is given formula (2) (2) where i is the imaging part, i 2 = -1 According to the material [12], B.Widrow has shown that the adaptive filter transfer function is descripted as (3) (3) where ? is the step size of the adaptive filter; K is the magnitude of power line noise; ? 0 is the angular frequency. In this study, ifS(n) is ECG signal contaminated power supply harmonic 50 Hz, soS(n) is expressed in the equation ( 4). Year 2015 # Global Journal of C omp uter S cience and T echnology Volume XV Issue II Version I ( ) C S(n) = X(n) + N(n) (4) Where X(n) is the clean ECG signal, N(n) is the power supply harmonic 50 Hz. Based on the equations ( 1) and ( 2), (4) equation can be displayed in another form (5). # S(?) = X(?) +N(?) (5) The magnitude-frequency spectrum of X(?),N(?) and S(?) is shown as figure 1, figure 2,and figure 3 corresponsive. Step 1: Importing input signal S(n) Step 2: Transforming FFT S(n) (for detecting the magnitude and frequency of the 50Hz power supply ) Step 3: Determining the frequency and magnitude of the power line interference: Choosing the frequency bandwidth is from 30Hz to 70Hz; setting the threshold of noise's FFT magnitude is 15(based on experiments with FFT of the contaminated ECG signal) Step 4: Initializing for loop, starting from i: =0 Step 5: Checking condition: the magnitude of the power line noise in FFT is less than 15 or not? If true: Step 6: Displaying the filtered signal and ending the processing. # If false: Step 7: Realizing the transfer function (3) Step 8: Calculating the output signal: y(n) = H(n). S(n) Step 9: Transforming FFT y(n) (for checking whether or not existing noise in the frequency bandwidth from 30Hz to 70 Hz?) Step 10: Increasing the iteration: i: = i++and returning to the step 5. To experiment and test these above steps and LMS, NLMS adaptive filter algorithms, the authors used adaptive filter toolkit available in Lab VIEW. The results of the proposed algorithm are compared with that of LMS and NLMS algorithms by Signal to Noise (SNR). This criterion is followed by equation (6). SNR = 20log 10 ? RMS (y (n ) ) RMS (X (n ) ? y (n ) ) ? (6) where RMS(y (n) ) is the Root Mean Square of the filtered ECG signal; RMS(x (n) ) is the Root Mean Square of the original ECG signal. III. # Results and Discussion The authors have tested the proposed algorithm by using a few standard ECG database records such as record mitdb117 and a VL lead of record patient 279/s 0532 from ECG database MIT-BIH added with the power supply harmonic 50 Hz having variable magnitude is from 0.4mV to 0.5mV. This signal is generated by using LabVIEW. Figure 4a is the ECG signal of the record mitdb117, and this signal is added with the power line noise 50Hz (shown in Fig. 4b). Figure 4c, 4d and 4e display the results of filtering the power line interference with 0.4 mV magnitude using the proposed adaptive filter, LMS and NLMS corresponding adaptive filters. Intuitively, the filtered ECG signal using the proposed algorithm has nearly no appearance of noise and has the morphology similar to the original ECG signal. To prove the efficiency of the proposed algorithm in filtering the power line noise in ECG signal compared with LMS, and NLMS algorithms, the authors continue experimenting these algorithms with ECG data base of aVL lead of recordpatient279/s0532.The results are shown in figures 5c, 5d and 5e.These results indicate that the better efficiency of the proposed adaptive filter algorithm compared with the others. Figure 5c shows the effectiveness. To affirm the efficiency of the proposed algorithm with LMS, NLMS algorithms, the authors used SNR criterion SNR calculated by equation ( 6). Table 1 show the comparison among three methods filtering the power line noise with 0.4 mV magnitude, and the noise is added directly to the ECG signal in the record mitdb117.The SNR value of the proposed algorithm is higher than that of LMS and NLMS algorithms when the step size?=0.02; ?= 0.03 and?=0.04. However, in case that ?=0.01 the SNR value of the proposed algorithm is just smaller 0.079 than that of NLMS. # Conclusion The proposed adaptive filter algorithm for removing the power line interference in ECG signal based on Fast Fourier Transform (FFT) has been investigated with applications in the steps of the algorithm. That detects the power line frequency, and sets the threshold for the noise magnitude in FFT has high efficiency. In addition, that uses many for loops in the proposed algorithm support to filter the power line noise more carefully. The appearance of the noise is insignificant in the filtered ECG signal. Three algorithms are proceeded at the same time: adaptive filter LMS, NLMS (with different step sizes),and the proposed algorithm to remove the power supply harmonic 50 Hz (with 0.4 mV magnitude) added to the ECG signal of the record mitdb117,aVL lead of the record patient 279/s0532. The experimental results show that the proposed adaptive filter algorithm produces good ECG signal with little noise, similar to the original ECG signal displayed in figure 4 and figure 5. Furthermore, to demonstrate the efficiency of the algorithm, the authors have compared the proposed algorithm with LMS and NLMS adaptive filter algorithms by SNR criterion. From the results in table 1 and table 2, the proposed adaptive filter algorithm for removing the power line noise 50 Hz with 0.4 mV magnitude has higher efficiency. That is asserted by SNR value in the table 1 and table 2. 1![Figure 1 : Magnitude-frequency spectrum of clean ECG signal](image-2.png "Figure 1 :") 2![Figure 2 : Magnitude-frequency spectrum of power line noise 50 Hz with magnitude is 0.4mV](image-3.png "Figure 2 :") 3![Figure 3 : Magnitude-frequency spectrum of the contaminated ECG signal That determines the magnitude and frequency of power line noise follows these below steps.](image-4.png "Figure 3 :") 4![Figure 4 : The results of removing power line interference 50 Hz. a)Clean ECG signal; b) ECG signal contaminated by power line noise with 0.4 mV magnitude; c) recovered ECG signal using proposed Algorithm; d)recovered ECG signal using MLS Algorithm; e) recovered ECG signal using NLMS Algorithm](image-5.png "RemovalCFigure 4 :") 5![Figure 5 : The results of filtering power supply harmonic 50 Hz. a)Original ECG signal; b) Contaminated ECG signal(noise's magnitude is 0.4 mV); c) recovered ECG signal using proposed Algorithm; d)recovered ECG signal using MLS Algorithm; e) recovered ECG signal using NLMS Algorithm](image-6.png "Figure 5 :") 1Year 2015 2AlgorithmStep sizeSNRLMS2.709NLMS0.012.744Proposed2.877LMS2.697NLMS0.022.671Proposed2.877LMS2.737NLMS0.032.678Proposed2.877LMS2.788NLMS0.042.704Proposed2.877From the table 2, the SNR value of the proposedalgorithm is higher than that of LMS, NLMS algorithmswith step size ?=0.01 ÷0.04 .IV. © 2015 Global Journals Inc. (US) © 2015 Global Journals Inc. (US) 1 * Biomedical signal analysis MRangaraj Rangayyan 2002 John Wiley & Sons, Inc. Canada * GDClifford FAzuaje PMcsharry Advanced Methods and Tools for ECG Data Analysis * MANorwood Usa 2006 Artech House, Inc * Design of an adaptive filter with a dynamic structure for ECG signal processing Ju-WonLee Gun-KiLee International Journal of control, automation and system 3 1 2005 * adaptive filtering in ECG denoising: a comparative study Romero Geng Berset Computing in Cardiology 39 2012 * Denoising ECG signals using adaptive filter algorithm MKChinmay Chandrakar Kowar International Journal of Soft Computing and Engineering (IJSCE) 2231-2307 2 March 2012 * denoising ECG signals with adaptive filtering algorithm & patch based method ADeo MKBandil AKSingh Wadhwani International Journal of Computer Networks and Wireless Communications (IJCNWC) 2250-3501 3 No3, 2013 * Investigation of Adaptive Filtering for Noise Cancellation in ECG signals SoroorBehbahani 2007 IEEE * designing and implementation of algorithms on Matlab for Adaptive noise cancellation from ECG signal HKGupta RVijay NGupta International Journal of Computer Applications 71 5 2013 * performance comparison of adaptive filter algorithms for ECG signal Enhancement SARehman RRKumar International Journal of Advanced Research in Computer and Communication Engineering 1 2012 * performance evaluation of different adaptive filters for ECG signal processing SachinSingh KLYadav International Journal on Computer Science and Engineering 02 05 1880-1883, 2010 * Adaptive signal processing BWidrow SDSteams 1985 Prentice Hall Englewood Cliffs