Signal Processing and Wavelet Theory

[15] Gargour C, Gabrea M,

*Wavelet Theory*

Magazine. 2009; 9(2): 57–68.

[17] Akansu A N, Haddad R A.

[18] Mallat S G. Multiresolution Approximations and Wavelet Orthonormal Bases of *L*<sup>2</sup>

Transactions of the American Mathematical Society. 1989; 315(1):

[20] Goswami J C, Chan A K. Fundamentals of Wavelets: Theory, Algorithms, and Applications, Second Edition, John Wiley & Sons, Inc; 2011.

[21] Chang R W. Synthesis of Band-Limited Orthogonal Signals for Multichannel Data Transmission, Bell Systems Technical Journal. 45: 1775– 1796. see also U.S. Patent 3,488,445, Jan.

[22] Erdol N, Bao F, Chen Z. Wavelet Modulation: A Prototype for Digital Communication Systems. In: Proceeding

of the IEEE Conference Record Southcon '95, 7–9 March, Fort Lauderdale, FL: 1995. P. 168–171.

[23] Jamin A, Mähönen P. Wavelet Packet Modulation for Wireless Communications: Research Articles, Wireless Communications and Mobile Computing. 2005; 5(2): 123–137.

[19] Li A, Shieh W, Tucker R. Wavelet Packet Transform-Based OFDM for Optical Communications, Journal of Lightwave Technology. 2010; 28(24):

1997.

1992.

69–87.

3519–3528.

6, 1970.

**86**

Ramachandran V, Lina J M. A Short Introduction to Wavelets and Their Applications, IEEE Circuits and Systems [24] Vetterli M, Kovacevic J. Wavelets and Subband Coding, Prentice Hall Signal Processing Series, Prentice

[25] Jr R M W. IEEE 802.16 Broadband Wireless Access Working Group. Technical report. SciCom, Inc. 2001.

[26] Zhang L. A Study of IEEE 802.16a OFDM-PHY Baseband. Master's thesis, Department of Electrical Engineering, Linköping Institute of Technology. 2005

Hall PTR. 1995.

[16] Burrus S C, Gopinath R A, Guo H. Introduction to Wavelets and Wavelet Transforms: A Primer. Prentice Hall.

Multiresolution Signal Decomposition: Transforms, Subbands, and Wavelets. Academic Press, Inc., Orlando, FL, USA.

(*R*),

**Chapter 5**

**Abstract**

*Nikesh Bajaj*

gram and Electromyogram.

**1. Introduction**

**89**

algorithms, time-frequency analysis

using wavelet in biomedical signals [6].

Wavelets for EEG Analysis

This chapter introduces the applications of wavelet for Electroencephalogram (EEG) signal analysis. First, the overview of EEG signal is discussed to the recording of raw EEG and widely used frequency bands in EEG studies. The chapter then progresses to discuss the common artefacts that contaminate EEG signal while recording. With a short overview of wavelet analysis techniques, namely; Continues Wavelet Transform (CWT), Discrete Wavelet Transform (DWT), and Wavelet Packet Decomposition (WPD), the chapter demonstrates the richness of CWT over conventional time-frequency analysis technique e.g. Short-Time Fourier Transform. Lastly, artefact removal algorithms based on Independent Component Analysis (ICA) and wavelet are discussed and a comparative analysis is demonstrated. The techniques covered in this chapter show that wavelet analysis is wellsuited for EEG signals for describing time-localised event. Due to similar nature, wavelet analysis is also suitable for other biomedical signals such as Electrocardio-

**Keywords:** EEG, artefacts, wavelet analysis, CWT, DWT, WPD, artefact removal

Biomedical signals are electrical activities recorded by sensors from a part of the body, such as the brain, heart, muscles, etc. They can be recorded as images e.g. functional Magnetic resonance Image (fMRI) from brain or a temporal signal e.g. Electrocardiogram (ECG), Electroencephalogram (EEG), Electromyogram (EMG), Galvanic Skin Response (GSR), etc. These signals contain useful information to analyse and understand the underlying physiological response of the body, thus they are also referred to as physiological signals. Biomedical signals are extensively used in healthcare to diagnose deceases and monitor health. With recent advancements and ease of using the devices to record the biomedical signals have open a window to use it to analyse and understand the day-to-day activities, emotions, and, experiences [1–3]. While recording the physiological activities through sensors, the signals are usually contaminated by noise and various artefacts [4]. Corrupted signals mislead the analysis and understanding of the underlying physiology [5]. The characteristics of wavelet to identify the time-localised events makes it suitable for the biomedical signals to clean, process, feature extraction, and analyse for various applications. Recent studies have shown the promising results of

In this chapter, first, we introduce one kind of biomedical signal - EEG. We will explain the conventional features used in EEG studies. We will introduce the artefacts that commonly contaminate EEG signals, which makes it harder to use. The

## **Chapter 5** Wavelets for EEG Analysis

*Nikesh Bajaj*

#### **Abstract**

This chapter introduces the applications of wavelet for Electroencephalogram (EEG) signal analysis. First, the overview of EEG signal is discussed to the recording of raw EEG and widely used frequency bands in EEG studies. The chapter then progresses to discuss the common artefacts that contaminate EEG signal while recording. With a short overview of wavelet analysis techniques, namely; Continues Wavelet Transform (CWT), Discrete Wavelet Transform (DWT), and Wavelet Packet Decomposition (WPD), the chapter demonstrates the richness of CWT over conventional time-frequency analysis technique e.g. Short-Time Fourier Transform. Lastly, artefact removal algorithms based on Independent Component Analysis (ICA) and wavelet are discussed and a comparative analysis is demonstrated. The techniques covered in this chapter show that wavelet analysis is wellsuited for EEG signals for describing time-localised event. Due to similar nature, wavelet analysis is also suitable for other biomedical signals such as Electrocardiogram and Electromyogram.

**Keywords:** EEG, artefacts, wavelet analysis, CWT, DWT, WPD, artefact removal algorithms, time-frequency analysis

#### **1. Introduction**

Biomedical signals are electrical activities recorded by sensors from a part of the body, such as the brain, heart, muscles, etc. They can be recorded as images e.g. functional Magnetic resonance Image (fMRI) from brain or a temporal signal e.g. Electrocardiogram (ECG), Electroencephalogram (EEG), Electromyogram (EMG), Galvanic Skin Response (GSR), etc. These signals contain useful information to analyse and understand the underlying physiological response of the body, thus they are also referred to as physiological signals. Biomedical signals are extensively used in healthcare to diagnose deceases and monitor health. With recent advancements and ease of using the devices to record the biomedical signals have open a window to use it to analyse and understand the day-to-day activities, emotions, and, experiences [1–3]. While recording the physiological activities through sensors, the signals are usually contaminated by noise and various artefacts [4]. Corrupted signals mislead the analysis and understanding of the underlying physiology [5]. The characteristics of wavelet to identify the time-localised events makes it suitable for the biomedical signals to clean, process, feature extraction, and analyse for various applications. Recent studies have shown the promising results of using wavelet in biomedical signals [6].

In this chapter, first, we introduce one kind of biomedical signal - EEG. We will explain the conventional features used in EEG studies. We will introduce the artefacts that commonly contaminate EEG signals, which makes it harder to use. The

chapter then will move towards a short description of Wavelet analysis techniques, namely Continues Wavelet Transform (CWT), Discrete Wavelet Transform (DWT), and Wavelet Packet Decomposition (WPD). We would, then, compare CWT and STFT for EEG signal. Then, we will discuss artefact removal algorithms, with more details on Wavelet-based algorithms. The chapter will show the comparative analysis of artefact removal algorithm. The approach and analysis shown in this chapter for EEG signals can easily be applied to other biological signals.

The placement of electrodes has been standardised with the specific anatomical landmarks with a distance between electrodes as 10% or 20% of total length. This placement is called the 10–20 system, as shown in **Figure 1b**. The number of electrodes used for EEG recording varies, depending on the device. One of the low spatial resolutions can be of a 14-channel EEG device and high spatial resolution with 128 or 256 channels. The name of the electrode position is labelled as character followed by a number to identify the part of the brain. The characters are *Fop* for pre-frontal, *F* for frontal, *P* for parietal,*T* for temporal, *O* for occipital, and *C* for central lobe of the brain. A few in between two landmarks are named with two characters, such as *AF*, between *Fp* and *F* and *FC*, between *F* and *C* [4]. An example

The raw recording of EEG signal in the time-domain is complex to interpret. Similar to many other signals, frequency domain analysis has been widely used. The decades of work on EEG studies have identified five major frequency bands for EEG signals and established the correlation between behaviour and neural activity of a certain part of the brain. The frequency bands widely used are; Delta (0*:*1 4 Hz or 0*:*5 4 Hz), Theta (4 8 Hz), Alpha (8 14 Hz), Beta (14 30 Hz), Gamma (30 63 Hz). A raw EEG signal from a channel and corresponding signal in different bands are shown in **Figure 2**. It can be observed that low frequency, Delta activity, is the dominating wave in raw EEG and high-frequency Gamma is almost

Due to multichannel signals, it is usually viewed as topographical brain activity (heatmap over an image of head) under different frequency bands. An example of 5 seconds EEG recording with a 14-channel device is shown in **Figure 3**. The first second of all the channels are used to compute the energy distribution over brain regions. In **Figure 3**, the top left shows the raw EEG signal and corresponding brain activity, which shows a high activity in the frontal lobe of the brain. However, under different frequency bands, the different part of the brain shows higher

The frequency bands; Delta, Theta, Alpha, Beta, and Gamma, are also called brain rhythms. Brain rhythms have been investigated over decades and a few characteristic behaviour of these brain rhythms have been established [4].

*The signal channel raw EEG signal and corresponding frequency bands: Delta (*0*:*1 4 *Hz), theta (*4 8 *Hz),*

*alpha (*8 14 *Hz), Beta (*14 30 *Hz), gamma (*30 63 *Hz).*

of 14-channel is shown in **Figure 1b**.

*DOI: http://dx.doi.org/10.5772/intechopen.94398*

*Wavelets for EEG Analysis*

noise like with a little amplitude [4].

activity.

**Figure 2.**

**91**

#### **2. Electroencephogram - EEG**

The brain processes any information by means of neurons that use electrical and chemical signals to communicate by releasing and receiving neurotransmitters. The neural activity in the human brain is an electrical change. The brain generates electrical signals throughout the day for various activities. Studying these electrical signals is vital to understanding the neurophysiological behaviour of the brain [4]. A number of techniques are used to study brain activities. Functional magnetic resonance imaging (fMRI), Functional Near-Infrared Spectroscopy (firs), and Electroencephalography (EEG) recordings widely used techniques. The fMRI measures brain activity by scanning the blood flow. The fNIRS measures brain activity by measuring hemodynamic response in the brain through detecting the temporal changes in infrared light source. The EEG measures the electrical activity of the brain by electrodes placed on the scalp. Comparing to the other two, EEG measures brain activity directly, with high temporal resolution and most accessible and portable for the research. The fMRI has a high spatial resolution but very expensive, therefore it is mostly limited to medical diagnosis and treatments.

#### **2.1 The EEG measure**

The EEG signal is measured by placing multiple electrodes on the scalp that measure the current flow from neurons. A setup for EEG recording is shown in **Figure 1**. Each neuron (brain cell), when activated, it produced an electrical and magnetic field around the scalp. Since there are 100 billion neurons in the brain, when an electrode is placed on the scalp, it measures the accumulative activity of many neurons together. The complex structure of the brain attenuates the electrical signals, therefore an electrode can record the brain activity, only when a large number of neurons generate enough potential. The EEG devices amplify the recorded signal to store and process it [4].

#### **Figure 1.**

*EEG recording setup: (a) a wireless device Emotiv Epoch mounted on a subject, transmitting EEG signal to a computer. (b) Electrode positions as 10–20 system, source: https://www.emotiv.com/.*

#### *Wavelets for EEG Analysis DOI: http://dx.doi.org/10.5772/intechopen.94398*

The placement of electrodes has been standardised with the specific anatomical landmarks with a distance between electrodes as 10% or 20% of total length. This placement is called the 10–20 system, as shown in **Figure 1b**. The number of electrodes used for EEG recording varies, depending on the device. One of the low spatial resolutions can be of a 14-channel EEG device and high spatial resolution with 128 or 256 channels. The name of the electrode position is labelled as character followed by a number to identify the part of the brain. The characters are *Fop* for pre-frontal, *F* for frontal, *P* for parietal,*T* for temporal, *O* for occipital, and *C* for central lobe of the brain. A few in between two landmarks are named with two characters, such as *AF*, between *Fp* and *F* and *FC*, between *F* and *C* [4]. An example of 14-channel is shown in **Figure 1b**.

The raw recording of EEG signal in the time-domain is complex to interpret. Similar to many other signals, frequency domain analysis has been widely used. The decades of work on EEG studies have identified five major frequency bands for EEG signals and established the correlation between behaviour and neural activity of a certain part of the brain. The frequency bands widely used are; Delta (0*:*1 4 Hz or 0*:*5 4 Hz), Theta (4 8 Hz), Alpha (8 14 Hz), Beta (14 30 Hz), Gamma (30 63 Hz). A raw EEG signal from a channel and corresponding signal in different bands are shown in **Figure 2**. It can be observed that low frequency, Delta activity, is the dominating wave in raw EEG and high-frequency Gamma is almost noise like with a little amplitude [4].

Due to multichannel signals, it is usually viewed as topographical brain activity (heatmap over an image of head) under different frequency bands. An example of 5 seconds EEG recording with a 14-channel device is shown in **Figure 3**. The first second of all the channels are used to compute the energy distribution over brain regions. In **Figure 3**, the top left shows the raw EEG signal and corresponding brain activity, which shows a high activity in the frontal lobe of the brain. However, under different frequency bands, the different part of the brain shows higher activity.

The frequency bands; Delta, Theta, Alpha, Beta, and Gamma, are also called brain rhythms. Brain rhythms have been investigated over decades and a few characteristic behaviour of these brain rhythms have been established [4].

#### **Figure 2.**

*The signal channel raw EEG signal and corresponding frequency bands: Delta (*0*:*1 4 *Hz), theta (*4 8 *Hz), alpha (*8 14 *Hz), Beta (*14 30 *Hz), gamma (*30 63 *Hz).*

#### **Figure 3.**

*Topographical view of brain activity: Energy distribution of EEG recording over different brain regions under five frequency bands and raw signal.*


the physical movement of the person's body. As shown in **Figure 4a**, motion artefacts produce a sudden high valued spike in all the channels of EEG recording. The muscular artefacts, shown in **Figure 4b** are caused by any muscular contraction such as grinding the teeth. It produces high-frequency bursts in EEG recording as circled in the **Figure 4b**. The cardiac artefacts, shown in **Figure 4c**, are caused by the electrical activities of the heart. They appear as a weak form of QRS wave of heart and most likely to be appeared in the channels near to ears (temporal lobe), though it can be sometimes present in channels from the frontal lobe [7]. The ocular artefacts are slow oscillating waves appear on the frontal lobe, caused by the eye movements or closed eyes, as circled in the **Figure 4d**. The higher magnitude of the artefacts corrupts the EEG recording and leads to misinterpretations of the results and analysis [5]. Even though there are many algorithms to remove the artefacts, but there is always a possibility of losing the cerebral information while removing

*Common type of artefacts in EEG. Corresponding artefacts are circled in the figure.*

Most of the real-life signals are non-stationary in behaviour, which means their

properties change over time. To localise the events of interest, time-frequency analysis is widely used. The conventional way of time-frequency analysis is the Short-Time Fourier Transform (STFT), where Fourier transform of the signal is taken over short-windows, resulting spectrogram plot. STFT has limitations on resolutions, due to Heisenberg's uncertainty principle, e.g. improvement in time resolution results in poorer frequency resolution and vice-versa. The alternative to STFT is wavelet transform, which exploits the property of low-frequency signals

the artefacts.

**93**

**Figure 4.**

*Wavelets for EEG Analysis*

*DOI: http://dx.doi.org/10.5772/intechopen.94398*

**3. Wavelet analysis**


#### **2.2 Artefacts in EEG**

While recording, EEG signals are frequently contaminated with various artefacts. The most common types of artefacts are motion, muscular, ocular, and cardiac artefacts [4], which are shown in **Figure 4**. The motion artefacts are caused by

**Figure 4.** *Common type of artefacts in EEG. Corresponding artefacts are circled in the figure.*

the physical movement of the person's body. As shown in **Figure 4a**, motion artefacts produce a sudden high valued spike in all the channels of EEG recording. The muscular artefacts, shown in **Figure 4b** are caused by any muscular contraction such as grinding the teeth. It produces high-frequency bursts in EEG recording as circled in the **Figure 4b**. The cardiac artefacts, shown in **Figure 4c**, are caused by the electrical activities of the heart. They appear as a weak form of QRS wave of heart and most likely to be appeared in the channels near to ears (temporal lobe), though it can be sometimes present in channels from the frontal lobe [7]. The ocular artefacts are slow oscillating waves appear on the frontal lobe, caused by the eye movements or closed eyes, as circled in the **Figure 4d**. The higher magnitude of the artefacts corrupts the EEG recording and leads to misinterpretations of the results and analysis [5]. Even though there are many algorithms to remove the artefacts, but there is always a possibility of losing the cerebral information while removing the artefacts.

## **3. Wavelet analysis**

Most of the real-life signals are non-stationary in behaviour, which means their properties change over time. To localise the events of interest, time-frequency analysis is widely used. The conventional way of time-frequency analysis is the Short-Time Fourier Transform (STFT), where Fourier transform of the signal is taken over short-windows, resulting spectrogram plot. STFT has limitations on resolutions, due to Heisenberg's uncertainty principle, e.g. improvement in time resolution results in poorer frequency resolution and vice-versa. The alternative to STFT is wavelet transform, which exploits the property of low-frequency signals

Eq. (2), where *ψ* <sup>∗</sup>

*Wavelets for EEG Analysis*

*<sup>a</sup>*,*<sup>b</sup>*ð Þ*t* is a complex conjugate of scaled and shifted version of mother

�*jωt*

*Xcwt*ð Þ¼ *f X f* ð Þ*ψ<sup>a</sup>* ∗ ð Þ*f* (4)

*dt* (1)

*<sup>a</sup>*,*<sup>b</sup>*ð Þ*t dt:* (2)

*<sup>a</sup>* ð Þ*t* (3)

�2*πjf* <sup>0</sup>ð Þ *<sup>t</sup>*�*t*<sup>0</sup> (5)

*x t*ð Þ*w*ð Þ *τ* � *t e*

*x t*ð Þ*<sup>ψ</sup>* <sup>∗</sup>

wavelet *ψ*ð Þ*t* , *a* is scaling parameter and *b* is shifting parameter.

ð<sup>∞</sup> �∞

> ð<sup>∞</sup> �∞

*Xcwt*ð Þ¼ *<sup>a</sup> x t*ð Þ⊛*<sup>ψ</sup>* <sup>∗</sup>

parameters to control the oscillation and frequency band to be captured.

*ψ*ðÞ¼ *t e*

*π=a* p *e*

*<sup>ψ</sup>*ð Þ¼ *<sup>f</sup>* ffiffiffiffiffiffiffiffi

where *<sup>a</sup>* <sup>¼</sup> *<sup>f</sup>* <sup>0</sup>

**Figure 6.**

**95**

*Continues wavelet functions.*

*Q* � �<sup>2</sup> .

**Gaussian Wavelet:** A time-domain wavelet it derived from a Gaussian function centered at *t*<sup>0</sup> and modulated by a complex exponential function with frequency *f* <sup>0</sup> [8].

�2*πjft*<sup>0</sup> � *<sup>e</sup>*

� *e*

�*π*<sup>2</sup> *<sup>f</sup>*� *<sup>f</sup>* ð Þ<sup>0</sup> <sup>2</sup> � �*=<sup>a</sup>* � � (6)

�*a t*ð Þ �*t*<sup>0</sup> <sup>2</sup>

CWT operation from Eq. (2) can be seen as convolution of input signal *x t*ð Þ with

where *X f* ð Þ is Fourier transform of *x t*ð Þ, and the same for others. For computations with discrete signal *x n*ð Þ, both equations; 3 and 4 can be used with discrete operations, e.g. convolution and multiplication and discrete wavelet function *ψ*ð Þ *n* , while for Fourier Transform, Fast Fourier Transform (FFT) is used. For computational efficiency, however, Eq. (4) is widely used, by multiplying FFT of *x n*ð Þ and FFT of scaled and discrete version *ψ*ð Þ *n* . Even though, for discrete signal *x n*ð Þ, discrete wavelet function *ψ*ð Þ *n* is used, however, the conventional definitions of wavelet functions for CWT are defined in continues time-domain. A set timedomain and frequency-domain equations for six complex wavelet functions are defined below. **Figure 6** shows all the six wavelet functions, with their real and imaginary part. All six functions are similar, in terms of smoothness and being derived from exponential and sinusoidal functions, however, they have different

*Xstft*ð Þ¼ *τ*,*ω*

scaled version of wavelet function *ψ*ð Þ*t* .

*DOI: http://dx.doi.org/10.5772/intechopen.94398*

*Xcwt*ð Þ¼ *a*, *b*

#### **Figure 5.**

*4-level decomposition tree for (a) discrete wavelet transform (DWT), (b) wavelet packet decomposition (WPD).*

being widespread over time and high-frequency bursts occurring on short intervals. Wavelet transform uses the variable size of windows with a wavelet function.

Wavelet analysis is usually applied in two ways, Continuous Wavelet Transform (CWT) and Discrete Wavelet Transform (DWT). CWT uses a wavelet function *ψ*ð Þ*t* and produces a scalogram, similar to a spectrogram for time-frequency analysis. However, DWT decomposes a signal into two (1) average or lowpass signal, using scaling function and (2) difference or highpass signal using wavelet function. The conventional DWT recursively decomposes lowpass signal with the same scaling and wavelet functions to the desired level of decomposition. A decomposition tree for DWT is shown in **Figure 5a**. For some applications, it is useful to decompose highpass signal at each level too, this is called Wavelet Packet Decomposition (WPD). A tree for WPD is shown in **Figure 5b**.

As shown in **Figure 5**, block LP is a lowpass filter *h n*ð Þ and block HP is a highpass filter *g n*ð Þ, both followed by downsampler (↓2). The coefficients of lowpass filter are corresponds to scalling function *ϕ*ð Þ *n* and coefficients of highpass filter are corresponds to wavelet funciton *ψ*ð Þ *n* . A *N*-level DWT decomposes a signal *x n*ð Þ into set of signals: [*X<sup>N</sup> <sup>L</sup>* , *X<sup>N</sup> H*,*X<sup>N</sup>*�<sup>1</sup> *<sup>H</sup>* , … , *X*<sup>1</sup> *H*], each with different dimensions. However, a *<sup>N</sup>*-level WPD decomposes a signal *x n*ð Þ into set of packets: [*X*<sup>1</sup> *N*,*X*<sup>2</sup> *<sup>N</sup>*, … ,*X*<sup>2</sup>*<sup>N</sup> <sup>N</sup>* ], each with same dimensions.

#### **4. Time-frequency analysis of EEG using CWT**

As discussed, a conventional way to time-frequency analysis is STFT, however, using CWT with different wavelet functions can enrich the analysis with more details. In this section, we will show, how a continuous wavelet function (*ψ*ð Þ*t* ), can be applied to a discrete EEG signal *x n*ð Þ, and compare the spectrogram with scalogram of different wavelet functions.

A spectrogram is obtained using STFT, which is Fourier Transform computed for a short windows. STFT *Xstft*ð Þ *τ*,*ω* of signal *x t*ð Þ as given as Eq. (1), where *w t*ð Þ is a window function. On the other hand, CWT *Xcwt*ð Þ *a*, *b* of a signal *x t*ð Þ is given by

Eq. (2), where *ψ* <sup>∗</sup> *<sup>a</sup>*,*<sup>b</sup>*ð Þ*t* is a complex conjugate of scaled and shifted version of mother wavelet *ψ*ð Þ*t* , *a* is scaling parameter and *b* is shifting parameter.

$$X\_{\rm tf}(\tau, w) = \int\_{-\infty}^{\infty} \varkappa(t)w(\tau - t)e^{-j\alpha t}dt\tag{1}$$

$$X\_{cut}(a,b) = \int\_{-\infty}^{\infty} \varkappa(t)\nu\_{a,b}^\*(t)dt. \tag{2}$$

CWT operation from Eq. (2) can be seen as convolution of input signal *x t*ð Þ with scaled version of wavelet function *ψ*ð Þ*t* .

$$X\_{cwt}(a) = \varkappa(t) \otimes \wp\_a^\*(t) \tag{3}$$

$$X\_{\rm cut}(f) = X(f)\varphi\_a \* (f) \tag{4}$$

where *X f* ð Þ is Fourier transform of *x t*ð Þ, and the same for others. For computations with discrete signal *x n*ð Þ, both equations; 3 and 4 can be used with discrete operations, e.g. convolution and multiplication and discrete wavelet function *ψ*ð Þ *n* , while for Fourier Transform, Fast Fourier Transform (FFT) is used. For computational efficiency, however, Eq. (4) is widely used, by multiplying FFT of *x n*ð Þ and FFT of scaled and discrete version *ψ*ð Þ *n* . Even though, for discrete signal *x n*ð Þ, discrete wavelet function *ψ*ð Þ *n* is used, however, the conventional definitions of wavelet functions for CWT are defined in continues time-domain. A set timedomain and frequency-domain equations for six complex wavelet functions are defined below. **Figure 6** shows all the six wavelet functions, with their real and imaginary part. All six functions are similar, in terms of smoothness and being derived from exponential and sinusoidal functions, however, they have different parameters to control the oscillation and frequency band to be captured.

**Gaussian Wavelet:** A time-domain wavelet it derived from a Gaussian function centered at *t*<sup>0</sup> and modulated by a complex exponential function with frequency *f* <sup>0</sup> [8].

$$\boldsymbol{\Psi}(t) = \boldsymbol{e}^{-a(t-t\_0)^2} \cdot \boldsymbol{e}^{-2\pi \circ \boldsymbol{f}\_0(t-t\_0)} \tag{5}$$

$$\psi(f) = \sqrt{\pi/a} \left( e^{-2\pi j \mathbf{f}\_0} \cdot e^{-\pi^2 \left( \left( \begin{array}{c} f - f\_0 \end{array} \right)^2 \right)/a} \right) \tag{6}$$

**Figure 6.** *Continues wavelet functions.*

**Gabor Wavelet:** Gabor wavelet is perhaps the most widely used function for various applications. It is essentially the same as Gaussian wavelet function, with simplified equations, as follow [8, 9];

$$\varphi(t) = e^{-(t-t\_0)^2/a^2} e^{-j\mathbf{f}\_0(t-t\_0)}\tag{7}$$

$$\Psi(f) = \mathbf{e}^{-\left(\left(\begin{array}{c} f - f\_0 \end{array}\right)a\right)^2} \mathbf{e}^{-\left(\begin{array}{c} f - f\_0 \end{array}\right)} \tag{8}$$

where *a* is oscillation rate and *f* <sup>0</sup> is center frequency, *t*<sup>0</sup> is centred time.

**Morlet Wavelet:** Morlet is considered very similar to Gabor wavelet and Gabor filters. The oscillation of Morlet wavelet is controlled by *σ*. A higher value of *σ* results in higher oscillation [10].

$$\boldsymbol{\Psi}(t) = \mathbf{C}\_{\sigma} \pi^{-0.25} e^{-0.5t^2} \left( e^{i\sigma t} - K\_{\sigma} \right) \tag{9}$$

$$\Psi(w) = \mathbf{C}\_{\sigma} \pi^{-0.25} \left( e^{-0.5(\sigma - w)^2} - K\_{\sigma} \mathbf{e}^{-0.5w^2} \right) \tag{10}$$

where *<sup>C</sup><sup>σ</sup>* <sup>¼</sup> <sup>1</sup> <sup>þ</sup> *<sup>e</sup>*�*σ*<sup>2</sup> � <sup>2</sup>*e*�<sup>3</sup> 4*σ*<sup>2</sup> � ��0*:*<sup>5</sup> , *<sup>K</sup><sup>σ</sup>* <sup>¼</sup> *<sup>e</sup>*�0*:*5*σ*<sup>2</sup> , and *w* ¼ 2*πf*.

**Poisson Wavelet:** Poisson wavelet is defined by positive integers (*n*), unlike other, and associated with Poisson probability distribution [11, 12].

$$\psi(t) = \frac{1}{2\pi} (\mathbf{1} - jt)^{-(\mathbf{n}+\mathbf{1})} \tag{11}$$

$$\psi(w) = \frac{1}{\Gamma n + 1} w^n e^{-w} u(w) \tag{12}$$

however, using CWT with different Wavelet functions, much richer information can be observed. Since, we observed that in the formulation of wavelet functions that they are similar to the underlying principle, we could also observe the similarities across different scalograms. Specifically, spectrogram using Complex Shannon and Complex Mexican hat wavelet are much similar. Interestingly, Morlate and Poisson wavelet functions are able to produce a better resolution towards lower

*Scalogram and spectrogram of a segment of signal channel EEG signal with six wavelet functions and STFT.*

*Figure obtained using spkit python library - https://spkit.github.iohttps://spkit.github.io*

Artefacts in EEG recording is a primary obstacle that all researchers have to deal with. There are decades of research work in literature to remove these artefacts [15, 16]. A range of methods have been proposed to remove the artefacts, starts with a statistical with interpolation method [17] and regression method [18]. The most commonly used approaches are based on Blind Source Separation (BSS) using Independent Component Analysis (ICA) [19, 20]. ICA based approach have been widely explored with statistical measures [21–24], and variant of ICA as FastICA, InfoMax, and Extended InfoMax [25–27]. Wavelet-based approaches are well suited for time-localised short events, as opposed to ICA. This property has been exploited to remove artefacts from single-channel EEG. In contrast to a single channel, wavelet has also been used for multi-channel EEG [28] and in combination with ICA [29–34], in which identified artifactual component is cleaned with wavelet rather than removed. The ICA-based approaches can only be applied to multichannel EEG and need an expert to select artifactual component, which has been

**5. Artefact removal algorithms using DWT and WPD**

frequencies.

**97**

**Figure 7.**

*Wavelets for EEG Analysis*

*DOI: http://dx.doi.org/10.5772/intechopen.94398*

where *w* ¼ 2*πf* and *u w*ð Þ is a unit step function, e.g. *u w*ð Þ¼ 1 if *w* > ¼ 0, 0 else.

**Complex Mexican hat wavelet:** Complex Mexican hat wavelet is derived from the conventional Mexican hat wavelet. It is a low-oscillation wavelet which is modulated by a complex exponential function with frequency *f* <sup>0</sup> [13].

$$\psi(t) = \frac{2}{\sqrt{3}} \pi^{-\frac{1}{4}} \left( \sqrt{\pi} (1 - t^2) e^{-\frac{\mathbf{i}^2}{2}} - \left( \sqrt{2} \dot{t} t + \sqrt{\pi} \text{erf} \left[ \frac{\dot{j}}{\sqrt{2}} t \right] (1 - t^2) e^{-\frac{\mathbf{i}^2}{2}} \right) \right) e^{-2 \mathbf{i} \mathbf{j}'\_0 t} \tag{13}$$

$$\psi(w) = 2\sqrt{\frac{2}{3}}\pi^{-1/4}(w - w\_0)^2 e^{-\frac{1}{2}(w - w\_0)^2} \quad \text{if } w \ge 0, \quad \mathbf{0} \text{ else} \tag{14}$$

where *w* ¼ 2*πf* and *w*<sup>0</sup> ¼ 2*π f* <sup>0</sup>.

**Complex Shannon wavelet:** Complex Shannon wavelet is the most simplified wavelet function, exploiting Sinc function by modulating with sinusoidal, which results in an ideal bandpass filter. Real Shannon wavelet is modulated by only a cos function [14].

$$\psi(t) = \text{Sinc}(t/2) \cdot e^{-2j\pi f\_0 t} \tag{15}$$

$$\psi(w) = \prod \left(\frac{w - w\_0}{\pi}\right) \tag{16}$$

where <sup>Q</sup>ð Þ¼ *<sup>x</sup>* 1 if *<sup>x</sup>*≤0*:*5, 0 else and *<sup>w</sup>* <sup>¼</sup> <sup>2</sup>*π<sup>f</sup>* and *<sup>w</sup>*<sup>0</sup> <sup>¼</sup> <sup>2</sup>*<sup>π</sup> <sup>f</sup>* <sup>0</sup>.

An example of using the above six wavelet functions for a small single-channel EEG segment is shown in **Figure 7**, along with spectrogram. It can be observed, spectrogram highlights a few events in signal (sharp peaks and lowpass wave),

#### **Figure 7.**

*Scalogram and spectrogram of a segment of signal channel EEG signal with six wavelet functions and STFT. Figure obtained using spkit python library - https://spkit.github.iohttps://spkit.github.io*

however, using CWT with different Wavelet functions, much richer information can be observed. Since, we observed that in the formulation of wavelet functions that they are similar to the underlying principle, we could also observe the similarities across different scalograms. Specifically, spectrogram using Complex Shannon and Complex Mexican hat wavelet are much similar. Interestingly, Morlate and Poisson wavelet functions are able to produce a better resolution towards lower frequencies.

#### **5. Artefact removal algorithms using DWT and WPD**

Artefacts in EEG recording is a primary obstacle that all researchers have to deal with. There are decades of research work in literature to remove these artefacts [15, 16]. A range of methods have been proposed to remove the artefacts, starts with a statistical with interpolation method [17] and regression method [18]. The most commonly used approaches are based on Blind Source Separation (BSS) using Independent Component Analysis (ICA) [19, 20]. ICA based approach have been widely explored with statistical measures [21–24], and variant of ICA as FastICA, InfoMax, and Extended InfoMax [25–27]. Wavelet-based approaches are well suited for time-localised short events, as opposed to ICA. This property has been exploited to remove artefacts from single-channel EEG. In contrast to a single channel, wavelet has also been used for multi-channel EEG [28] and in combination with ICA [29–34], in which identified artifactual component is cleaned with wavelet rather than removed. The ICA-based approaches can only be applied to multichannel EEG and need an expert to select artifactual component, which has been

automated with heuristics [21, 35, 36]. In contrast, most wavelet-based algorithms remove artefacts from each channel individually.

The key idea of wavelet-based artefact removal algorithms is to apply DWT on single-channel EEG signal *x n*ð Þ and remove (set to zero) wavelet coefficients that fall above some statistical threshold and reconstruct signal back using inverse-DWT (IDWT) *x n* ^ð Þ [37–39]. With linear property of electrical activities, recorded EEG signal is considered as *x n*ð Þ¼ *s n*ð Þþ *v n*ð Þ, where *s n*ð Þ is source signal of brain activity and *v n*ð Þ is artifactual components. The two most widely used threshold formulations are used with wavelet.

**Global Threshold:** Also known as the optimal threshold for removing whitegaussian noise from any signal [40] using DWT. Global Threshold (*TG*) is defined as;

$$T\_G = \hat{\sigma} \sqrt{2 \log \text{N}} \quad \text{for } \hat{\sigma} = \frac{median(|w|)}{0.6745} \tag{17}$$

The three filtering modes in ATAR algorithm are namely; Elimination *λe*ð Þ� , Linear

*w* if ∣*w*∣ ≤*θα* 0 else �

*w* if ∣*w*∣ ≤*θα*

*θβ* � *θα*

0 else

where *w* is a wavelet coefficient, *sgn* ð Þ� is the signum function, and *θα* >*θγ* . A default setting for *θγ* and *θβ* is; *θγ* ¼ 0*:*8*θα* and *θβ* ¼ 2*θα*. The characteristics of wavelet filtering mode are shown in **Figure 9**. From **Figure 9**, it can be seen that Elimination mode of filtering is the same as conventional filtering, however, Linear attenuation and soft-thresholding modes do not remove the wavelet coefficient, rather suppress them softly. Another distinction ATAR algorithm has over others is the threshold selection. The threshold *θα* is computed from Interquartile Range (IQR) of wavelet coefficients using Eq. (22), which is robust against outliers, as oppose to *STD*.

where *r* is Interquartile Range (IQR) of coefficients i.e. *r* ¼ *IQR w*ð Þ and *k*<sup>1</sup> and *k*<sup>2</sup>

**Figure 10** shows a visual comparative analysis of wavelet-based approaches (i.e. Global threshold, STD threshold, and ATAR algorithm) and ICA based approaches (FastICA, InfoMax, and Extended-InfoMax) to remove the artefacts. It is visually apparent that wavelet-based approaches are better than ICA-based approaches.

*Wavelet filtering modes for ATAR algorithm. For θα* ¼ 200, *θγ* ¼ 0*:*8*θα* ¼ 160, *θβ* ¼ 2*θα* ¼ 400 *[41].*

� � if *θα* <sup>&</sup>lt; <sup>∣</sup>*w*∣ ≤ *θβ*

where*<sup>α</sup>* ¼ � <sup>1</sup>

where *<sup>f</sup> <sup>β</sup>*ð Þ¼ *<sup>r</sup> <sup>k</sup>*<sup>2</sup> *exp* �*<sup>β</sup>* <sup>100</sup>

*θγ*

log *θα* � *θγ θα* þ *θγ*

*k*2 *r* 2 � � (22)

(19)

(20)

(21)

attenuation *λa*ð Þ� , and soft thresholding *λs*ð Þ� , which are defined below;

*sgn w*ð Þ*θα* <sup>1</sup> � <sup>∣</sup>*w*<sup>∣</sup> � *θα*

*λe*ð Þ¼ *w*

*λa*ð Þ¼ *w*

*DOI: http://dx.doi.org/10.5772/intechopen.94398*

8 < :

<sup>1</sup> � *<sup>e</sup>*�*α<sup>w</sup>*

*θα* <sup>¼</sup> *<sup>f</sup> <sup>β</sup>*ð Þ*<sup>r</sup>* if *<sup>f</sup> <sup>β</sup>*ð Þ*<sup>r</sup>* <sup>≥</sup> *<sup>k</sup>*<sup>1</sup> *<sup>k</sup>*<sup>1</sup> else �

are lower and upper bounds on filtering.

*λs*ð Þ¼ *w*

*Wavelets for EEG Analysis*

**Figure 9.**

**99**

8 >><

>>:

*w* if ∣*w*∣<*θγ*

<sup>1</sup> <sup>þ</sup> *<sup>e</sup>*�*α<sup>w</sup> θα* otherwise

where *N* is the length of signal and for wavelet coefficients w, *σ*^ is the estimate of noise variance. To denoise a signal, wavelet coefficients with magnitude below the threshold *TG* are set to zero and reconstruct the signal back. However, for recorded EEG signal *x n*ð Þ, source signal *s n*ð Þ is considered to be zero mean and normally distributed, i.g. *s n*ð Þ�N ð Þ 0, *σ* [4]. For which any wavelet coefficients with a magnitude above the threshold *TG* is considered to be artifactual and removed (set to zero).

**Standard Deviation (STD) Threshold:** As name suggests, STD threshold is based on Standard Deviation (*STD*) of wavelet coefficients [39].

$$T\_{\rm STD} = \mathbf{1.5} \times \text{STD}(w) \tag{18}$$

**ATAR algorithm:** A recent study has shown that approaches based on above thresholds are very aggressive, since, statistically, a few wavelet coefficients of any signal will always fall above these thresholds [14]. In contrast, an Automatic and Tunable Artefact Removal (ATAR) Algorithm based on WPD was proposed [41], which provides three different wavelet filtering modes and a tunable parameter. As shown a block diagram of ATAR algorithm in **Figure 8**, a single channel EEG signal *x n*ð Þ is first split into smaller windows *xw*ð Þ *n* , apply *L*-level WPD to get wavelet coefficients *w* ¼ *XL*ð Þ¼ *k WPD x*ð Þ *<sup>w</sup>*ð Þ *n* , then wavelet coefficients are filtered using wavelet filtering *w*^ ¼ *λ*ð Þ *w* to reconstruct signal *x n* ^ð Þ from corrected windows *x*^*w*ð Þ *n* .

**Figure 8.** *A block diagram of ATAR algorithm [41].*

The three filtering modes in ATAR algorithm are namely; Elimination *λe*ð Þ� , Linear attenuation *λa*ð Þ� , and soft thresholding *λs*ð Þ� , which are defined below;

$$\lambda\_{\mathfrak{e}}(w) = \begin{cases} w & \text{if } |w| \le \theta\_a \\ 0 & \text{else} \end{cases} \tag{19}$$

$$\lambda\_a(w) = \begin{cases} w & \text{if } |w| \le \theta\_a \\ \text{sgn}\left(w\right)\theta\_a\left(1 - \frac{|w| - \theta\_a}{\theta\_\beta - \theta\_a}\right) & \text{if } \theta\_a < |w| \le \theta\_\beta \\ 0 & \text{else} \end{cases} \tag{20}$$

$$\lambda\_t(w) = \begin{cases} w & \text{if } |w| < \theta\_\gamma \\ 1 - e^{-aw} \theta\_a & \text{otherwise} \end{cases} \quad \text{where} \\ a = -\frac{1}{\theta\_\gamma} \log \frac{\theta\_a - \theta\_\gamma}{\theta\_a + \theta\_\gamma} \tag{21}$$

where *w* is a wavelet coefficient, *sgn* ð Þ� is the signum function, and *θα* >*θγ* . A default setting for *θγ* and *θβ* is; *θγ* ¼ 0*:*8*θα* and *θβ* ¼ 2*θα*. The characteristics of wavelet filtering mode are shown in **Figure 9**. From **Figure 9**, it can be seen that Elimination mode of filtering is the same as conventional filtering, however, Linear attenuation and soft-thresholding modes do not remove the wavelet coefficient, rather suppress them softly. Another distinction ATAR algorithm has over others is the threshold selection. The threshold *θα* is computed from Interquartile Range (IQR) of wavelet coefficients using Eq. (22), which is robust against outliers, as oppose to *STD*.

$$\theta\_a = \begin{cases} f\_\beta(r) & \text{if } f\_\beta(r) \ge k\_1 \\ k\_1 & \text{else} \end{cases} \quad \text{where} \\ f\_\beta(r) = k\_2 \exp\left(-\beta \frac{100}{k\_2} \frac{r}{2}\right) \tag{22}$$

where *r* is Interquartile Range (IQR) of coefficients i.e. *r* ¼ *IQR w*ð Þ and *k*<sup>1</sup> and *k*<sup>2</sup> are lower and upper bounds on filtering.

**Figure 10** shows a visual comparative analysis of wavelet-based approaches (i.e. Global threshold, STD threshold, and ATAR algorithm) and ICA based approaches (FastICA, InfoMax, and Extended-InfoMax) to remove the artefacts. It is visually apparent that wavelet-based approaches are better than ICA-based approaches.

**Figure 9.** *Wavelet filtering modes for ATAR algorithm. For θα* ¼ 200, *θγ* ¼ 0*:*8*θα* ¼ 160, *θβ* ¼ 2*θα* ¼ 400 *[41].*

**Figure 10.** *Comparison of artefact removal approaches from [41].*

Among wavelet-based approaches, using ATAR gives much control over Global and STD based threshold selection. Other quantitative analyses of the above-mentioned approaches are discussed in the article [41], which also demonstrate the effect of tuning parameter and filtering modes on different predictive tasks of EEG signal. The formulation of relationship, algorithmic implementation details, and comparative results are given in article [41].

#### **6. Conclusions**

This chapter presents the overview of Wavelet for EEG analysis. The first chapter introduces EEG signal, commonly used features for predictive analysis, and artefacts that often contaminate EEG signal. Then chapter discusses the Wavelet analysis approaches, namely CWT, DWT, and WPD. The richness of CWT over STFT for time-frequency analysis using various wavelet functions is demonstrated. Finally, the artefact removal algorithms based on wavelet and ICA are discussed. The comparative analysis present in the chapter shows that the wavelet-based approach outperforms ICA based approach. Specifically, a recent algorithm (ATAR) allows controlling the removal or suppression of assumed artifactual components in the signal, which can be tuned to improve the performance of any predictive tasks. The techniques presented in this chapter show how wavelet can be used for EEG studies to extract rich information and removing the artefacts. The comparative analysis shows wavelet based approaches are well suited for EEG signal processing. Further, similar approaches can be used with other biomedical signals such as electrocardiogram (ECG or EKG), Electromyography (EMG) etc.

**Author details**

*Wavelets for EEG Analysis*

*DOI: http://dx.doi.org/10.5772/intechopen.94398*

1 University of East London, London, United Kingdom

provided the original work is properly cited.

2 Queen Mary University of London, London, United Kingdom

\*Address all correspondence to: n.bajaj@uel.ac.uk; n.bajaj@qmul.ac.uk

© 2020 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/ by/3.0), which permits unrestricted use, distribution, and reproduction in any medium,

Nikesh Bajaj1,2

**101**

*Wavelets for EEG Analysis DOI: http://dx.doi.org/10.5772/intechopen.94398*

## **Author details**

Nikesh Bajaj1,2

1 University of East London, London, United Kingdom

2 Queen Mary University of London, London, United Kingdom

\*Address all correspondence to: n.bajaj@uel.ac.uk; n.bajaj@qmul.ac.uk

© 2020 The Author(s). Licensee IntechOpen. This chapter is distributed under the terms of the Creative Commons Attribution License (http://creativecommons.org/licenses/ by/3.0), which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

#### **References**

[1] D. Petit, J.-F. Gagnon, M. L. Fantini, L. Ferini-Strambi, J. Montplaisir, Sleep and quantitative eeg in neurodegenerative disorders, Journal of psychosomatic research 56 (2004) 487–496

[2] M. L. Perlis, M. T. Smith, P. J. Andrews, H. Orff, D. E. Giles, Beta/ gamma eeg activity in patients with primary and secondary insomnia and good sleeper controls, Sleep 24 (2001) 110–117.

[3] A. R. Clarke, R. J. Barry, R. McCarthy, M. Selikowitz, Eeg analysis in attentiondeficit/hyperactivity disorder: a comparative study of two subtypes, Psychiatry research 81 (1998) 19–29.

[4] S. Sanei, J. A. Chambers, EEG signal processing, John Wiley & Sons, 2013.

[5] D. Hagemann, E. Naumann, The effects of ocular artifacts on (lateralized) broadband power in the eeg, Clinical Neurophysiology 112 (2001) 215–231.

[6] H. Olkkonen, Discrete Wavelet Transforms: Biomedical Applications, BoD–Books on Demand, 2011.

[7] G. Dirlich, T. Dietl, L. Vogl, F. Strian, Topography and morphology of heart action-related eeg potentials, Electroencephalography and Clinical Neurophysiology/Evoked Potentials Section 108 (1998) 299–305.

[8] T. S. Lee, Image representation using 2d gabor wavelets, IEEE Transactions on pattern analysis and machine intelligence 18 (1996) 959–971.

[9] Gabor wavelet, https://en.wikipedia. org/wiki/Gabor wavelet, 2020.

[10] Morlate wavelet, https://en.wikiped ia.org/wiki/Morlet wavelet, 2020.

[11] K. A. Kosanovich, A. R. Moser, M. J. Piovoso, A new family of wavelets: the

poisson wavelet transform, Computers & chemical engineering 21 (1997) 601–620.

algorithm, Medical and Biological Engineering and Computing 43 (2005)

*DOI: http://dx.doi.org/10.5772/intechopen.94398*

*Wavelets for EEG Analysis*

wavelet analysis, kurtosis and renyi's entropy for artifact detection, in: 2007

Information Acquisition, IEEE, pp. 195–

[29] N. P. Castellanos, V. A. Makarov, Recovering eeg brain signals: artifact suppression with wavelet enhanced independent component analysis, Journal of neuroscience methods 158

[30] M. T. Akhtar, W. Mitsuhashi, C. J. James, Employing spatially constrained ica and wavelet denoising, for automatic removal of artifacts from multichannel eeg data, Signal Processing 92 (2012)

[31] H. Ghandeharion, A. Erfanian, A fully automatic ocular artifact

by wavelet analysis, Medical

[33] R. Mahajan, B. I. Morshed, Unsupervised eye blink artifact denoising of eeg data with modified multiscale sample entropy, kurtosis, and wavelet-ica, IEEE journal of Biomedical and Health Informatics 19 (2014) 158–

[34] N. Al-Qazzaz, S. Hamid Bin Mohd Ali, S. Ahmad, M. Islam, J. Escudero, Automatic artifact removal in eeg of normal and demented individuals using ica–wt during working memory tasks,

[35] W. Kong, Z. Zhou, S. Hu, J. Zhang, F. Babiloni, G. Dai, Automatic and

Sensors 17 (2017) 1326.

suppression from eeg data using higher order statistics: Improved performance

engineering & physics 32 (2010) 720–

[32] N. K. Al-Qazzaz, S. H. B. M. Ali, S. A. Ahmad, M. S. Islam, J. Escudero, Discrimination of stroke-related mild cognitive impairment and vascular dementia using eeg signal analysis, Medical & biological engineering & computing 56 (2018) 137–157.

International Conference on

200.

(2006) 300–312.

401–416.

729.

165.

[21] H. Nolan, R. Whelan, R. Reilly, FASTER: fully automated statistical thresholding for EEG artifact rejection, Journal of neuroscience methods 192

[22] R. R. Vázquez, H. Velez-Perez, R. Ranta, V. L. Dorr, D. Maquin, L. Maillard, Blind source separation, wavelet denoising and discriminant analysis for eeg artefacts and noise cancelling, Biomedical Signal Processing

[23] A. Mognon, J. Jovicich, L. Bruzzone, M. Buiatti, Adjust: An automatic eeg artifact detector based on the joint use of spatial and temporal features, Psychophysiology 48 (2011) 229–240.

[24] A. Belouchrani, K. Abed-Meraim, J.- F. Cardoso, E. Moulines, A blind source separation technique using secondorder statistics, IEEE Transactions on signal processing 45 (1997) 434–444.

[25] D. Langlois, S. Chartier, D. Gosselin,

Quantitative Methods for Psychology 6

An introduction to independent component analysis: Infomax and fastica algorithms, Tutorials in

[26] A. J. Bell, T. J. Sejnowski, An information-maximization approach to

[27] T.-W. Lee, M. Girolami, T. J. Sejnowski, Independent component analysis using an extended infomax algorithm for mixed subgaussian and supergaussian sources, Neural computation 11 (1999) 417–441.

[28] G. Inuso, F. La Foresta, N. Mammone, F. C. Morabito, Brain activity investigation by eeg processing:

deconvolution, Neural computation 7

blind separation and blind

(2010) 31–38.

(1995) 1129–1159.

**103**

and Control 7 (2012) 389–400.

290–295.

(2010) 152–162.

[12] Poisson wavelet, https://en.wikiped ia.org/wiki/Poisson wavelet, 2020.

[13] Complex mexican hat wavelet, https://en.wikipedia.org/wiki/Complex Mexican hat wavelet, 2020.

[14] Shannon wavelet, https://en. wikipedia.org/wiki/Shannon wavelet, 2020.

[15] J. A. Urigüen, B. Garcia-Zapirain, EEG artifact removal—state-of-the-art and guidelines, Journal of neural engineering 12 (2015) 031001.

[16] M. Fatourechi, A. Bashashati, R. K. Ward, G. E. Birch, Emg and eog artifacts in brain computer interface systems: A survey, Clinical neurophysiology 118 (2007) 480–494.

[17] M. Junghöfer, T. Elbert, D. M. Tucker, B. Rockstroh, Statistical control of artifacts in dense array EEG/MEG studies, Psychophysiology 37 (2000) 523–532.

[18] J. Woestenburg, M. Verbaten, J. Slangen, The removal of the eyemovement artifact from the eeg by regression analysis in the frequency domain, Biological psychology 16 (1983) 127–147.

[19] T.-P. Jung, S. Makeig, C. Humphries, T.-W. Lee, M. J. Mckeown, V. Iragui, T. J. Sejnowski, Removing electroencephalographic artifacts by blind source separation, Psychophysiology 37 (2000) 163–178.

[20] L. Shoker, S. Sanei, W. Wang, J. A. Chambers, Removal of eye blinking artifact from the electroencephalogram, incorporating a new constrained blind source separation

#### *Wavelets for EEG Analysis DOI: http://dx.doi.org/10.5772/intechopen.94398*

algorithm, Medical and Biological Engineering and Computing 43 (2005) 290–295.

[21] H. Nolan, R. Whelan, R. Reilly, FASTER: fully automated statistical thresholding for EEG artifact rejection, Journal of neuroscience methods 192 (2010) 152–162.

[22] R. R. Vázquez, H. Velez-Perez, R. Ranta, V. L. Dorr, D. Maquin, L. Maillard, Blind source separation, wavelet denoising and discriminant analysis for eeg artefacts and noise cancelling, Biomedical Signal Processing and Control 7 (2012) 389–400.

[23] A. Mognon, J. Jovicich, L. Bruzzone, M. Buiatti, Adjust: An automatic eeg artifact detector based on the joint use of spatial and temporal features, Psychophysiology 48 (2011) 229–240.

[24] A. Belouchrani, K. Abed-Meraim, J.- F. Cardoso, E. Moulines, A blind source separation technique using secondorder statistics, IEEE Transactions on signal processing 45 (1997) 434–444.

[25] D. Langlois, S. Chartier, D. Gosselin, An introduction to independent component analysis: Infomax and fastica algorithms, Tutorials in Quantitative Methods for Psychology 6 (2010) 31–38.

[26] A. J. Bell, T. J. Sejnowski, An information-maximization approach to blind separation and blind deconvolution, Neural computation 7 (1995) 1129–1159.

[27] T.-W. Lee, M. Girolami, T. J. Sejnowski, Independent component analysis using an extended infomax algorithm for mixed subgaussian and supergaussian sources, Neural computation 11 (1999) 417–441.

[28] G. Inuso, F. La Foresta, N. Mammone, F. C. Morabito, Brain activity investigation by eeg processing: wavelet analysis, kurtosis and renyi's entropy for artifact detection, in: 2007 International Conference on Information Acquisition, IEEE, pp. 195– 200.

[29] N. P. Castellanos, V. A. Makarov, Recovering eeg brain signals: artifact suppression with wavelet enhanced independent component analysis, Journal of neuroscience methods 158 (2006) 300–312.

[30] M. T. Akhtar, W. Mitsuhashi, C. J. James, Employing spatially constrained ica and wavelet denoising, for automatic removal of artifacts from multichannel eeg data, Signal Processing 92 (2012) 401–416.

[31] H. Ghandeharion, A. Erfanian, A fully automatic ocular artifact suppression from eeg data using higher order statistics: Improved performance by wavelet analysis, Medical engineering & physics 32 (2010) 720– 729.

[32] N. K. Al-Qazzaz, S. H. B. M. Ali, S. A. Ahmad, M. S. Islam, J. Escudero, Discrimination of stroke-related mild cognitive impairment and vascular dementia using eeg signal analysis, Medical & biological engineering & computing 56 (2018) 137–157.

[33] R. Mahajan, B. I. Morshed, Unsupervised eye blink artifact denoising of eeg data with modified multiscale sample entropy, kurtosis, and wavelet-ica, IEEE journal of Biomedical and Health Informatics 19 (2014) 158– 165.

[34] N. Al-Qazzaz, S. Hamid Bin Mohd Ali, S. Ahmad, M. Islam, J. Escudero, Automatic artifact removal in eeg of normal and demented individuals using ica–wt during working memory tasks, Sensors 17 (2017) 1326.

[35] W. Kong, Z. Zhou, S. Hu, J. Zhang, F. Babiloni, G. Dai, Automatic and

direct identification of blink components from scalp eeg, Sensors 13 (2013) 10783–10801.

**Chapter 6**

**Abstract**

**1. Introduction**

**105**

Ultra-High Performance and

Wavelet Transforms

*Safa Saadaoui and Abbas Dandache*

Low-Cost Architecture of Discrete

*Mouhamad Chehaitly, Mohamed Tabaa, Fabrice Monteiro,*

This work targets the challenging issue to produce high throughput and low-cost configurable architecture of Discrete wavelet transforms (DWT). More specifically, it proposes a new hardware architecture of the first and second generation of DWT using a modified multi-resolution tree. This approach is based on serializations and interleaving of data between different stages. The designed architecture is massively parallelized and sharing hardware between low-pass and high-pass filters in the wavelet transformation algorithm. Consequently, to process data in high speed

and decrease hardware usage. The different steps of the post/pre-synthesis

with low used of logic elements (≈400) and logic registers (≈700).

FIR filter, parallel-pipeline architecture, VHDL-RTL modeling, FPGA

configurable algorithm are detailed in this paper. A modulization in VHDL at RTL level and implementation of the designed architecture on FPGA technology in a NexysVideo board (Artix 7 FPGA) are done in this work, where the performance, the configurability and the generic of our architecture are highly enhanced. The implementation results indicate that our proposed architectures provide a very high-speed data processing with low needed resources. As an example, with the parameters depth order equal 2, filter order equal 2, order quantization equal 5 and a parallel degree *P* = 16, we reach a bit rate around 3160 Mega samples per second

**Keywords:** Mallat binary tree algorithm, DWPT, IDWPT, lifting scheme wavelet,

We notice in the last year a wide usage of wavelet transform theory in different domain like telecommunications, image and video processing, data compression, optical fiber, encryption and others. But these domains are evolved extremely which require a new wavelet transform architecture with low cost target technology that can provide a high-speed data processing and low power consummation. In parallel FPGA technology is massively blossomed to come very popular and to be a target technology of many applications, in particular of Discrete Wavelet Packet Transform (DWPT). Although there are tons of research elsewhere, the talking of efficient hardware implementation of wavelet transform is still a complex mission and depend directly on the target application. Where in each application, there is a compromise between the different constraints: processing speed, implementation cost, and power consumption.

[36] R. N. Vigário, Extraction of ocular artefacts from EEG using independent component analysis, Electroencephalography and clinical neurophysiology 103 (1997) 395–404.

[37] S. V. Ramanan, N. Kalpakam, J. Sahambi, A novel wavelet based technique for detection and de-noising of ocular artifact in normal and epileptic electroencephalogram (2004).

[38] V. Krishnaveni, S. Jayaraman, S. Aravind, V. Hariharasudhan, K. Ramadoss, Automatic identification and removal of ocular artifacts from eeg using wavelet transform, Measurement science review 6 (2006) 45–57.

[39] P. S. Kumar, R. Arumuganathan, K. Sivakumar, C. Vimal, Removal of ocular artifacts in the eeg through wavelet transform without using an eog reference channel, Int. J. Open Problems Compt. Math 1 (2008) 188–200.

[40] D. L. Donoho, J. M. Johnstone, Ideal spatial adaptation by wavelet shrinkage, biometrika 81 (1994) 425–455.

[41] N. Bajaj, J. R. Carrión, F. Bellotti, R. Berta, A. De Gloria, Automatic and tunable algorithm for eeg artifact removal using wavelet decomposition with applications in predictive modeling during auditory tasks, Biomedical Signal Processing and Control 55 (2020) 101624.

#### **Chapter 6**
