# Localization of LHD Machines in Underground Conditions Using IMU Sensors and DTW Algorithm
## 3 Materials and Methods  
The purpose of the method is to parameterize road sections in the underground mine where the mining vehicle is moving. It comes down to the classification of signal fragments into groups corresponding to different types of road sections. The distinguishable fragments of the road will generally correspond to the type, profile, and condition of the road surface. The type and origin of the signal cause a number of the previously described phenomena, where the signal fragments corresponding to the same road segments arenot identical. The main problem with this is the varying signal length. This problem is typical of the study of time series. Altogether, our efforts are related to the identification of similarity in signals (or their segments) and is commonly known in the literature as the time series matching approach. An overview of typical methods is presented in [42]. The most popular approach to measuring the similarity/dissimilarity between two time series is to estimate the Euclidean distance on the transformed representation. The method of signal similarity analysis, resistant to above the mentioned phenomenon, is Dynamic Time Warping (DTW). The problem of detecting patterns in time series has been a current topic for a long time. This is related to the growing popularity of collecting data, a large part of which is inherently temporal data. The authors of [43] emphasized the importance of this problem, whilst also showing that DTW is a good solution. In particular, for years, scientists have been very interested in the topic of human speech recognition [44]. A signal record of each spoken word may be a pattern. These patterns can then be used to recognize words throughout a sentence. However, it is known that words are spoken at different speeds, which shows the need to use a method that is resistant to different pattern lengths. Many different ideas using DTW for this purpose can be found in the literature. For example, the authors of [45] describe the combination of this method with the Mel Frequency Cepstral Coefficient. Another idea for recognizing human speech is to use the Hidden Markov Model (HMM) [46]. In addition to human speech, a similar interesting topic is the use of DTW to recognize bird voices [47]. The obvious next step in recognizing patterns in signals is to use an appropriate classification or clustering method to automatically group similar signal segments corresponding to the same patterns. There are many examples in the literature that combine the DTW algorithm with various machine learning methods. The use of DTW with fuzzy clustering can be found in [48]. Another innovative idea is to connect DTW with neural networks [49]. In line with DTW, other methods are also commonly used, which work better or worse in specific applications. One idea is to use a measure of similarity when comparing time series. In the simplest case, the Euclidean distance is usually used for this purpose. For \(X\), \(Y\) signals of length \(n\), the Euclidean distance can be expressed by the following formula:  
\[D(X,Y)=\sqrt{\sum_{i=1}^{n}(X(i)-Y(i))^{2}}.\]  
However, this measure has limitations in further applications. It requires both signals to be of the same length and it is not immune to time shifts. The signals are compared at the same points in time. If the patterns are of different lengths, this method will not work properly--it will not show their similarity. In this case, the so-called elastic distance measures seem to be better methods. One such method is the Longest Common Subsequence (LCSS) [50]. The method was initially developed for discrete variables. Here, the method is to find the longest string of repeating symbols [51]. It is assumed that the symbols in the sequence need not be adjacent to each other. For the extension to continuous variables, a constant threshold value is introduced, which means whether the given two values fit together. The advantage of this method is noise immunity [50].