## 2 Materials and Methods
### Feature Extraction Techniques
#### 2.1.1 Mel Frequency Cepstral Coefficients  
This is a state-of-the-art algorithm based on the known sensitivity variation of the critical frequency bandwidths present in the cochlea of the human ear, most used for the extraction of spectral information from time series [20]. Its success is due to its ability to represent the width of the spectrum of a signal in a compact form. Here, we will review each step in the process of creating the MFCCs, but motivated by considerations that adjust to the heart sound rates, where the summary of the stages is shown in Figure 6 inside the pink box [21].  
Framing: The general purpose of this stage is to prepare the signal, segmenting it into \(N\) samples, where the segmentation window has a shift of \(m\) and the separation of the adjacent frames has no overlap. Subsequently, to analyze the frequency changes, the Discrete Fourier Transform is applied to each segment. Usually, 20-40 ms windows with a 50% overlap (\(\pm\)10%) are used to process speech. However, frequencies lower than those present in the voice predominate in heart sounds, so it is proposed to use 64 ms windows without overlap.  
Discrete Fourier Transform (DFT): The energy contribution of each of its frequency constituents is calculated for each segment through the DFT. This transformation of domains from time to frequency is described by [22]:  
\[\mathcal{F}(x_{n})=\sum_{n=0}^{N-1}x_{n}e^{\frac{-2\pi\mathrm{j}n}{N}},k=0,..., N-1 \tag{1}\]  
whose resolution in frequency is given by \(fs/N\), where \(fs\) is the sampling frequency, \(N\) the number of samples and \(|\mathcal{F}|\) the magnitude.  
Filter Bank: Although the number of filters is a hyperparameter, the central frequency of each of them is calculated linearly from the theoretical maximum frequency recorded in  
\begin{table}
\begin{tabular}{c c c} \hline
**Binary Labels** & **Multiclassification Labels** & **No. of Recordings** \\ \hline Normal & Normal (N) & 400 \\ \hline \multirow{4}{*}{Abnormal} & Aortic Stenosis (AS) & 400 \\  & Mitral Regurgitation (MR) & 400 \\ \cline{1-1}  & Mitral Stenosis (MS) & 380 \\ \cline{1-1}  & Mitral Valve Prolapse (MVP) & 400 \\ \hline Total & & 1980 \\ \hline \end{tabular}
\end{table}
Table 1: Details of the dataset.  
the signal. The first step consists of changing the scale from Hertz to Mels for the theoretical maximum frequency of the signal, according to the Nyquist Theorem [23]:  
\[Mel(f)=2595\times\log_{10}\left(1+\frac{f}{700}\right) \tag{2}\]  
Once we have the theoretical maximum frequency in Mels, \(M\) equidistantly spaced frequencies are proposed to be used as central frequencies for the filters. Subsequently, it is necessary to remap the central frequencies from Mels to Hertz to design the \(H_{m}[k]\) filters [24] :  
\[H_{m}[k]=\begin{cases}0&\text{if }k<f[m-1]\\ \frac{2(k-f[m-1])}{(f[m+1]-f[m-1])(f[m]-f[m-1])}&\text{if }f[m-1]\leq k<f[m]\\ \frac{2(f[m+1]-k)}{(f[m+1]-f[m-1])(f[m]-f[m-1])}&\text{if }f[m]\leq k\leq f[m+1]\\ 0&\text{if }k>f[m+1]\end{cases} \tag{3}\]  
Then, \(\mathcal{F}\times H_{m}\) is computed, obtaining a reduced spectral representation of the signal.  
Discrete Cosine Transform: Finally, it is necessary to apply a discrete cosine transform in order to obtain the MFCCs of each window, described as [25]:  
\[F_{k}=2\frac{C_{k}}{N}\sum_{j=0}^{N-1}f(j)cos[\frac{2(j+1)k\pi}{2N}],\begin{cases} c_{k}=\frac{1}{\sqrt{2}}&\text{if }k=0\\ c_{k}=1&\text{if }k>0\end{cases} \tag{4}\]  
As mentioned, this process of multiplying the coefficients obtained after applying DFT by the filter bank is repeated for each segment of the signal, obtaining, as shown in Figure 3, an array with dimensions \(N\times M\), where \(N\) is the number of windows and \(M\) the number of filters.