## 3 Methods
### Features of EEG Signals
#### 3.1.2 Higher-Order Statistics for Wavelet Transform  
Wavelet transform can be useful in the detection of epileptic seizures due to its properties in analyzing signals in both time and frequency domains [60; 61; 62]. Seizures often exhibit sudden and short-lived changes in brain activity, which may be easier to detect using a method that allows for precise temporal localization. This is important because epileptic seizures can sometimes have subtle signal changes that are challenging to detect. By employing wavelet transform, there is a greater chance of identifying these low-amplitude changes with specific shapes. The Mallat pyramid is a popular tool for wavelet decomposition [63]. One of the main reasons for the popularity of this method is its effectiveness and versatility in signal analysis. The Mallat pyramid is characterized by high computational efficiency. It utilizes wavelet components of lengths equal to powers of two, which accelerates computations and reduces computational complexity [64]. As a result, signal decomposition using the Mallat pyramid is fast and efficient, which is crucial for analyzing large datasets or real-time applications. The fundamental step of wavelet transformation is decomposing the signal into a series of approximations and details representing different time and frequency scales [65]. This process can be recursively repeated on successive approximations, creating a wavelet tree. The choice of an appropriate wavelet function for signal analysis can be somewhat complex since there are many different wavelet functions to choose from, such as the Morlet wavelet, Haar wavelet, Daubechies wavelet, and Coiflet wavelet, among others [66]. However, the final selection of the wavelet may depend on individual preferences and the characteristics of the signal. Therefore, it is important to conduct experiments and compare different wavelets to find the one that best reflects the features of recordings during epileptic seizures. During the research, a series of experiments were conducted, and based on visual assessment, the Daubechies 4 (Db4) wavelet was selected. Figure 4 presents an example of the decomposition of the iEEG signal using the Mallat pyramid and the Daubechies 4 (Db4) wavelet. The decomposition was performed at four levels. Figure 4: An iEEG signal and its wavelet decomposition into four details and an approximation. During wavelet analysis, we calculate features that help us describe and interpret the transformed signal [67]. To determine these features, we can utilize energy, which represents the total power of the signal. Higher energy indicates a greater concentration of energy in a specific frequency range [68]. Variance measures the spread of values within a range. Higher variance may indicate greater amplitude variation in a particular frequency range. Skewness provides information about the asymmetry of the value distribution [69]. Positive skewness means the tail of the distribution is shifted to the right, while negative skewness indicates a shift to the left. Kurtosis measures the \"peakedness\" of the value distribution [70]. Higher kurtosis represents a sharper peak, while lower kurtosis indicates a flatter distribution. Entropy represents the level of disorder or complexity in a signal. Higher entropy signifies greater randomness and a lack of structure [70]. Variance can be calculated as [71]:  
\[var(x)=\frac{1}{N-1}\sum_{n=0}^{N-1}\left(x[n]-\overline{x}\right)^{2} \tag{2}\]  
_Skewness_[72]:  
\[skewness(x)=\frac{\frac{1}{N}\sum_{n=0}^{N-1}(x[n]-\overline{x})^{3}}{\left( \frac{1}{N}\sum_{n=0}^{N-1}(x[n]-\overline{x})^{2}\right)^{\frac{3}{2}}} \tag{3}\]  
_Kurtosis_[73]:  
\[kurtosis(x)=\frac{\frac{1}{N}\sum_{n=0}^{N-1}(x[n]-\overline{x})^{4}}{\left( \frac{1}{N}\sum_{n=0}^{N-1}(x[n]-\overline{x})^{2}\right)^{2}} \tag{4}\]  
where \(N\) represents the number of samples in the discrete signal, \(x[n]\) is the value of the signal at the \(n\)th sample, and \(\overline{x}\) is the mean value of the signal.