What is the distance metric in dynamic time warping? I am reading the lecture slides from this site http://luthuli.cs.uiuc.edu/~daf/courses/CS-498-DAF-P/Lecture%2018%20-%20Time%20series,%20DTW.pdf

In slide 24, the lecture suggest using metric of the following

d(i, j) = ||f(i) - f(j)||

select top frequency in i and top frequency in j, 
    find the Euclidean distance between the two


I am not exactly sure what do they mean by Euclidean distance between the two.

Did they meant to have top n frequency sorted in order and match the order for subtraction and find the euclidean distance?

For example 

f1 = [1, 2, 3, 4]

f2 = [1, 100, 200 ,300]


d(1,2) = |1-1| + |100-2| + |200-3| + |300-4|


Any help would be appreciated

Thanks
The Euclidean distance between two vectors $\mathbf a$ and $\mathbf b$ is $\mathrm d(\mathbf a, \mathbf b) \equiv \sqrt {\sum_i (a_i - b_i)^2}$

In your example you forgot to square the differences. Remember the way you calculate hypotenuse of a triangle; it's the same idea.