# Application of Dynamic Time Warping (DTW) in Comparing MRT Signals of Steel Ropes
## 3 Results
### Active Experiment  
The aim of the laboratory tests was to verify the effectiveness and stability of automatic time-series synchronization based on the DTW algorithm using measurement data obtained with different resolutions of scanning ropes with known defects (Figure 13) in ENCODER and TIMER mode. The synchronized segment of the time series was randomly extracted from various parts of the \"current\" recording, and then, attempts were made to automatically match it to the reference signal with varying initial offsets and sampling frequencies. Examples of the results of the research are illustrated in Figures 13-16. On the basis of the laboratory tests, it was found that the DTW algorithm with additional constraints on the set of acceptable paths correctly synchronized two time series of signals, both in the presence of a strong symptom of a single magnetic anomaly or a group of similar symptoms of magnetic anomalies evenly distributed along the rope, as well as in areas without anomalies of magnetic defects in the rope based on the rope's structural noise. DTW without local restrictions on the set of permissible paths can generate erroneous synchronization when the analyzed signals are sampled with a significant difference in resolution, and the signal spectrum is dominated by only the fundamental harmonics of the rope construction noise (conducive to the aliasing effect) and weak symptoms of single wire fractures (Figure 16). The risk of mis-synchronization of measurement data can be reduced by considering the results of the synchronization of LF1 and LF2 signals, taking into account the acceptable level of residual signal energy \(d\_{L}{F}i=L{F}i_{b}-L{F}i_{ref}\) calculated outside the zones of strong magnetic anomalies. An additional criterion for verifying time-series synchronization must also account for the rope's structural features, determined experimentally, as well as quantitative changes in the PSD spectrum. Figure 13: The LF1(k) signal of an endless Seale 6x19+NF rope with simulated defects showing 32 signatures of magnetic anomalies from known defects in the structure and repeated diagnostic symptoms over four cycles. The accuracy metrics used were precision (28), recall (29), and the F1 measure (30), which were calculated according to [70]:  
\[Precision=\frac{True\ Positive}{True\ Positive+False\ Positive} \tag{28}\]  
\[Recall=\frac{True\ Positive}{True\ Positive+False\ Negative} \tag{29}\]  
\[F1-measure=\frac{2\times Precision\times Recall}{Precision+Recall} \tag{30}\]  
where  
Figure 14: Synchronization of two LF1 signals sampled in TIMER mode at 400 Hz and 5 kHz in a zone with significant magnetic anomalies. The differential signal reveals quantization noise and highlights the effects of sampling rate differences, particularly at locations of structural defects in the rope. Figure 16: Incorrect synchronization of time series sampled at 400 Hz and 5 kHz by the DTW algorithm due to the absence of local constraints on the set of admissible paths. Figure 15: Synchronization of LF1 signals containing wire break symptoms recorded independently in ENCODER mode, with a resolution of 1.0 mm (1000 pulses per meter of rope), and in TIMER mode, at a frequency of 1 kHz: (**a**) synchronized time series; (**b**) differential signal of the overlapping segment; (**c**) averaged signal of the overlapping segment. Precision is the ratio of correctly predicted positive observations to the total number of correctly predicted positive observations;
* Recall is the ratio of correctly predicted positive observations to all observations in the wire rope patterns class;
* F1 measure is the weighted average of precision and recall. It was found that DTW can be used to synchronize data recorded in ENCODER mode with different resolutions, np. max. 1.0 mm required by ISO 4309:2017 and 2.5 mm or 5.0 mm used by some MRT users prior to the revision of this standard.