Day 12 - Speech Recognition Algorithm:- DYNAMIC TIME WARPING (DTW) in Python
Hello guys,
This is Day 12 of my #100DaysOfMLCode challenge. Today I am sharing an algorithm named as DYNAMIC TIME WARPING (DTW). Let's see, what is DTW -
The simplest way to recognize an isolated word sample is to compare it against a number of stored word templates and determine which the “best match” is. This goal is complicated by a number of factors. First, different samples of a given word will have somewhat different durations. This problem can be eliminated by simply normalizing the templates and the unknown speech so that they all have an equal duration. However, another problem is that the rate of speech may not be constant throughout the word; in other words, the optimal alignment between a template and the speech sample may be nonlinear. Dynamic Time Warping (DTW) is an efficient method for finding this optimal nonlinear alignment. Dynamic time warping (DTW) is a well-known technique to find an optimal alignment between two given (time-dependent) sequences under certain restrictions intuitively; the sequences are warped in a nonlinear fashion to match each other. Originally, DTW has been used to compare different Speech patterns in automatic speech recognition. In fields such as data mining and information retrieval, DTW has been successfully applied to automatically cope with time deformations and different speeds associated with time-dependent data. In time series analysis, dynamic time warping (DTW) is an algorithm for measuring the similarity between two temporal sequences which may vary in time or speed. For instance, similarities in walking patterns could be detected using DTW, even if one person was walking faster than the other can also be detected by DTW. The problem of finding an average sequence for a set of sequences. The average sequence is the sequence that minimizes the sum of the squares to the set of objects.
Python Code -
Output -
Thanks.
Happy Coding.