## 3 Methods
### Continuous Wavelet Transformation  
The WT has been proven to be a useful tool in the study of time series and has been applied successfully numerous times in an extraordinary range of fields because of its ability to extract various  
Figure 3: Technical flow chart of the proposed approach. components (e.g., seasonal, trend, and abrupt components) for time series [49]. The WT can decompose a signal directly according to the frequency, and represent it in the frequency domain distribution state in the time domain. The Fourier transform is not localized in time, whereas a wavelet is localized in time, which allows the WT to obtain time information in addition to frequency information [49]. Thus, it is a more powerful transformation for time series analysis. A wavelet function (or wavelet, for short), is a function \(\varphi\in\mathrm{R}\) with zero average (i.e., \(\int_{R}\phi=0\)), normalized (i.e., \(\|\phi\|=1\)), and centered in the neighborhood of \(t=0\)[50]. Scaling \(\varphi\) by a positive quantity \(s\), and translating it by \(\mathrm{u}\in\mathrm{R}\) generates a family of time-frequency atoms (i.e., the mother wavelet), \(\phi_{u,s}:\)[51]  
\[\Phi_{u,s}(t)=\frac{1}{\sqrt{s}}\Phi\Big{(}\frac{t-u}{s}\Big{)},\ u\in R,s>0. \tag{4}\]  
Given the original signal \(f\in\mathrm{R}\), the CWT of \(f\) at time \(u\) and scale \(s\) is defined as  
\[Wf(u,s)=\int_{-\infty}^{+\infty}f(t)\phi_{u,s}^{*}(t)dt, \tag{5}\]  
and it provides the frequency component (or details) of \(f\) that correspond to scale \(s\) and time location \(u\). Wavelet coefficients \(Wf(s,u)\) are obtained by continuously varying the scale and the position parameters to select different portions of the original signal and analyze different scale variations. Conversely, the original signal can be retrieved by multiplying each coefficient by the appropriate scaled and shifted wavelet. The scalogram of \(f\) is defined by the function [52]  
\[\varphi(s)=\|Wf(s,u)\|=\big{(}\int_{-\infty}^{+\infty}\big{|}Wf(s,u)\big{|}^{ 2}du\big{)}^{\frac{1}{2}}, \tag{6}\]  
which represents the energy of \(Wf\) at scale \(s\). Clearly, \(\varphi(s)\geq 0\) for all scale \(s\), and if \(\Phi(s)>0\) we say that signal\(f\) has details at scale \(s\). Thus, the scalogram is a time-scale representation of the original signal and allows the detection of the most representative scales (or frequencies) of a signal, that is, the scales that contribute the most to the total energy of the signal. Because the term frequency is reserved for the Fourier transform, the WT is typically expressed in scales, but it is possible to convert scales to frequencies using the following equation [52]:  
\[f_{a}=\frac{f_{c}}{s} \tag{7}\]  
where \(f_{a}\) is the frequency, \(f_{c}\) is the central frequency of the mother wavelet, and \(s\) is the scaling factor. Many families of wavelets exist, and they differ from each other because, for each family, a different trade-off has been made regarding how compact and smooth the wavelet appears. For example, four of the most common continuous mother wavelets were tested in this research [53]:  
\[\mathrm{Gaussian\ wavelet\ }(\mathit{gaus4}):\ \phi(t)=4e^{-t^{2}}, \tag{8}\]  
\[\mathrm{Mexican\ hat\ wavelet\ }(\mathit{mech}):\ \phi(t)=\frac{2}{\sqrt{3}\ \dot{\psi}\pi}e^{-\frac{t^{2}}{2}}\big{(}1-t^{2}\big{)}, \tag{9}\]  
\[\mathrm{Shannon\ wavelet\ }(\mathit{shan}):\ \phi(t)=\sqrt{B}\frac{\sin(\pi Bt)}{ \pi Bt}e^{j2\pi Ct}, \tag{10}\]  
where B is the bandwidth and C is the center frequency, and  
\[\mathrm{[PERSON]\ wavelet\ }(\mathit{morel}):\ \phi(t)=e^{-\frac{t^{2}}{2}}\cos(5t). \tag{11}\]  
After comparing their influence on the scalogram, we finally used the \"Morlet\" as the mother wavelet because it extracts features with equal variance in time and frequency, which ensure the time-frequency resolution can be adapted to different signals of interest and provide a guarantee of extracting temporal features.