I will answer your questions in reverse order.
4: DTW (Dynamic Time Warping) is not a library but an algorithm. It allows aligning two sequences by warping them in time. You can use it for pretty much any kind of sequential data, for which a metric (distance) can be defined. Generally, you calculate a distance between each and every point of both sequences and produce a big matrix of accumulated distances. In the end, a path that produces the smallest final cost is selected as the optimal.
Here is an example of two 1D signals:
x1 is an exponential sweep sine and
x2 is a sinusoid with a constant frequency. The goal is to warp the
x2 in time so it would match the
x1 as close as possible. The figure below shows the outcome of such alignment. The signal
x2 had been stretched so that it matches
x2 is shorter than
x1, hence it had to be padded towards the end. The subplot at the bottom shows the evolution of the distance for each frame, where the final value is the accumulated cost - the very thing that you are using in your comparison. From this example, you can immediately see some limitations of the DTW.
Just to wrap up, here is the full DTW matrix together with the optimal path.
3 & 2: It's a distance, so the lower the better. The lowest possible distance is $0$, which can be achieved when:
- Both signals are exactly the same
- One signal is the stretched version of the other one, such as
[0, -1, 0, 1, 0] and
[0, -1, 0, 0, 1, 1, 0].
1: As I've mentioned before, DTW compares the distance between each and every point and then accumulates the cost of all operations that lead up to that point - the path that will yield the minimal cost corresponds to the best alignment.
In terms of similarity, signals will be considered close to each other if stretching or squeezing certain parts will minimize the difference between the MFCC vectors for each frame.
These answers might be relevant for you: click, click, click.