## 2 Materials and Methods
### THz-TDS Data Analysis  
THz-TDS spectroscopy offers the capability to determine the complex refractive index of a sample, denoted as \(\hat{n}\), as a function of angular frequency \(\omega\)[2]:  
\[\hat{n}(\omega)=n(\omega)+ik(\omega)=n(\omega)+i\frac{\alpha(\omega)c}{2\omega} \tag{6}\]  
where \(n(\omega)\) is the phase refractive index, \(k(\omega)\) is the extinction coefficient, \(\alpha(\omega)=\frac{2k\omega}{c}\) is the absorption coefficient, and \(c\) is the speed of light.  
In our spectroscopic measurements in transmission mode, two time-domain THz pulses propagating through the pellets (sample) and through the N\({}_{2}\) atmosphere (reference) were recorded, and their spectral amplitude and phase, \(\hat{E}_{s}(\omega)\) for the sample and \(\hat{E}_{r}(\omega)\) for reference, were calculated by a standard discrete fast Fourier transform (FFT) algorithm implemented in a Wolfram Mathematica (Champaign, IL, USA) program.  
\(\hat{E}_{s}(\omega)\) and \(\hat{E}_{r}(\omega)\) were compared by using the complex transfer function \(\hat{T}(\omega)\), defined as  
\[\hat{T}(\omega)=T(\omega)e^{\mathrm{i}\phi(\omega)}=\frac{\hat{E}_{s}(\omega) }{\hat{E}_{r}(\omega)} \tag{7}\]  
where \(T(\omega)\) and \(\phi(\omega)\) are the transfer function amplitude and phase, respectively.  
The variation of \(\hat{n}(\omega)\) with frequency can be deduced through the solving of the inverse scattering problem for electromagnetic waves. This involves equating the experimental transfer function  
\[\hat{T}_{exp}(\omega_{j})=\frac{\hat{E}_{s}(\omega_{j})}{\hat{E}_{r}(\omega_{ j})} \tag{8}\]  
(\(j\) is a data array index) to the analytical expression of \(\hat{T}(\omega_{j})\), obtained by solving the direct electromagnetic problem.  
The coherence of THz radiation in THz-TDS poses a significant challenge when extracting optical parameters from \(\hat{E}_{s}(\omega)\) and \(\hat{E}_{r}(\omega)\) due to the established FP interference effect resulting from multiple reflections within the sample [43]. In this scenario, the analytical form of \(\hat{T}(\omega)\), derived using the transfer matrix method [44], is  
\[\hat{T}(\omega)=\frac{E_{s}(\omega)}{E_{r}(\omega)}=\frac{4\hbar}{(1+\hbar)^{2} }e^{-\alpha d/2}e^{i\hbar\omega d/c}FP(\omega) \tag{9}\]  
where the \(FP\) term takes into account the FP interference effect  
\[FP(\omega)=\frac{1}{1-\left(\frac{\ddot{n}-1}{\hbar+1}\right)e^{-\alpha d}e^{ 2\hbar\omega d/c}}. \tag{10}\]  
Equations (9) and (10) are valid for radiation impinging perpendicularly on a flat sample. The extraction of the optical parameters as a function of frequency can be performed by equating the theoretical and experimental transfer functions: \(\hat{T}(\omega_{j})=\hat{T}_{exp}(\omega_{j})\). However, this equation can be solved only numerically.  
In order to determine the optical parameters of saccharides from the THz-TDS spectral data, we have employed a numerical procedure written in the Wolfram Mathematica environment and already described in previous articles [30; 31]. This procedure is based on the Davidenko method [45] for finding the roots of complex functions. It establishes frequency-dependent optical parameters by solving the implicit equation derived from equating the experimental and theoretical transfer functions, incorporating the self-contained FP effects. The comprehensive elimination of residual FP oscillations inherent in the optical parameter trends is achieved solely through the optimization of sample thicknesses.