# Eye State Identification Based on Discrete Wavelet Transforms
## 2 Theoretical Background
### Wavelet Transform  
Wavelet Transform (WT) is a mathematical technique particularly suitable for non-stationary signals due to its properties of time-frequency localization and multi-rate filtering, which means that a signal can be extracted at a particular time and frequency and can be differentiated at various frequencies [33].  
Wavelets can be defined as small waves limited in time, with zero-mean, finite energy over their time course and band-limited, i.e., they are composed of a relatively limited range of frequencies [34; 35]. Wavelet functions can be scaled in time and translated to any time point without changing their original shape. WT breaks down the input signal into a set of time-scaled and time-translated versions of the same basic wavelet. The set of scaled and translated wavelets of a unique mother wavelet \(\psi(t)\) is called wavelet family, denoted as \(\psi_{a,b}(t)\) and obtained as follows  
\[\psi_{a,b}(t)=\frac{1}{\sqrt{a}}\psi\left(\frac{t-b}{a}\right), \tag{1}\]  
where \(t\) denotes time, \(a,b\in\mathbb{R}\) and \(a\
eq 0\). Wavelet function in (1) becomes wider when \(a\) decreases and is shifted in time when \(b\) varies. Therefore, \(a\) is called the scaling parameter that determines the oscillatory frequency and length of the wavelet, while \(b\) is called the translation parameter.  
There are two types of WT: Continuous Wavelet Transform (CWT) and DWT. The idea behind CWT is to scale and translate the basic wavelet shape and convolve it with the signal to be analyzed at continuous time and frequency increments. However, analyzing the signal at every time point and scale is time consuming. Moreover, the information provided by the CWT at close time points and scales is highly correlated and redundant [34]. DWT is a more efficient and computationally simpler algorithm for the wavelet analysis [36].  
In this case, discrete \(a\) and \(b\) parameters based on powers of two (dyadic scales and translations) are usually employed.  
The DWT algorithm based on multi-resolution analysis can be implemented as a simple recursive filtering scheme composed by a pair of digital filters, high-pass and low-pass, whose coefficients are determined by the wavelet shape used in the analysis. In Figure 1, we can see the scheme for the DWT-based multi-resolution analysis. The signal is decomposed into a set of Approximation (A) coefficients, which represent the output of the low-pass filter, and Detail (D) coefficients, which are the output of the high-pass filter. The features extracted from these wavelet coefficients at different levels can reveal the inner characteristics of the signal. Hence, both the selection of a proper mother wavelet and the number of decomposition levels are of critical importance for the analysis of signals using DWT [37].  
The DWT has been widely applied in EEG signal processing, particularly as a feature extraction method that feeds a classification algorithm for mental state recognition. For instance, it has been applied for the classification and analysis of Event-related Potential (ERP) signals [38; 39], self-regulated Slow Cortical Potentials (SCPs) [40], single-sweep ERPs [41], among others. It has been also applied for Motor Imagery (MI) data classification [42; 43] and for the characterization and classification of epileptic strokes through EEG recordings [33; 44; 45].