# EMD-Based Noninvasive Blood Glucose Estimation from PPG Signals Using Machine Learning Algorithms
## Appendix A Computational Methods for Specific IMF-Based Features Obtained through EMD  
Spectral centroid: The spectral centroid of an IMF is computed to quantify the center frequency of the power spectrum of that IMF, effectively indicating the \"gravity\" of its \begin{table}
\begin{tabular}{c c c c} \hline \hline
**Method** & **Main Features** & **Machine Learning Algorithm** & **R\({}^{2}\) Score** \\ \hline Method [27] & SPA-based features & Neural network & 0.91 \\ Method [28] & KTE, AR, Heart rate & Random forest & 0.90 \\  & statistics, SpO\({}_{2}\) range & & \\ Our Method & Extracted from IMFs, ratio features from PPG & RF, XGB, CB, LightGBM & 0.92 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Comparison of the performance between glucose estimation methods. spectrum [32]. It is determined by first applying the fast Fourier transform (FFT) to the IMF to obtain the frequency domain representation. The spectral centroid is then calculated as the weighted mean of the frequencies present in the signal, with the magnitudes of the FFT serving as the weights. Mathematically, the spectral centroid for an IMF is given by:  
\[SC=\frac{\sum(\mathrm{f_{i}}|\mathrm{FFT(i)}|)}{\sum|\mathrm{FFT(i)}|} \tag{1}\]  
Here, \(f_{i}\) represents the frequency corresponding to the i\({}^{\mathrm{th}}\) bin, which is derived from the FFT frequency bin associated with the IMF, and \(|\mathrm{FFT(i)}|\) is the magnitude of the FFT at the i\({}^{\mathrm{th}}\) bin. Spectral entropy: It is defined as the entropy of the power spectral density (PSD) of the IMF, which can be computed as in [33]:  
\[\mathrm{SE}=-\sum(\mathrm{PSD_{n}}\times\mathrm{log(PSD_{n})}) \tag{2}\]  
where \(\mathrm{PSD_{n}}\) means a normalized PSD. Spectral flatness: It is calculated as the geometric mean of the FFT values of IMF divided by their arithmetic mean [34]. \[\mathrm{SF}\ \frac{\mathrm{Geometric\ mean\ of|FFT(i)|}}{\mathrm{Arithmetic\ mean\ of|FFT(i)|}} \tag{3}\]  
Peak to spectral energy ratio: It is a measure of how much of the signal's energy is packed into a single frequency component relative to the entire spectrum of frequencies. The maximum magnitude of the FFT of the IMF is divided by total power \(\mathrm{P_{t}}\) of the spectrum calculated by summing the squared magnitudes of all FFT components. \[\mathrm{PSER}=\frac{\mathrm{max}(\sum\ |\ \mathrm{FFT(i)}\ |)}{P_{t}} \tag{4}\]  
where  
\[\mathrm{P_{t}}=\left(\sum\ |\ \mathrm{FFT(i)}\ |\right)^{2} \tag{5}\]  
Spectral band energy: It is calculated to assess the distribution of power within a predefined frequency band of a signal's power spectrum. The spectral band energy for a given frequency band (\(f_{min}\)_to_\(f_{max}\)) is given by:  
\[\mathrm{SBE}=\sum_{f_{min}}^{f_{max}}(|\ \mathrm{FFT(i)}\ |)^{2} \tag{6}\]  
where \(f_{min}\)_and_\(f_{max}\) are the indices corresponding to the lower and upper bounds of the frequency band of interest. Spectral slope: It can be calculated using a linear regression fit on the log-transformed power spectrum [34] as follows:  
\[\mathrm{SS}=\frac{\mathrm{d}(\mathrm{log|FFT(f)|})}{\mathrm{d}(\mathrm{log} \mathrm{f})} \tag{7}\]  
Here, log(f) represents the natural logarithm of the frequency bins, starting from the first non-zero bin to avoid the singularity at zero. \(\mathrm{log(|FFT(f)|)}\) is the natural logarithm of the magnitude of the FFT components, also starting from the first non-zero bin. Numpy polyfit is used to perform the linear regression on the log-transformed frequency bins and FFT magnitudes, and then the [0] index is used to select the slope coefficient from the fit results. Mean amplitude envelope: The mean amplitude envelope, \(\text{AE}_{\text{mean}}\), of a signal captures the absolute value of the analytic signal A(t) (which is the output of the Hilbert transform \(\text{H}\) applied to the IMF(t)). The Hilbert transform was performed using SciPy's signal.hilbert. \[\text{AE}_{\text{mean}}=\frac{1}{\text{T}}\int_{0}^{\text{T}}|\text{A(t)}| \text{dt} \tag{10}\]  
where T is the total duration of the signal.