16th Argentine Bioengineering Congress and the 5th Conference of Clinical Engineering IOP Publishing Journal of Physics: Conference Series 90 (2007) 012081 doi:10.1088/1742-6596/90/1/012081
Artifact removal from EEG signals using adaptive filters in cascade A Garcés Correa 1, E Laciar 1, H D Patiño 2, M E Valentinuzzi 3 1
Gabinete de Tecnología Médica, Facultad de Ingeniería, Universidad Nacional de San Juan 2 Instituto de Automática, Facultad de Ingeniería, Universidad Nacional de San Juan 3 Instituto Superior de Investigaciones Biológicas (INSIBIO), UNT-CONICET, Tucumán, Argentina E-mail:
[email protected] Abstract. Artifacts in EEG (electroencephalogram) records are caused by various factors, like line interference, EOG (electro-oculogram) and ECG (electrocardiogram). These noise sources increase the difficulty in analyzing the EEG and to obtaining clinical information. For this reason, it is necessary to design specific filters to decrease such artifacts in EEG records. In this paper, a cascade of three adaptive filters based on a least mean squares (LMS) algorithm is proposed. The first one eliminates line interference, the second adaptive filter removes the ECG artifacts and the last one cancels EOG spikes. Each stage uses a finite impulse response (FIR) filter, which adjusts its coefficients to produce an output similar to the artifacts present in the EEG. The proposed cascade adaptive filter was tested in five real EEG records acquired in polysomnographic studies. In all cases, line-frequency, ECG and EOG artifacts were attenuated. It is concluded that the proposed filter reduces the common artifacts present in EEG signals without removing significant information embedded in these records.
1. Introduction EEG records carry information about abnormalities or responses to certain stimuli in the human brain. Some of the characteristics of these signals are the frequency and the morphology of their waves. These components are in the order of just a few up to 200 μV, and their frequency content differs among the different neurological rhythms, as the alpha, beta, delta and theta rhythms [1]. Such rhythms are analyzed by physicians in order to detect neural disorders and cerebral pathologies [2]. However, these rhythms are generally mixed with other biological signals, for example alpha is commonly mixed with the EOG (electro-oculogram). In this case, opening, closing or movements of the eyes produce artifacts in the EEG. Other artifact sources are the ECG (electrocardiogram), EMG (electromyogram) and the power line interference (50 or 60 Hz) [3]. An example of an EEG mixed with ECG and corrupted with line interference is illustrated in Figure 1. Due to the presence of artifacts, it is difficult to analyze the EEG, for they introduce spikes which can be confused with neurological rhythms. Thus, noise and undesirable signals must be eliminated or attenuated from the EEG to ensure a correct analysis and diagnosis. In this work, we propose a cascade of adaptive filters in order to remove some frequent artifacts in EEG signals. The aim of these filters is to cancel ECG, EOG and line interference.
c 2007 IOP Publishing Ltd
1
16th Argentine Bioengineering Congress and the 5th Conference of Clinical Engineering IOP Publishing Journal of Physics: Conference Series 90 (2007) 012081 doi:10.1088/1742-6596/90/1/012081
Figure 1. Example of a real EEG recording mixed with ECG and corrupted with line interference. 2. Methodology 2.1. Adaptive Filtering. Conventional filtering cannot be applied to eliminate those types of artifacts because EEG signal and artifacts have overlapping spectra. Herein, we propose the use of adaptive filters, which are based on the optimization theory. Adaptive filters have the capability of modifying their properties according to selected features of the signals being analyzed. Figure 2 illustrates the structure of an adaptive filter. There is a primary signal d(n) and a secondary signal x(n). The linear filter H(z) produces an output y(n), which is subtracted from d(n) to compute an error e(n).
Figure 2. Structure of an adaptive filter. The objective of an adaptive filter is to change (adapt) the coefficients of the linear filter, and hence its frequency response, to generate a signal similar to the noise present in the signal to be filtered. The adaptive process involves minimization of a cost function, which is used to determine the filter coefficients. By and large, the adaptive filter adjusts its coefficients to minimize the squared error between its output and a primary signal. In stationary conditions, the filter should converge to the Wiener solution. Conversely, in non-stationary circumstances, the coefficients will change with time, according to the signal variation, thus converging to an optimum filter [4]. In an adaptive filter, there are basically two processes: -A filtering process, in which an output signal is the response of a digital filter. Usually, FIR filters are used in this process because they are simple and stable. -An adaptive process, in which the transfer function H(z) is adjusted according to an optimizing algorithm. The adaptation is directed by the error signal between the primary signal and the filter output. The most used optimizing criterion is the least mean square (LMS) algorithm.
2
16th Argentine Bioengineering Congress and the 5th Conference of Clinical Engineering IOP Publishing Journal of Physics: Conference Series 90 (2007) 012081 doi:10.1088/1742-6596/90/1/012081
The structure of the FIR can be represented as, L
y (n) = ∑ wk x(n − k )
(1)
k =0
where L is the order of the filter, x(n) is the secondary input signal, wk are the filter coefficients and y(n) is the filter output. The error signal e(n) is defined as the difference between the primary signal d(n) and the filter output y(n), that is,
e (n) = d (n) − y (n)
(2)
where L
e(n ) = d (n ) − ∑ wk x(n − k )
(3)
k =0
The squared error is,
⎤ ⎡L e (n ) = d (n ) − 2d (n )∑ wk x(n − k ) + ⎢∑ wk x(n − k )⎥ k =0 ⎣ k =0 ⎦ L
2
2
2
(4)
The squared error expectation for N samples is given by
ζ = E [e (n )] = ∑ e 2 (n ) N
2
(5)
k =0
ζ = ∑ [d 2 (n )] − 2∑ wk rdx (n ) + ∑ N
L
L
n =1
k =0
k =0
L
∑ w w r (k − l ) l =0
k
l xx
(6)
where rdx(n) and rxx(n) are, respectively, the cross-correlation function between the primary and secondary input signals, and the autocorrelation function of the secondary input, that is N
rdx (n ) = ∑ d (n )x(n − k )
(7)
n =1
N
rxx (n ) = ∑ x(n )x(n − k )
(8)
n =1
The objective of the adaptation process is to minimize the squared error, which describes a performance surface. To get this goal there are different optimization techniques. In this work, we used the method of steepest descent [5]. With this, it is possible to calculate the filter coefficient vector for each iteration k having information about the previous coefficients and gradient, multiplied by a constant, that is,
wk ( n + 1) = wk ( n ) + μ ( −∇ k ) where μ is a coefficient that controls the rate of adaptation.
3
(9)
16th Argentine Bioengineering Congress and the 5th Conference of Clinical Engineering IOP Publishing Journal of Physics: Conference Series 90 (2007) 012081 doi:10.1088/1742-6596/90/1/012081
The gradient is defined as,
∇k =
∂ {e2 ( n )} ∂wk ( n )
(10)
Substituting (10) in (9) leads to
wk ( n + 1) = wk ( n ) − μ
∂ {e2 ( n )} ∂wk ( n )
(11)
Deriving with respect to wk and replacing leads to,
wk ( n + 1) = wk ( n ) − 2μ e ( n )
∂ {e ( n )} ∂wk ( n )
L ⎧ ⎫ ∂ ⎨d (n ) − ∑ wk x(n − k )⎬ k =0 ⎭ wk (n + 1) = wk (n ) − 2 μ e(n ) ⎩ ∂wk (n )
(12)
(13)
Since d(n) and x(n) are independent with respect to wk , then
wk ( n + 1) = wk ( n ) − 2 μ e ( n ) x ( n − k )
(14)
Equation (14) is the final description of the algorithm to compute the filter coefficients as function of the signal error e(n) and the reference input signal x(n). The coefficient μ is a constant that must be chosen for quick adaptation without losing stability. The filter is stable if μ satisfies the following condition,
0