# Optimized Detection Algorithm for Vertical Irregularities in Vertical Curve Segments
## 4 Optimization of Detection Algorithms for Vertical Curve Segments
### Algorithm Verification  
Simulation analyses were conducted under various test conditions, and the results were compared with those obtained using the acceleration integration method to validate  
Figure 11: Flowchart of the reference cancellation method. Figure 12: Time domain comparison of acceleration integration and pitch angle integration results (**a**) Time domain comparison of integration results, (**b**) Time domain comparison of integration result differences. the effectiveness of the reference cancellation method. The parameter values for each test are consistent with those described previously, as detailed in Table 5.  
After simulating the virtual dynamic responses, virtual irregularities were calculated. The maximum error \(E_{\text{max}}\) and root mean square error \(E_{\text{rmse}}\) for both algorithms under different test conditions were then statistically analyzed, as shown in Table 6. The results from Scenario 4 were selected for visualization. Following the methodology outlined in Section 3, a 500 m segment was extracted in both directions from the centre of the vertical curve for time-frequency domain analysis, as illustrated in Figure 13.  
Figure 13a shows that in straight and gradient sections, the detection accuracy of the reference cancellation method is comparable to that of the acceleration integration method, with no significant difference in error. However, in vertical curve segments, the reference cancellation method markedly reduces detection errors, achieving a higher level of accuracy. This method effectively lowers the detection error in vertical curve segments to levels similar to those in straight sections. At the transition points at 2600 m and 3200 m, minor error spikes remain, likely due to residual discrepancies in the pitch angle processing despite the use of smoothing filters and orthogonal least squares fitting to approximate ideal \begin{table}
\begin{tabular}{c c c c c c c c c c c} \hline \hline
**Operating** & **Train Speed** & **Radius R** & **Length** & **Gradient** & **Single-Side** \\
**Conditions** & **\(V\) (km\(\cdot\)h\({}^{-1}\))** & **(m)** & **\(L\) (m)** & **Difference \(\Delta i\) (\%o)** & **Gradient \(i\) (\%o)** \\ \hline
1 & 120 & 10,000 & 400 & 40 & 40 & \(\pm\)20 \\
2 & 80 & 10,000 & 400 & 40 & \(\pm\)20 \\
3 & 120 & 10,000 & 600 & 60 & \(\pm\)30 \\
4 & 120 & 14,000 & 400 & 28.58 & \(\pm\)14.59 \\
5 & 120 & 14,000 & 560 & 40 & \(\pm\)20 \\ \hline \hline \end{tabular}
\end{table} 
Table 5: Experimental conditions under different algorithms. Figure 13: Time–frequency domain comparison of different algorithms (**a**) Comparison of error standard deviation (**b**) Comparison of power spectral density. conditions. Overall, the reference cancellation method shows substantial improvement in detection accuracy for vertical curve segments. Figure 13b demonstrates that the reference cancellation method maintains the amplitude and trend of the short-wavelength components in the PSD curve of virtual irregularities. For wavelengths greater than 100 m, the PSD curve derived from the reference cancellation method aligns more closely in amplitude and trend with the reference irregularity curve, effectively mitigating the influence of track alignment on the PSD of long-wavelength irregularities. Table 6 shows that under different test conditions, the maximum detection error \(E_{\text{max}}\) and the root mean square \(E_{\text{rmse}}\) of the acceleration integration method exhibit significant variation. This discrepancy primarily arises from the use of a uniform high-pass filter, while differences in spatial frequency across varying vertical curve radii result in inconsistent filtering effects. Compared to the acceleration integration method, the reference cancellation method effectively removes the track alignment component from the acceleration integration results before high-pass filtering, significantly enhancing the accuracy of virtual irregularity detection.