Denoising ECG Signals using Transform Domain ... - IEEE Xplore

4 downloads 10167 Views 419KB Size Report
Email: [email protected]. Abstract— In this paper, an efficient Fast Block LMS (FBLMS) algorithm is proposed for removing artifacts preserving the.
Denoising ECG Signals using Transform Domain Adaptive Filtering Technique Mohammad Zia Ur Rahman

Rafi Ahamed Shaik

D V Rama Koti Reddy

Department of Electronics and Communication Engineering Narasaraopet Engineering College Narasaraopet-522 601, India Email: mdzr [email protected]

Department of Electronics and Communication Engineering Indian Institute of Technology Guwahati Guwahati-781 039, India Email: rafi[email protected]

Department of Instrument Technology College of Engineering Andhra University Visakhapatnam-530 003, India Email: [email protected]

Abstract— In this paper, an efficient Fast Block LMS (FBLMS) algorithm is proposed for removing artifacts preserving the low frequency components and tiny features of the ECG. The proposed implementation is suitable for applications requiring large signal to noise ratios with fast convergence rate. The FBLMS algorithm, being the solution of the steepest descent strategy for minimizing the mean squared error in a complete signal occurrence, is shown to be steady-state unbiased and with a lower variance than the LMS algorithm. Finally, we have applied this algorithm on ECG signals from the MIT-BIH data base and compared its performance with the conventional LMS algorithm. The results show that the performance of the FBLMS algorithm is superior than the LMS algorithm.

I. I NTRODUCTION The extraction of high-resolution ECG signals from recordings contaminated with background noise is an important issue to investigate. The goal for ECG signal enhancement is to separate the valid signal components from the undesired artifacts, so as to present an ECG that facilitates easy and accurate interpretation. Many approaches have been reported in the literature to address ECG enhancement using adaptive filters [2]-[3], which permit to detect time varying potentials and to track the dynamic variations of the signals. In [3], Thakor et al. proposed an LMS based adaptive recurrent filter to acquire the impulse response of normal QRS complexes, and then applied it for arrhythmia detection in ambulatory ECG recordings. The reference inputs to the LMS algorithm are deterministic functions and are defined by a periodically extended, truncated set of orthonormal basis functions. In these papers, the LMS algorithm operates on an instantaneous basis such that the weight vector is updated every new sample within the occurrence, based on an instantaneous gradient estimate. There are certain clinical applications of ECG signal processing that require adaptive filters with large number of taps. In such applications the conventional LMS algorithm is computationally expensive to implement. The block processing of data samples can significantly reduce the computational complexity. By applying this strategy, a special implementation of the LMS algorithm is called the block LMS algorithm. In a recent study, however, a steady state convergence analysis for the LMS algorithm with deterministic reference inputs showed that the steady-state weight vector is biased, and thus,

the adaptive estimate does not approach the Wiener solution. To handle this drawback another strategy was considered for estimating the coefficients of the linear expansion, ie., the BLMS algorithm [8], in which the coefficient vector is updated only once every occurrence based on a block gradient estimation. The BLMS algorithm has been proposed in the case of random reference inputs and has, when the input is stationary, the same steady state misadjustment and convergence speed as the LMS algorithm. A major advantage of the block, or the transform domain, LMS algorithm is that the input signals are approximately uncorrelated. Moreover, the filter output and the weight update terms can be evaluated faster using FFT-based fast BLMS (FBLMS) algorithm. The advantage of this algorithm is less computational complexity and good filtering capability. These characteristics may plays a vital role in biotelemetry, where extraction of noise free ECG signal for efficient diagnosis and fast computations, high data transfer rate are needed to avoid overlapping of pulses and to resolve ambiguities. To the best of our knowledge, transform domain has not been considered previously within the context of filtering artifacts in ECG signals. In this paper, we present a FBLMS algorithm to remove the artifacts from ECG. Such a realization is intrinsically less complex than its BLMS based counterpart. This algorithm enjoys less computational complexity and good filtering capability. To study the performance of the proposed algorithm to effectively remove the noise from the ECG signal, we carried out simulations on MIT-BIH database for different artifacts. The simulation results shows that the proposed algorithm performs better than the LMS counterpart to eliminate the noise from ECG. II. FAST BLOCK LMS ALGORITHM FOR R EMOVAL OF N OISE FROM ECG S IGNAL Consider a length L LMS based adaptive filter, depicted in Fig. 1, that takes an input sequence x(n) and updates the weights as w(n + 1) = w(n) + μ x(n) e(n),

(1)

Where w(n) = [w0 (n) w1 (n) · · · wL−1 (n)]t is the tap weight vector at the nth index, x(n) = [x(n) x(n − 1) · · · x(n − L + 1)]t , e(n) = d(n)−wt (n) x(n), with d(n) being the so-called

978-1-4244-4859-3/09/$25.00 ©2009

desired response available during initial training period and μ denoting so-called step-size parameter.

Fig. 1.

Adaptive filter structure

In order to remove the noise from the ECG signal, the ECG signal s1 (n) with additive noise p1 (n) is applied as the desired response d(n) for the adaptive filter shown in Fig. 1. If the noise signal p2 (n), possibly recorded from another generator of noise that is correlated in some way with p1 (n) is applied at the input of the filter, i.e., x(n) = p2 (n) the filter error becomes e(n) = [s1 (n) + p1 (n)] − y(n). The filter output y(n) is given by, y(n) = wt (n)x(n),

(2)

Since the signal and noise are uncorrelated, the mean-squared error (MSE) is E[e2 (n)] = E{[s1 (n) − y(n)]2 } + E[p21 (n)]

(3)

Minimizing the MSE results in a filter output that is the best least-squares estimate of the signal s1 (n). In the proposed implementation we considered a FBLMS based adaptive filter, that takes an input sequence x(n), which is partitioned into non-overlapping blocks of length P each by means of a serial-to-parallel converter, and the blocks of data so produced are applied to an FIR filter of length L, one block at a time. The tap weights of the filter are updated after the collection of each block of data samples, so that the adaptation of the filter proceeds on a block-by-block basis rather than on a sample-by-sample basis as in conventional LMS algorithm. With the j-th block, (j ∈ Z) consisting of x(jP + r), r ∈ ZP = 0, 1, . . . , P − 1, the filter coefficients are updated from block to block as, −1 w(j + 1) = w(j) + μΣP r=0 x(jP + r)e(jP + r)

(4)

t

where w(j) = [w0 (j)w1 (j) . . . wL−1 (j)] is the tap weight vector corresponding to the j-th block, x(jP + t r) = [x(jP + r)x(jP + r − 1) . . . x(jP + r − L + 1)] and e(jP + r) is the output error at n = jP + r, given by, e(jP + r) = d(jP + r) − y(jP + r).

(5)

The sequence d(jP + r) is the so-called desired response available during the initial training period and y(jP + r) is the filter output at n = jP + r, given as, y(jP + r) = wt (j) x(jP + r).

(6)

The parameter μ, popularly called the step size parameter is 2 for convergence of the to be chosen as 0 < μ < [P trR] algorithm. The filter output vector as given by (6) is obtained by convolving the input data sequence x(n) with the filter coefficient vector w0 (j), · · · , wL−1 (j) and thus can be realized efficiently by the overlap-save method via M = L + P − 1 point FFT, where the first L − 1 points come from the previous subblock, for which the output is to be discarded. Similarly, the P −1 x(jP + r)e(jP + r) weight update term in (4), viz., Σr=0 can be obtained by the usual circular correlation technique, by employing M point FFT and setting the last P − 1 output terms as zero. The FBLMS algorithm is nothing but a fast implementation of the BLMS algorithm in frequency domain. The element by element multiplication of the frequency domain samples of the input and filter coefficients is followed by an IDFT and a proper windowing of the result to obtain the output vector[4]. Finally, consider (4) for updating the tap-weight vector of the filter it may correspondingly transform into the frequency domain as,  W(j + 1) = W(j) + μ F F T

Φ(j) 0

 (7)

Here Φ(j) is a matrix of first M elements of IFFT [D(j)U(j)E(j)]. Where D(j) is related to diagonal matrix of average signal power, U(j) is diagonal matrix obtained by Fourier transforming two successive blocks of input data, E(j) is transform of error signal vector. III. S IMULATION R ESULTS To show that FBLMS algorithm is really effective in clinical situations, the method has been validated using several ECG recordings with a wide variety of wave morphologies from MIT-BIH arrhythmia database. We used the benchmark MITBIH arrhythmia database ECG recordings as the reference for our work and real noise is obtained from MIT-BIH Normal Sinus Rhythm Database (NSTDB). The arrhythmia data base consists of 48 half hour excerpts of two channel ambulatory ECG recordings, which were obtained from 47 subjects, including 25 men aged 32-89 years, and women aged 2389 years. The recordings were digitized at 360 samples per second per channel with 11-bit resolution over a 10 mV range. For evaluating the performance of the proposed adaptive filter we have measured the SNR improvement and compared with LMS algorithm, shown in table I. For all the figures number of samples are taken on x-axis and amplitude on y-axis, unless stated. The difference signal after filtering for BW is shown in Fig. 3, due to space constraint, the difference signals for PLI, MA and EM are not shown. A. Baseline Wander Reduction In this experiment, first we collected 4000 samples of the pure ECG signal from the MIT-BIH arrhythmia database(data105) and it is corrupted with real baseline wander

(BW) taken from the MIT-BIH NSTDB. The contaminated ECG signal is applied as primary input to the adaptive filter of Fig.1. The real BW is given as reference signal. The adaptive filter was implemented using the LMS and FBLMS algorithms to study the relative performance and results are plotted in Fig.2. 2

with synthetic PLI with amplitude 1mv and frequency 60Hz, sampled at 200Hz. The reference signal is synthesized PLI, the output of the filter is recovered signal. These results are shown in Fig.4. Fig.5 shows the power spectrum of the noisy signal before and after filtering with normalized signed LMS algorithm. No harmonics are synthesized. From the spectrum it is clear that the adaptive filter based on FBLMS algorithm filters the PLI efficiently.

1

2 0

0 −1

0

500

1000

1500

2000 (a)

2500

3000

3500

4000

−2

2 1

5

0

0

−1

0

500

1000

1500

2000 (b)

2500

3000

3500

4000

2

−5

0

500

1000

1500

2000 (a)

2500

3000

3500

4000

0

500

1000

1500

2000 (b)

2500

3000

3500

4000

0

500

1000

1500

2000 (c)

2500

3000

3500

4000

0

500

1000

1500

2000 (d)

2500

3000

3500

4000

2

1

0 0

−2 −1

0

500

1000

1500

2000 (c)

2500

3000

3500

4000

2

Fig. 2. Typical filtering results of baseline wander reduction (a) ECG with real BW (b) recovered signal using LMS algorithm, (c) recovered signal using FBLMS algorithm.

1 0 −1

Fig.3. shows the difference between original signal and restored signal using both algorithms. From the figure it is clear that FBLMS eliminates the noise completely, where as in the conventional LMS filtering some residual noise present in the filtered signal.

Fig. 4. Typical filtering results of PLI Cancelation (a) clean MIT-BIH record 105, (b) ECG with 60Hz noise, (c) recovered signal using LMS algorithm, (d) recovered signal using FBLMS algorithm.

0

0.6 0.5

−20

Magnitude(dB)

Amplitude

0.4 0.3 0.2 0.1

−40 −60 −80

0 −0.1

−100 0

50

100

150

200 Number of blocks (a)

250

300

350

400

20

30

40

50 60 Frequency in Hz (a)

70

80

90

100

10

20

30

40

50 60 Frequency in Hz (b)

70

80

90

100

0

0.3 0.2

−20

Magnitude(dB)

0.1

Amplitude

10

0 −0.1 −0.2

−40 −60 −80

−0.3 −0.4

−100 0

500

1000

1500

2000 2500 Number of Samples (b)

3000

3500

4000

Fig. 3. Typical filtering results of baseline wander reduction (a) Difference Signal after FBLMS filtering (b) Difference Signal after LMS filtering

Fig. 5. (a) Frequency spectrum of ECG with PLI, (b) Frequency spectrum after filtering with FBLMS algorithm.

B. Adaptive Power-line Interference Canceler

C. Adaptive Cancelation of Muscle Artifacts

To demonstrate power line interference (PLI) cancelation we have chosen MIT-BIH record number 105. The input to the filter is ECG signal corresponds to the data 105 corrupted

To show the filtering performance in the presence of nonstationary noise, real muscle artifact (MA) was taken from the MIT-BIH Noise Stress Test Database. The MA originally had

TABLE I P ERFORMANCE C ONTRAST OF LMS AND FBLMS ALGORITHMS FOR THE C ANCELLATION OF A RTIFACTS Type of Noice

Algorithm

BW

LMS FBLMS LMS FBLMS LMS FBLMS LMS FBLMS

PLI MA EM

SNR Before Filtering (in dBs) 1.25 1.25 -2.6948 -2.6948 1.25 1.25 1.25 1.25

SNR After Filtering (in dBs) 4.6580 12.2882 18.8993 12.2827 6.1804 12.2980 5.1985 12.1928

2 1 0 −1

SNR Improvement (in dBs) 3.4080 11.0382 21.5941 14.9775 4.9304 11.0480 3.9450 10.9428

−2

0

500

1000

1500

2000 (a)

2500

3000

3500

4000

0

500

1000

1500

2000 (b)

2500

3000

3500

4000

0

500

1000

1500

2000 (c)

2500

3000

3500

4000

2 1 0 −1

2 1

a sampling frequency of 360Hz and therefore they were antialias resampled to 128Hz in order to match the sampling rate of the ECG. The original ECG signal with MA is given as input to the adaptive filter. MA is given as reference signal. The output from the filter is noise free signal. These results are shown in Fig.6.

0 −1

Fig. 7. Typical filtering results of motion artifacts removal (a) ECG with real motion artifacts, (b) recovered signal using LMS algorithm, (c) recovered signal using FBLMS algorithm.

2 1 0 −1 −2

0

500

1000

1500

2000 (a)

2500

3000

3500

4000

0

500

1000

1500

2000 (b)

2500

3000

3500

4000

2 1 0 −1

this, the input and the desired response signals are properly chosen in such a way that the filter output is the best least squared estimate of the original ECG signal. The proposed treatment exploits the modifications in the weight update formula and thus pushes up the speed over the respective LMS based realizations. Our simulations, however, confirm that the SNR of the proposed algorithm is better than that of LMS algorithm. Also, the convergence rate is faster than LMS and computational complexity is less in the proposed implementation than its time domain implementation.

2 1

R EFERENCES

0

[1] O. Sayadi and M. B. Shamsollahi, “Model-based fiducial points extraction for baseline wander electrocardiograms,” IEEE Trans. Biomed. Eng., vol. 55, pp. 347-351, Jan.2008. [2] Y. Der Lin and Y. Hen Hu, “Power-line interference detection and suppression in ECG signal processing,” IEEE Trans. Biomed. Eng., vol. 55, pp. 354-357, Jan.2008. [3] N. V. Thakor and Y.-S. Zhu, “Applications of adaptive filtering to ECG analysis: noise cancellation and arrhythmia detection,” IEEE Transactions on Biomedical Engineering, vol. 38, no. 8, pp. 785-794, 1991. [4] Farhang-Boroujeny, B., Adaptive Filters-Theory and Applications, John Wiley and Sons, Chichester, UK, 1998. [5] P. E. McSharry, G. D. Clifford, L. Tarassenko, and L. A. Smith, “A dynamical model for generating synthetic electrocardiogram signals,” IEEE Transactions on Biomedical Engineering, vol. 50, no. 3, pp. 289294, 2003. [6] L. Biel, O. Pettersson, L. Philipson, and P.Wide, “ECG Analysis: A new approach in human identification,” IEEE Trans. Instrum. Meas., vol. 50, pp. 808-812, June 2001 [7] Ziarani. A. K, Konrad. A, “A nonlinear adaptive method of elimination of power line interference in ECG signals”, IEEE Transactions on Biomedical Engineering, Vol49, No.6, pp.540-547, 2002. [8] S. Olmos , L. Sornmo and P. Laguna, “Block adaptive filter with deterministic reference inputs for event-related signals:BLMS and BRLS,” IEEE Trans. Signal Processing, vol. 50, pp. 1102-1112, May.2002.

−1

0

500

1000

1500

2000 (c)

2500

3000

3500

4000

Fig. 6. Typical filtering results of muscle artifacts removal (a) ECG with real muscle artifacts, (b) recovered signal using LMS algorithm, (c) recovered signal using FBLMS algorithm.

D. Adaptive Motion Artifacts Cancelation To demonstrate this we use MIT-BIH record number 105 ECG data with electrode motion artifact (EM) added, where EM is taken from MIT-BIH NSTDB. The ECG signal corresponds to record 105 is corrupted with EM is given as input to the adaptive filter. The EM noise is given as reference signal. Output of the filter is the required high resolution ECG signal. Fig.8. shows these results. IV. C ONCLUSION In this paper the process of noise removal from ECG signal using fast block LMS based adaptive filter is presented. For

Suggest Documents