## 3 Nonuniform Temperature Compensation Using Local Phase Matching  
Global signal processing methods often struggle with signals exhibiting nonuniform phase changes due to NTF. Although these signals may lead or lag in phase, they retain a degree of similarity within the local ranges. This paper proposes a method to compensate for the local phase of the signal, effectively addressing the challenges of UGW detection caused by nonuniform phase shifts. Additionally, this algorithm focuses solely on phase compensation. It preserves the original signal information, avoiding the enhancement or masking of defect signals and other characteristics. This broadens its applicability. In UGW monitoring, health signals from multiple groups of structures in a nondestructive state are first collected as baseline signals (BSs) \(\mathbf{B}_{n}=\{b_{1},b_{2},\ldots,b_{n}\}\). These collected signals, known as monitoring signals (MSs) \(\mathbf{Y}_{n}^{i}=\{y_{1},y_{2},\ldots,y_{n}\}\) (\(j\)-th MS), are then used to assess the structural health. After obtaining BS and MS, LPM can be performed, with the specific steps outlined as follows:  
1. In BS, the width of the baseline sliding window (BSW) is selected as \(p\), and the initial element number of BSW is \(i\). At this point, the elements contained in BSW sequence are as follows: \[\mathbf{b}_{p}^{i}=\{b_{i},b_{i+1},\ldots,b_{i+p-1}\};\] (4)
2. In the \(j\)-th MS, the width of the monitoring sliding window (MSW) is select as \(q(q=p-2a,\ a\geq 0)\). The initial element number is \(s\ (s=i+a)\), and the elements contained in the MSW sequence are as follows: \[\mathbf{y}_{q}^{js}=\{y_{s}^{j},y_{s+1}^{j},\cdots,y_{s+q-1}^{j}\}=\{y_{i+a^{ \prime}}^{j},y_{i+a+1}^{j},\cdots,y_{i+p-a-1}^{j}\};\] (5)
3. Since the BSW sequence contains \(2a\) more elements than the MSW sequence, the BSW sequence can be further divided into \(2a+1\) sub-sequences, expressed as follows: \[\mathbf{r}_{q}^{jh}=\{b_{i+h},b_{i+h+1},\cdots,b_{i+h+q-1}\},(0\leq h\leq 2a);\] (6)
4. Calculate the cosine similarity \(C^{ihj}\) between each of the \(2a+1\) sub-sequences and MSW sequence. This will result in \(2a+1\) sets of values as shown below: \[C^{ihj}=C^{ihj}(\mathbf{r}_{q}^{ih},\mathbf{y}_{q}^{js});\] (7)
5. Find the \(\hat{h}\) that maximizes \(c^{ihj}\), indicating that the \(\hat{h}\)-th sub-sequence of the BSW sequence is the closest to the MSW sequence. This determines the best-matching baseline local signal \(\mathbf{r}_{q}^{i\hat{h}}\) and monitoring local signal \(\mathbf{y}_{q}^{js}\): \[\hat{h}=\operatorname*{arg\,max}_{h}\{c^{ihj}\};\] (8)
6. Computing the local damage index \(\mathbf{l}^{ji}\) of the two best-matching local signal segments, \[\mathbf{l}^{ji}=\mathbf{l}^{ji}(\mathbf{r}_{q}^{i\hat{h}},\mathbf{y}_{q}^{js});\] (9)Slide the window to the next element \((i\to i+1)\), continuing until all elements in BS have been traversed. Then, the local damage index calculated for each slide window can be organized into a vector: \[\textbf{I}^{j}=[I^{j1},I^{j2},\ldots,I^{ji}];\] (10) 8. The maximum value in the local damage index vector represents the most distinct part of the signal and can be used as the damage index (DI) for MS: \[\text{DI}=\text{max}(\textbf{I}^{j}).\] (11) 9. Then turn to step (1), computing DI of the \((j+1)\)-th monitoring signal to form a monitoring curve. The above outlines the main process of the LPM method. Cosine similarity measures the similarity between two vectors by calculating the cosine of the angle between them. The result depends solely on the direction of the vectors and is independent of their magnitudes. Typically applied in positive space, the cosine similarity yields values between \(-1\) and \(1\). Cosine similarity \(C\) is primarily used to assess the similarity between two sets of signal segments and to identify the best matching segments.