## 2 Materials and Methods
### Modeling of Simulated Crackle Sounds  
In order to train the classifier, a set of synthetic crackle sounds have been generated. Similar to [58], a crackle waveform \(y(t)\) is created (Equations (1)-(4)) assuming: (i) the crackle has two cycles represented by the parameter \(t_{2 CD}\), (ii) the location where the first cycle of the waveform \(y(t)\) equals zero is explicitly indicated by the parameter \(t_{IDW}\), and (iii) most of the power in \(y(t)\) is concentrated near the beginning of the waveform. To time shift most of the power to the beginning of the waveform, a modulating function \(m(t)\) is generated. An example of simulated crackles in the time domain is shown in Figure 2.  
\[t_{0}=\frac{t_{IDW}}{t_{2 CD}} \tag{1}\]  
\begin{table}
\begin{tabular}{c c c c c c c c} \hline \hline
**Scenario** & **Type** & **Model** & \(\mathbf{K_{C}}\) & \(\mathbf{NOTS}\) & **Noise** & **Diagnosis** & **SNR** & \(\mathbf{N_{S}}\) \\ \hline \multirow{5}{*}{Simulated} & FCS [57] & ATS & 10 & 15 & \(N_{R}\) & - & \([-10\) dB, \(10\) dB] & 315 \\ \cline{2-8}  & FCS [11] & Hoevers & 10 & 15 & \(N_{R}\) & - & \([-10\) dB, \(10\) dB] & 315 \\ \cline{2-8}  & FCS [12] & Cohen & 10 & 15 & \(N_{R}\) & - & \([-10\) dB, \(10\) dB] & 315 \\ \cline{2-8}  & CCS [57] & ATS & 10 & 15 & \(N_{R}\) & - & \([-10\) dB, \(10\) dB] & 315 \\ \cline{2-8}  & CCS [11] & Hoevers & 10 & 15 & \(N_{R}\) & - & \([-10\) dB, \(10\) dB] & 315 \\ \cline{2-8}  & CCS [12] & Cohen & 10 & 15 & \(N_{R}\) & - & \([-10\) dB, \(10\) dB] & 315 \\ \hline \multirow{2}{*}{Real} & FCS [28; 56] & - & 10 & 15 & \(N_{R}\) & IPF & \([-10\) dB, \(10\) dB] & 315 \\ \cline{2-8}  & CCS [28; 56] & - & 10 & 15 & \(N_{R}\) & BE & \([-10\) dB, \(10\) dB] & 315 \\ \hline \hline \end{tabular}
\end{table}
Table 1: Dataset \(\psi\). FCS: (i) ATS: \(t_{IDW}=0.7\) ms & \(t_{2 CD}=5\) ms, (ii) Hoevers: \(t_{IDW}=0.5\) ms & \(t_{2 CD}=3.3\) ms [45], (iii) Cohen: \(t_{IDW}=0.9\) ms & \(t_{2 CD}=6\) ms. CCS: (i) ATS: \(t_{IDW}=1.5\) ms & \(t_{2 CD}=10\) ms, (ii) Hoevers: \(t_{IDW}=1\) ms & \(t_{2 CD}=5.1\) ms, (iii) [PERSON]: \(t_{IDW}=1.25\) ms & \(t_{2 CD}=9.5\) ms. \(K_{C}\): number of crackles per signal. \(NOTS\): number of signals per SNR. \(N_{S}\): number of signals generated taking into account all SNRs evaluated.  
Figure 2: Two simulated crackles, normalized in energy, are modelled: (\(t_{IDW},t_{2 CD}\)) = (2 ms, 10 ms) in the top plot and (\(t_{IDW},t_{2 CD}\)) = (1 ms, 20 ms) in the bottom plot.  
\[y_{0}(t)=sin(4\pi t^{\alpha}),\alpha=\frac{log_{10}(0.25)}{log_{10}(t_{0})} \tag{2}\]  
\[m(t)=\frac{1}{2}\bigg{(}1+cos\bigg{(}2\pi\bigg{(}t^{\frac{1}{2}}-\frac{1}{2} \bigg{)}\bigg{)}\bigg{)} \tag{3}\]  
\[y(t)=y_{0}(t)m(t) \tag{4}\]  
In this work, a set of \(K=187\) crackle waveforms was created based on a conservative strategy using all combinations between both parameters \(t_{IDW}\) and \(t_{2 CD}\)[11; 12; 57]. Specifically, \(t_{IDW}\in[0.5,1.5]\) ms with a step size of 0.1 ms and \(t_{2 CD}\in[3.3,20]\) ms with a step size of 1 ms. Finally, each signal \(y(t)\) is normalized in energy, that is, \(\sum_{t}y^{2}(t)=1.0\). The magnitude Fourier transform (spectral pattern) of the previous set of \(K\) crackle waveforms is shown in Figure 3.