**2.1. Bank of EEG signals**

The bank of EEG signals is composed by records of 11 patients truly epileptic. The used signals present the following settings: referential montage with Pz as the reference electrode, 32 channels, 512 Hz of sample rate, band limited 0.3-70 Hz and notch filter of 60 Hz to eliminate interferences caused by the power line. For the experiments were selected 600 events between spikes and sharp waves.

#### **2.2. Wavelet multiresolution analysis**

82 Practical Applications in Biomedical Engineering

from other activities present in the EEG.

EEG signals.

**2. Material and methods** 

**2.1. Bank of EEG signals** 

sharp waves being confused with epileptiform events.

high frequency noise, the alpha waves and especially the eyelid blinks (Figure 1). These patterns often occur in the EEG signals and they have characteristics similar to spikes and

**Figure 1.** EEG screen with high frequency noise, eyelid blinks and epileptiform events (black arrow).

The low specificity of automated systems occurs due to variations in the EEG signals from patient to patient. This variation also occurs in the own patient due to different states of consciousness and behavior at the time of acquisition of these signals. Thus, it is difficult to establish a computational model of the epileptiform paroxysms, that can differentiate it

The sensitivity of such systems can also be severely compromised by poor quality in the acquisition of an EEG signal. This is due to the large number of existing sources of artifacts. Despite this, most of the proposed automated systems fail to demonstrate they have

This work will contribute to the automating process of the epilepsy diagnosis with a digital filter proposal based on Wavelet Transform, checking its feasibility of use to process the

The bank of EEG signals is composed by records of 11 patients truly epileptic. The used signals present the following settings: referential montage with Pz as the reference electrode, 32 channels, 512 Hz of sample rate, band limited 0.3-70 Hz and notch filter of 60 Hz to

achieved a rate of false positives per minute (FP / min) acceptable [5].

The analysis in time-frequency domain by Wavelet Transform is performed by taking a Wavelet prototype function called Mother-Wavelet. This Mother-Wavelet suffers dilations and translations, forming the Daughter-Wavelets (1) [6-7].

$$
\psi\_{\
u,b^\*}\left(t\right) = \frac{1}{\sqrt{a}} \cdot \psi\left(\frac{t-b}{a}\right) \tag{1}
$$

where *ψ(t)* is the Mother-Wavelet and *ψa,b* is the Daughter-Wavelet, *a-1/2* is the constant of energy normalization, *b* is the translation factor and *a* is the dilation factor.

The Continuous Wavelet Transform uses continuous parameters of time and scales [6]. Using discrete parameters to *a* and *b* (*a*≥1, *b*≥1) determines the Discrete Wavelet Transform (2).

$$DWT\left(a,b\right) = \frac{1}{\sqrt{a\_0^i}} \stackrel{\text{v}}{\underset{t}{\rightleftarrows}} x\left(t\right) \cdot \nu^\* \left(\frac{t - kb\_0 a\_0^i}{a\_0^i}\right) dt \tag{2}$$

where *k* and *i* are integers, *b0* and *a0* are the parameters of translation and dilation, respectively.

The Wavelet Multiresolution Analysis is based in the computational implementation of the Discrete Wavelet Transform. The algorithm decomposes a discrete signal using filter banks, [6-8]. The set of filters H[n] extract the average characteristics, defined as approximations of the signal *x* and added to a set of filters G[n] extract the features of high-frequency defined as details of the signal x[n] (Figure 2).

**Figure 2.** Representation of the Wavelet Multiresolution Analysis.

#### *2.2.1. Filtering EEG signals using the denoising method*

The denoising method is a resource used in the decomposition process of the Wavelet Transform. This method is used to filter the signal through the manipulation of its coefficients in the Wavelet domain, before the reconstruction of the signal as shown in Figure 3.

Wavelet Filter to Attenuate the Background Activity and

High Frequencies in EEG Signals Applied in the Automatic Identification of Epileptiform Events 85

It can be possible to manipulate the coefficients in a variety of ways depending of the application [7]. For example, it is possible set groups or individual coefficients to zero from a specific scale (Figure 5[a]), increase or reduce the magnitude of them or even to choose some coefficients under or above a specific threshold (λ) and set its values to zero or other value (Figure 5[b]). Performing some of these ways it can be possible to use the Wavelet Transform with a digital filter. Further information see [7-10]. To demonstrate the behavior of a signal processed by denoising method was used an event epileptiform decomposed into six levels, generating the levels A6 and D6, D5, D4, D3, D2, D1 (Figure 5[a]). For better visualization the original signals (in black) and the processed signals (in blue) were superimposed, as a way to contrast the changes made between them. In Figure 5[a] is presented the first form of filtering selecting a given level of decomposition. The level A6 was removed from the decomposed signal, setting zero values to the corresponding coefficients (begining of signal to the red mark). Eliminating this level of approximation, the lower frequency of the signal will also be eliminated after its reconstruction. The signal resulting from this process (blue) compared with the original signal (black) shows a reduction of low frequency oscillations, highlighting the peak of the epileptiform event.In Figure 5[b] is presented the second form of filtering resulting from choice of a particular decision threshold (in this case four standard deviations). Removing the coefficients

**Figure 5.** Denoising method to filtering EEG signals. In [a] decomposition using scales,

[b] decomposition using a threshold.

**Figure 3.** Representation of some ways to suppress coefficients in the Wavelet domain used to process a signal.

Once the full decomposition process was done from a particular Wavelet function it is possible to alter any of the coefficients in the transformed signal before performing the inverse transform (Figure 4).

**Figure 4.** Original signal and the decomposed signal in the Wavelet domain.

It can be possible to manipulate the coefficients in a variety of ways depending of the application [7]. For example, it is possible set groups or individual coefficients to zero from a specific scale (Figure 5[a]), increase or reduce the magnitude of them or even to choose some coefficients under or above a specific threshold (λ) and set its values to zero or other value (Figure 5[b]). Performing some of these ways it can be possible to use the Wavelet Transform with a digital filter. Further information see [7-10]. To demonstrate the behavior of a signal processed by denoising method was used an event epileptiform decomposed into six levels, generating the levels A6 and D6, D5, D4, D3, D2, D1 (Figure 5[a]). For better visualization the original signals (in black) and the processed signals (in blue) were superimposed, as a way to contrast the changes made between them. In Figure 5[a] is presented the first form of filtering selecting a given level of decomposition. The level A6 was removed from the decomposed signal, setting zero values to the corresponding coefficients (begining of signal to the red mark). Eliminating this level of approximation, the lower frequency of the signal will also be eliminated after its reconstruction. The signal resulting from this process (blue) compared with the original signal (black) shows a reduction of low frequency oscillations, highlighting the peak of the epileptiform event.In Figure 5[b] is presented the second form of filtering resulting from choice of a particular decision threshold (in this case four standard deviations). Removing the coefficients

84 Practical Applications in Biomedical Engineering

Figure 3.

signal.

inverse transform (Figure 4).

*2.2.1. Filtering EEG signals using the denoising method* 

The denoising method is a resource used in the decomposition process of the Wavelet Transform. This method is used to filter the signal through the manipulation of its coefficients in the Wavelet domain, before the reconstruction of the signal as shown in

**Figure 3.** Representation of some ways to suppress coefficients in the Wavelet domain used to process a

Once the full decomposition process was done from a particular Wavelet function it is possible to alter any of the coefficients in the transformed signal before performing the

**Figure 4.** Original signal and the decomposed signal in the Wavelet domain.

**Figure 5.** Denoising method to filtering EEG signals. In [a] decomposition using scales, [b] decomposition using a threshold.

between the thresholds (marked in red) and replacing their values by zero, the high frequencies of the signal also change. High frequencies are increasingly attenuated as the threshold increases, making this a low-pass filter. Removing the coefficients that exceed the defined threshold, the low frequencies of the signal will be attenuated, making this process a high-pass filter. The filter proposed here is based on the first form of filtering, where the unnecessary frequencies of the EEG signals are eliminated, manipulating specific decomposition levels of the signal, which will be better explained in the next section.

Wavelet Filter to Attenuate the Background Activity and

High Frequencies in EEG Signals Applied in the Automatic Identification of Epileptiform Events 87

**Figure 6.** Process of decomposition and reconstruction of a signal.

including the 60 Hz noise

**Figure 7.** Proposal for a Wavelet filter using only the details of the decomposed signal. This filter is proposed performing an addition operation between levels of detail to obtain a signal free from interference, like the baseline and low frequency oscillations, as well as high frequency interference,

In this work the Wavelet Transform is employed as a digital filter. Thus, it was decided to make an inquiry to find the most appropriate Wavelet function for use with the filter, that contain few coefficients, and little distortion of the signal after filtering process. In initial experiments we used the energy of each Wavelet function as a criterion of choice. The function that had the highest average of accumulated energy and a reduced number of

**3.2. Choice of the wavelet function to use with the proposed filter** 
