# Application of Dynamic Time Warping (DTW) in Comparing MRT Signals of Steel Ropes
## 2 Materials and Methods
### Algorithm DTW
The first step in the synchronization of measurement data should be the automatic determination of the initial offset of the next MRT recording in the extreme position of the rope system, e.g., in the upper or lower skip position, because the rope may be subject to  
* Periodic shortening by the user to equalize the stresses in the multi-rope system and maintain the skip stop parameters at a given level;
* Automatic shortening under the influence of torsional torsion. With the change in the length of the rope, its diameter and the pitch of the coiling of the strands in the individual layers of the rope and the distance between the strands change, which leads to an increase in the air gap in the measuring head and a change in the spectrum of the analyzed signal. Significant changes in the spectrum occur especially in the initial phase of operation of polymer-impregnated steel ropes, during the arrangement of strands and the adjustment of the thickness of the polymer layer to the rope-loading parameters. The values of characteristic frequencies related to the structural features of the rope and the characteristics of color noise change. Along with the progressive degradation of the rope (wire breakage, wire abrasion, corrosion, deformation of the rope shape), additional characteristic frequencies and modulation products also appear in the signal spectrum, which change between successive MRT tests. The spectrum also includes characteristic frequencies representing  
* Rope dynamics--transverse and longitudinal vibrations and level of material effort related to the actual operating conditions of the rope system changing between successive MRT tests;
* Modal properties of the rope, which change under the influence of unknown load history, current loads, temperature, and the technical condition of the rope. Periodic recording of magnetic anomalies in MRT studies can be performed with different sampling frequencies (TIMER mode, different forward speed of the rope), encoder resolutions (ENCODER mode), and ADC resolution (different flaw detectors). For such a complex problem, it is not possible to use simple methods of time-series synchronization based on the Euclidean distance. A characteristic feature of MISO systems is the ambiguity of the solution to the opposite problem--the identification of input signals based on the output signal. In the case of MRTstudies, this problem is mapped by the probability of diagnosis \(POD<1.0\) and must also be considered when testing new algorithms for the analysis of measurement data. In terms of analysis, the problem of time-series synchronization from MRT studies fits into the classic area of numerical analysis of discrete signals in time with a similar, but not the same, spectrum and initial offset. A common algorithm used for this class of problems is Dynamic Time Wrapping (DTW). DTW can be used to compare sequences with unequal lengths and unsynchronized sequences. DTW is a measure of similarity between two time series that was introduced in the literature by [PERSON] [52; 53] and [PERSON] [54]. The original use of DTW was speech analysis applications [55]. In addition to speech analysis, DTW is now also widely used in machine learning, medical sciences, econometrics, hemothcare, marketing, sports analytics, robotics, epidemiology, and general time series mining, but it is not used in non-destructive testing (NDT) and condition monitoring (SHM) systems of wire ropes. The code of the classic DTW algorithm and examples of its use are currently available in the following software:  
* Matlab [56; 57; 58; 59];
* C++ [60];
* R--package dtw described in [61];
* Python--dtw-python package [62], which is a clone of the _dtw_ package from R. Python also includes the fastdtw [63; 64] package (installation: pip install fastdtw), which is time-optimized and, for a window of 10,000 data points, is over 200 times faster than the classic DTW, with no information about the quality of time series fitting. The Fast DTW algorithm is also available in Java [60; 65].