Skip to content

Commit

Permalink
Update MFCC + DTW.ipynb
Browse files Browse the repository at this point in the history
  • Loading branch information
pierre-rouanet committed Jul 13, 2017
1 parent 1270753 commit 307fe72
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/MFCC + DTW.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@
"cell_type": "code",
"collapsed": false,
"input": [
"dist, cost, path = dtw(mfcc1.T, mfcc2.T)\n",
"from numpy.linalg import norm\n",
"dist, cost, path = dtw(mfcc1.T, mfcc2.T, dist=lambda x, y: norm(x - y, ord=1))\n",
"print 'Normalized distance between the two sounds:', dist"
],
"language": "python",
Expand Down Expand Up @@ -170,4 +171,4 @@
"metadata": {}
}
]
}
}

2 comments on commit 307fe72

@Pen0201
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I use this code and got error:
dist, cost, path = dtw(mfcc1.T, mfcc2.T, dist=lambda x, y: norm(x - y, ord=1))

ValueError: too many values to unpack (expected 3)

@aoliveir1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Pen0201 try:
dist, cost, acc_cost, path = dtw(mfcc1.T, mfcc2.T, dist=lambda x, y: norm(x - y, ord=1))

like this
https://github.com/pierre-rouanet/dtw/blob/master/examples/MFCC%20%2B%20DTW.ipynb

Please sign in to comment.