## 2 Materials and Methods
### Feature Extraction and Multi-Feature Fusion Analysis
#### 2.4.2 Extraction of Frequency-Domain Spectrum Features  
The porosity of TBCs influenced the terahertz frequency-domain signals, requiring the extraction of spectral features for porosity characterization. Specifically, the center frequency, bandwidth, and average power spectral density (APSD) were extracted from the spectra for this purpose [45]. The center frequency corresponded to the peak frequency in the spectrum data, indicating the primary energy distribution of the terahertz signal in the frequency domain. The bandwidth represented the frequency range where the spectrum decreased to a certain extent on both sides of the peak. By computing the bandwidth, the impact of porosity on the extent of spectral broadening in the terahertz signal within the TBC sample can be quantified. The average power spectral density (PSD) is obtained by averaging the squared amplitude of the signal at each frequency point, reflecting the changes in terahertz signal intensity. By extracting the center frequency, bandwidth, and APSD as feature parameters, the effects of porosity variations in the thermal barrier coating sample on the frequency characteristics of terahertz signals can be explored. The trends exhibited by these parameters will offer essential insights for subsequent prediction and analysis of porosity in TBCs.  
The specific processing process is as follows.  
Smoothing of frequency spectrum data is performed:  
\[smoothed\_data_{i,j}=\frac{1}{N}{\sum_{k=j-w}^{j+w}{f\_data_{i,k}}} \tag{14}\]  
where \(i\) is the \(i\)-th signal, \(j\) is the \(j\)-th frequency point, \(w\) is the size of the smoothing window, \(N\) is the number of data points in the window, \(f\_data\) is the frequency spectrum data, and \(smoothed\_data\) is the smoothed frequency spectrum data.  
A Gaussian curve fit is performed for the \(i\)-th signal. Gaussian distribution is a continuous distribution function that accurately describes the main characteristics of the spectral data. Gaussian fitting is performed on the smoothed spectral data to calculate their center frequency and bandwidth:  
\[y_{i}=A_{i}exp^{-\frac{(x-y_{i})^{2}}{2\sigma_{i}^{2}}}+b_{i} \tag{15}\]  
where \(x\) is the frequency, \(A_{i}\) is the peak intensity, \(\mu_{i}\) is the peak frequency, \(\sigma_{i}\) is the frequency bandwidth, and \(b_{i}\) is the constant term of the fitted curve.  
Amplitude spectrum \(A(f)\) is obtained by taking the absolute value of the original frequency spectrum data \(f\_data\) and squaring it.  
\[A(f)=|f\_data|^{2} \tag{16}\]  
The average power spectrum is obtained by averaging the amplitude spectrum along the frequency axis:  
\[APSD_{i}=\frac{1}{N}\sum_{j=1}^{N}A_{ij} \tag{17}\]  
\[F\_parameters=\begin{bmatrix}freq\_center_{1}&freq\_center_{2}&\cdots&freq\_ center_{i}\\ freq\_bandwidth_{1}&freq\_bandwidth_{2}&\cdots&freq\_bandwidth_{i}\\ APSD_{1}&APSD_{2}&\cdots&APSD_{i}\end{bmatrix} \tag{18}\]  
where \(APSD_{i}\) is average power spectral density. The fitted \(\mu_{i}\) is the center frequency \(freq\_center\), and \(\sigma_{i}\) is the frequency bandwidth \(freq\_bandwidth\). \(F\_parameters\) is the feature parameter vector of frequency-domain data.