• Nenhum resultado encontrado

Nonlinear filtering in ECG Signal Enhancement

N/A
N/A
Protected

Academic year: 2016

Share "Nonlinear filtering in ECG Signal Enhancement"

Copied!
6
0
0

Texto

(1)

Nonlinear filtering in ECG Signal Enhancement

N. Siddiah1, T.Srikanth2 and Y. Satish Kumar3

1

Dept. of E.C.E., Mekapati Raja Mohana Reddy Institute of Technology & Science, Udyagiri, A.P., India. 2

Dept. of E.C.E., Kallam Haranadha Reddy Institute of Technology, Guntur, A.P., India. 3

Dept. of E.C.E., Chalapathi Institute of Technology, Guntur, A.P., India. E-Mail: siddun89@ymail.com

Abstract

-

High resolution ECG signals are needed in measuring cardiac abnormalities analysis. Generally baseline wander is one of the important artifact occurred in ECG signal extraction, this strongly affects the signal quality. In order to facilitate proper diagnosis these artifacts have to be removed. In this paper various non linear, non adaptive filtering techniques are presented for the removal of baseline wander removal from ECG signals. The performance characteristics of various filtering techniques are measured in terms of signal to noise ratio.

Keywords - artifacts, baseline wander, ECG signal, filtering.

1. INTRODUCTION

Various civilizations have used arterial pulses as a guide for the diagnosis of diseases. All methods of pulse diagnosis requires that professionals have training and experience, however, even the diagnosis of experienced professionals is not always accurate. Pulse analysis waveform is used for a variety of pathological and physiological purposes in diagnosis. In recent years computer aided ECG signal analysis has gained momentum and a tremendous amount of work has been carried out [1]-[5]. One area of interest has been removing artifacts from data records. Artifacts are the noise induced to ECG signals that result from movements of electrodes. This in turn causes deformation and change in the electrical characteristics of the skin under and around the electrodes. These electrical changes appear in the ECG as motion artifacts and baseline drifts.

Baseline wanders are considered as an artifact which produces inaccurate data when measuring the ECG parameters [6]. The ST-segment measures are especially strongly affected by this wandering. Inmost of the ECG recordings the respiration, electrode impedance changes due to perspiration and increased body movements are the main causes of the baseline wandering [11]. Therefore, elimination of the baseline drifts can very much change the clinical information of the ECG signal. The frequency components of the baseline wander are usually below 0.5Hz which is higher under stress test condition [7].

We introduce various filters for the removal of Base line wander. The filters we used are linear and non linear filters. In the linear filtering approach we have used the linear filters such as a band pass filter using FFT algorithm and a zero phase low pass filter. In the Non linear approach we have used

the filters like median filter, moving average filter and Kalman filter. All these filtering techniques are non adaptive filtering techniques [10].

2. FILTERS

A linear filter applies a linear operator input signal to a variable time. Linear filters are very common in electronics and digital signal processing. They are often used to remove unwanted frequencies from an input signal or to select a desired frequency among many others. There are a wide range of types of filters and filter technologies. Regardless of whether they are electronic, electrical, mechanical, or what frequency ranges and time scales that work, the mathematical theory of linear filters is universal.

2.1.Band Pass Filters

Finite Impulse Response(FIR) digital filter with a band-pass frequency response, employing fast (FFT-based) convolution for the filtering computation (suitable for filter lengths above approximately 100). The built-in filter designer implements a range of standard "windowing" design methods. A band-pass filter allows a band of frequencies (the "pass-band") to pass through, while attenuating frequencies above and below this pass-band. Denoting the lower and upper edge frequencies of the pass-band as fpass L and fpass U, respectively, the pass-band thus spans the range from fpass L to fpass U. Ideally, the two corresponding "stop-bands" would consist of all frequencies below fpass L and above fpass U, respectively. However, no filter is ideal, and there will always be finite "transition bands" between the stop-band(s) and pass-band(s). In the case of the band-pass filter, these can be described in terms of the stop-band edge frequencies fstop L and fstop U such that the lower stop-band extends from 0 to fstop L, followed by the lower transition band from fstop L to fpass L, followed by the pass-band, then the upper transition band from fpass U to fstop U, and then the upper stop-band from fstop U to the Nyquist frequency, fNyq (defined as half the sample rate) which is the maximum possible frequency for a digital filter (by contrast, an analogue filter can, in principle, extend to infinity!)

(2)

filter designs, the same gain for both stop-bands), and the pass-band will be scaled by a gain factor, denoted G pass, which would ideally be equal to unity. (By convention, all gain factors are expressed in decibels defined as: G dB = 20 log10 G.)

A nonlinear filter is a signal-processing device whose output is not a linear function of its input. Terminology concerning the filtering problem may refer to the time domain (state space) representation of the signal or to the frequency domain representation of the signal. When referring to filters with adjectives such as "band pass, high pass, and low pass" one has in mind the frequency domain. When resorting to terms like "additive noise", one has in mind the time domain, since the noise that is to be added to the signal is added in the state space representation of the signal. The state space representation is more general and is used for the advanced formulation of the filtering problem as a mathematical problem in probability and statistics of stochastic processes.

2.2. Median Filter

A median filter, which has many applications in ECG processing and it is a favourite tool among ECG society for smoothing filtering. The best known feature of median filters is their ability to remove noise while retaining sudden changes in the signal. The median filter is implemented by sliding a window of odd length over the signal one sample at time. At each window position the samples inside the filter window are sorted by magnitude and the mid-value (median) is the filter output. We denote the filter length N and since required to be odd it can be represented as N = 2k +1. The output of the filter is then the (k+1)th largest or smallest sample in the filter window. The filtering procedure is denoted as:

= � − ,…, ,…, + (1)

Where x (n) and y (n) is the input and output sequences. If the samples in the filter window are denoted as x1, x2, x3……….x2k+1 notation that is commonly used from the sorted list of those samples is x(1), x(2),………. x(2k+ 1). Here, x (1), x (2k+ 1) are the smallest and the greatest sample, respectively. By using this notation the median value is x(k+1). The definition of median for an even and odd number of samples is given by:

1,…, =

( + ) = 2�+ 1

1

2 + ( + ) = 2�

(2)

When the filter window is centered at the beginning or at the end of the input signal some value must be assigned to the empty window position. The first and the last value carry-on appending strategy are used. This means that values from x (-k)

to x (-1) are taken to be equal to x(0), and the values from x(L)

to x(L+k-1) are equal to x(L-1), where the signal is consisted of samples from x(0) to x(L-1). One of the major problems with the median filter is that it is relatively expensive and complex to compute. To find the median it is necessary to sort

all the values in the neighbourhood into numerical order and this is relatively slow [8]-[9].

2.3.Moving Average Filter

The moving average is the most common filter in DSP, mainly because it is the easiest digital filter to understand and use. In spite of its simplicity, the moving average filter is optimal for a common task: reducing random noise. As the name implies, the moving average filter operates by averaging a number of points from the input signal to produce each point in the output signal. In equation form, this is written:

=

1 =0−1

( + )

Equation of the moving average filter. In this equation, x [ ] is the input signal, y [ ] is the output signal, and

M is the number of points used in the moving average. This equation only uses points on one side of the output sample being calculated. In a 5 point moving average filter, point 80 in the output signal is given by:

80

=

80 + 81 + 82 + 83+ [84]

5

As an alternative, the group of points from the input signal can be chosen symmetrically around the output point:

80

=

78 + 79+ 80+ 81+ [82]

5

This corresponds to changing the summation in first equation from: j= 0 to M-1, to: j=0-(M-1) /2 to (M+1) /2. For instance, in a 10 point moving average filter, the index, j, can run from 0 to 11 (one side averaging) or -5 to 5 (symmetrical averaging). Symmetrical averaging requires that M be an odd

number. Programming is slightly easier with the points on only one side; however, this produces a relative shift between the input and output signals. You should recognize that the moving average filter is a convolution using a very simple filter kernel. For example, a 5 point filter has the filter kernel: þ 0, 0, 1/5, 1/5, 1/5, 1/5, 1/5, 0, 0 þ. That is, the moving average filter is a convolution of the input signal with a rectangular pulse having an area of one [17].

2.4.Kalman Filter

(3)

Kalman filters are based on linear dynamical systems discretised in the time domain. They are modeled on a Markov chain built on linear operators perturbed by Gaussian noise. The state of the system is represented as a vector of real numbers. At each discrete time increment, a linear operator is applied to the state to generate the new state, with some noise mixed in, and optionally some information from the controls on the system if they are known. Then, another linear operator mixed with more noise generates the visible outputs from the hidden state. The Kalman filter may be regarded as analogous to the hidden Markov model, with the key difference that the hidden state variables take values in a continuous space (as opposed to a discrete state space as in the hidden Markov model). Additionally, the hidden Markov model can represent an arbitrary distribution for the next value of the state variables, in contrast to the Gaussian noise model that is used for the Kalman filter. There is a strong duality between the equations of the Kalman Filter and those of the hidden Markov model.

In order to use the Kalman filter to estimate the internal state of a process given only a sequence of noisy observations, one must model the process in accordance with the framework of the Kalman filter. This means specifying the matrices Fk, Hk, Qk, Rk, and sometimes Bk for each time-step k as described below.

Fig. 1. Model describing Kalman filter.

Model underlying the Kalman filter is shown in fig:1. Circles are vectors, squares are matrices, and stars represent Gaussian noise with the associated covariance matrix at the lower right. The Kalman filter model assumes the true state at time k is evolved from the state at (k − 1) according to

x

k

= F

k

x

k-1

+B

k

u

k

+w

k

Where

Fk is the state transition model which is applied to the previous state xk-1;

Bk is the control-input model which is applied to the control vector uk;

wk is the process noise which is assumed to be drawn from a zero mean multivariate normal distribution with covariance Qk.

~ (0, )

At time k an observation (or measurement) zk of the true state xk is made according to

=

+

Where Hk is the observation model which maps the true state space into the observed space and vk is the observation noise which is assumed to be zero mean Gaussian white noise with covariance Rk.

~ (0, )

The initial state, and the noise vectors at each step {x0, w1... wk, v1 ... vk} are all assumed to be mutually independent.

Many real dynamical systems do not exactly fit this model; however, because the Kalman filter is designed to operate in the presence of noise, an approximate fit is often good enough for the filter to be very useful. Variations on the Kalman filter described below allow richer and more sophisticated models.

The Kalman filter is a recursive estimator. This means that only the estimated state from the previous time step and the current measurement are needed to compute the estimate for the current state. In contrast to batch estimation techniques, no history of observations and/or estimates is required. It is unusual in being purely a time domain filter; most filters (for example, a low-pass filter) are formulated in the frequency domain and then transformed back to the time domain for implementation.

3. RESULTS

Fig 2: sample ECG Signal with Base-line drift.

The ECG signal with baseline drift was shown in Fig 2 which was collected from MIT-BIH database. Due to the baseline drift problem the ECG signal was shifted upwards and the peaks were disturbed and could not be identified properly. The drift of the base line with respiration can be

0 2 4 6 8 10 12 14 16 18 20

-0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4

sample ECG Signal1 With Base-line drift

time (sec.)

am

pl

itu

de

(

m

v.

(4)

represented by a sinusoidal component at the frequency of respiration added to the ECG signal.

The baseline wander extracted from the noisy data after filtering the data with single median filter is shown Fig 3. In this filtering technique the baseline wander is extracted while retaining the sudden changes in the signal. The median filter is implemented by sliding a window of odd length over the signal one sample at time. At each window position the samples inside the filter window are sorted by magnitude and the mid-value (median) is the filter output.

Fig 3: Extracted noise signal after filtering with single median filter.

Fig 4: Restored signal after filtering with single median filter.

The restored ECG signal which was obtained by subtracting the extracted baseline wander from the noisy input data is shown in fig 4-3. In the figure it was shown that the baseline wander is removed some extent and retaining the sharp changes in the input data. The signal to noise ratio is calculated and given as 16.6623 means a considerable SNR value which is greater than 10.

The baseline wander extracted from the noisy data after filtering the data with double median filter is shown Fig

5. In this filtering technique the filtering was done in two stages by taking two averaging windows of different lengths so that the noise is reduced to a great extent and it is shown by calculating the SNR value.

Fig 5: Extracted noise signal after filtering with double median filter.

Fig 6: Restored signal after filtering with double median filter.

The restored ECG signal which was obtained by subtracting the extracted baseline wander from the noisy input data is shown in fig 6. It was shown in the Fig 4-5 the edges are highlighted to a great extent when compared to single median filter. The SNR value is calculated as 16.1299 and the computational time is more than 4 seconds so it takes more time for computation.

The baseline wander extracted from the noisy data after filtering the data with double mean filter is shown Fig 7. This is a simple approach to remove noise from various signals. The moving average filter operates by averaging a number of points from the input signal to produce each point in the output signal. It takes less time when compared to median filter for computation.

0 2 4 6 8 10 12 14 16 18 20

-0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4

Extracted noise signal after filtering with single median filter

time (sec.)

am

pl

itu

de

(

m

v.

)

0 2 4 6 8 10 12 14 16 18 20

-0.2 -0.15 -0.1 -0.05 0 0.05 0.1 0.15

Restored ECG signal after single median filtering

time (sec.)

am

pl

itu

de

(

m

v.

)

0 2 4 6 8 10 12 14 16 18 20

-0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5

Extracted noise signal after filtering with double median filter

time (sec.)

am

pl

itu

de

(m

v.

)

0 2 4 6 8 10 12 14 16 18 20

-0.2 -0.15 -0.1 -0.05 0 0.05 0.1 0.15

Restored ECG signal after double median filtering

time (sec.)

am

pl

itu

de

(

m

v.

(5)

Fig 7: Extracted noise signal after filtering with double mean filter.

Fig. 8: Restored signal after filtering with double mean filter.

The restored ECG signal which was obtained by subtracting the extracted baseline wander from the noisy input data is shown in fig 8. It smoothes the data clearly when compared to the median filter. The main disadvantage of this filter is it alters the sharp edges in the signal. The SNR value is computed as 15.5344 and the computation time is 2.2 seconds which is less compared to median filter.

Fig 9: Extracted noise signal after filtering with Kalman smoothing filter.

The baseline wander extracted from the noisy data after filtering the data with kalman smoothing filter is shown Fig. 10. The kalman filter is an optimal non linear filter for removal of noise. It best approximates the noise than other non linear filters. It uses state space representation of the signal to estimate the noise presented in the signal. The SNR value is computed as 15.6138 and the computational time for this filter is more than 4 seconds so it takes more time compared to other filters for computation.

The baseline wander extracted from the noisy data after filtering the data with low pass IIR filter is shown Fig 11. The low pass IIR filter uses forward and reverse digital filtering technique to obtain the zero phase. The performance of IIR filters is in general unacceptable due to nonlinear phase response, which introduces distortion in various parts of the ECG signal. An IIR filter could, however, be used for forward / backward filtering which results in linear phase filtering.

Fig. 10: Restored signal after filtering with Kalman filter.

Fig 11: Extracted noise signal after filtering with low pass IIR filter.

0 2 4 6 8 10 12 14 16 18 20

-0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5

Extracted noise signal after filtering with double mean filter

time (sec.)

am

pl

itu

de

(

m

v.

)

0 2 4 6 8 10 12 14 16 18 20

-0.2 -0.15 -0.1 -0.05 0 0.05 0.1 0.15

Restored ECG signal afterdouble mean filtering

time (sec.)

am

pl

itu

de

(

m

v.

)

0 2 4 6 8 10 12 14 16 18 20

-0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5

Extracted noise signal after filtering with Kalman smoothing filter

time (sec.)

am

pl

itu

de

(m

v.

)

0 2 4 6 8 10 12 14 16 18 20

-0.2 -0.15 -0.1 -0.05 0 0.05 0.1 0.15

Restored ECG signal after kalman filtering

time (sec.)

am

pl

itu

de

(

m

v.

)

0 2 4 6 8 10 12 14 16 18 20

-0.2 -0.1 0 0.1 0.2 0.3 0.4 0.5

Extracted noise signal after filtering with low-pass IIR filter

time (sec.)

am

pl

itu

de

(

m

v.

(6)

Fig 12: ECG with baseline wander extracted from various filters.

To show the performance of various filtering techniques the SNR values for various filters are calculated and tabulated in Table 1.

TABLE 1: SNR VALUES FOR VARIOUS FILTERS

S.NO. Filtering

Technique

SNR initial

SNR after filtering

SNR improved

1 Single median 0.50474 16.6233 16.11856

2 Double median 0.50474 16.1299 15.62516

3 Double mean 0.50474 15.5344 15.02966

4 Kalman 0.50474 15.6138 15.10906

5 Low pass 0.50474 16.1754 15.67066

6 Band pass 0.50474 14.4009 13.89616

4. CONCLUSION

In this paper we presented various filters based on non-linear filtering for removing baseline wander from ECG signal. It has been shown that the presented filters can eliminate baseline drifts from ECG signals without introducing any deformation to the signal and losing any clinical information. All the above considered techniques were Non adaptive techniques which don’t require any reference signal, so it is easy to implement and design this filters and also costs less. These techniques are faster than the traditional adaptive algorithms.

REFERENCES

[1] B. Widrow, J. Glover, J. M. McCool, J. Kaunitz, C. S. Williams, R. H.Hearn, J. R. Zeidler, E. Dong, and R. Goodlin,“Adaptive noise cancelling: Principles and applications ”, Proc. IEEE, vol. 63, pp.1692-1716, Dec. 1975.

[2] A. K. Barros and N. Ohnishi, “MSE behavior of biomedical event-related filters”, IEEE Trans. Biomed. Eng., vol. 44, pp. 848-855, Sept.1997.

[3] O.Sayadi and M. B. Shamsollahi, “Model-based fiducial points extraction for baseline wanders electrocardiograms" IEEE Trans. Biomed. Eng., vol. 55, pp. 347-351, Jan.2008. [4] 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.

[5] 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.

[6] 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.

[7] P. Laguna, R. Jane, S. Olmos, N. V. Thakor, H. Rix, and P. Caminal, ``Adaptive estimation of QRS complex by the Hermite model for classification and ectopic beat detection," Med. Bio. Eng. Comput, vol. 34, pp. 58-68, Jan. 1996. [8] Farhang-Boroujeny, B., “Adaptive Filters- Theory and applications”, John Wiley and Sons, Chichester, UK, 1998. [9] Adaptive Filter Theory By Simon Haykin, Thomas Kailath, Pearson education, 2002 edition.

[10] Biomedical Signal Processing Principles and Techniques By D.C.REDDY, IEEE series, Tata Mc-Graw Hill, 2006 edition.

[11] Adaptive Signal Processing by Bernard Widrow and Samuel D.Stearns, Pearson education, 2006 edition. [12] Crevasse, L., and M.Arit, Computers and Cardiology, J.W (Ed.): Hurst, the Heart, Seventh Edition, Chapter 14 International Edition, Mc Graw Hill, New York, 1990. [13] Tompkins, W.J., Electrocardiography, Bio Medical Digital Signal Processing, Prentice Hall, India, 1999. [14] Orfanidis, S.J., Optimum Signal Processing, Second Edition, Tata McGraw Hill, 1988.

[15] Nizan Zhang, Bernt,Brian ,” Investigation of Adaptive Filtering for Noisy ECG signals”, IEEE Trans Biomedical Engg, June,2006, Vol-3, pp 734-742.

[16] C.Baurer, Future of cardiology opportunities to Exceed Expections, Bon Secours Health System, Inc., White Paper, June, 2003.

[17] S.L. Marple. Digital Spectral Analysis. Prentice-Hall International, 1987.

0 2 4 6 8 10 12 14 16 18 20

-0.4 -0.3 -0.2 -0.1 0 0.1 0.2 0.3 0.4

time (sec.)

Referências

Documentos relacionados

Ousasse apontar algumas hipóteses para a solução desse problema público a partir do exposto dos autores usados como base para fundamentação teórica, da análise dos dados

O trabalho artístico realizado em contextos prisionais - os atores sociais em interação sobre o seu território (a instituição total) - as relações entre os grupos de reclusos e

O gene de interesse (Figura 6) foi constituído com sítios para as enzimas de restrição NruI, SmaI e PacI em sua extremidade 5’ e XhoI, XbaI e AvrII em sua

No total de amostras fecais analisadas 49 estavam negativas e 35 positivas para presença de ovos de helmintos, observando uma maior incidência de ovos de Ancylostoma sp.. (29

The input of the phase detector includes the input signal of the PLL and the output signal of the VCO, as shown in the Figure 3.2. Once the phase detector of the LPLL is a

Finally, in grade 5, the patient has a totally impaired lingual mobility, being considered the most severe degree of ankyloglossia, the restriction of movement interferes with

N o género de realidades escolhidas para essa ilustração, que são sempre realizações pessoais, de realçar é, não só o facto de que a ostensão seja uma relação

Identificar a efetivação do direito à saúde, prestado pelo Estado e pela empresa, por intermédio da análise da gestão e humanização da atividade hospitalar, também são