Skip to content

Commit 91592ad

Browse files
committed
Modified notebook video 20
1 parent 0315718 commit 91592ad

File tree

1 file changed

+47
-17
lines changed

1 file changed

+47
-17
lines changed

20- Extracting MFCCs with Python/Extracting MFCCs.ipynb

+47-17
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22
"cells": [
33
{
44
"cell_type": "code",
5-
"execution_count": 4,
5+
"execution_count": 1,
66
"metadata": {},
77
"outputs": [],
88
"source": [
99
"import librosa\n",
1010
"import librosa.display\n",
1111
"import IPython.display as ipd\n",
12-
"import matplotlib.pyplot as plt"
12+
"import matplotlib.pyplot as plt\n",
13+
"import numpy as np"
1314
]
1415
},
1516
{
@@ -21,7 +22,7 @@
2122
},
2223
{
2324
"cell_type": "code",
24-
"execution_count": 5,
25+
"execution_count": 2,
2526
"metadata": {},
2627
"outputs": [],
2728
"source": [
@@ -30,7 +31,7 @@
3031
},
3132
{
3233
"cell_type": "code",
33-
"execution_count": 6,
34+
"execution_count": 3,
3435
"metadata": {},
3536
"outputs": [
3637
{
@@ -47,18 +48,18 @@
4748
"<IPython.lib.display.Audio object>"
4849
]
4950
},
50-
"execution_count": 6,
51+
"execution_count": 3,
5152
"metadata": {},
5253
"output_type": "execute_result"
5354
}
5455
],
5556
"source": [
56-
"ipd.Audio(scale_file)"
57+
"ipd.Audio(audio_file)"
5758
]
5859
},
5960
{
6061
"cell_type": "code",
61-
"execution_count": 9,
62+
"execution_count": 4,
6263
"metadata": {},
6364
"outputs": [],
6465
"source": [
@@ -75,7 +76,7 @@
7576
},
7677
{
7778
"cell_type": "code",
78-
"execution_count": 17,
79+
"execution_count": 5,
7980
"metadata": {},
8081
"outputs": [],
8182
"source": [
@@ -84,7 +85,7 @@
8485
},
8586
{
8687
"cell_type": "code",
87-
"execution_count": 18,
88+
"execution_count": 6,
8889
"metadata": {},
8990
"outputs": [
9091
{
@@ -93,7 +94,7 @@
9394
"(13, 1292)"
9495
]
9596
},
96-
"execution_count": 18,
97+
"execution_count": 6,
9798
"metadata": {},
9899
"output_type": "execute_result"
99100
}
@@ -111,7 +112,7 @@
111112
},
112113
{
113114
"cell_type": "code",
114-
"execution_count": 21,
115+
"execution_count": 7,
115116
"metadata": {},
116117
"outputs": [
117118
{
@@ -145,7 +146,7 @@
145146
},
146147
{
147148
"cell_type": "code",
148-
"execution_count": 22,
149+
"execution_count": 8,
149150
"metadata": {},
150151
"outputs": [],
151152
"source": [
@@ -154,7 +155,7 @@
154155
},
155156
{
156157
"cell_type": "code",
157-
"execution_count": 24,
158+
"execution_count": 9,
158159
"metadata": {},
159160
"outputs": [],
160161
"source": [
@@ -163,7 +164,7 @@
163164
},
164165
{
165166
"cell_type": "code",
166-
"execution_count": 25,
167+
"execution_count": 10,
167168
"metadata": {},
168169
"outputs": [
169170
{
@@ -172,7 +173,7 @@
172173
"(13, 1292)"
173174
]
174175
},
175-
"execution_count": 25,
176+
"execution_count": 10,
176177
"metadata": {},
177178
"output_type": "execute_result"
178179
}
@@ -183,7 +184,7 @@
183184
},
184185
{
185186
"cell_type": "code",
186-
"execution_count": 26,
187+
"execution_count": 11,
187188
"metadata": {},
188189
"outputs": [
189190
{
@@ -210,7 +211,7 @@
210211
},
211212
{
212213
"cell_type": "code",
213-
"execution_count": 27,
214+
"execution_count": 12,
214215
"metadata": {},
215216
"outputs": [
216217
{
@@ -235,6 +236,35 @@
235236
"plt.show()"
236237
]
237238
},
239+
{
240+
"cell_type": "code",
241+
"execution_count": 13,
242+
"metadata": {},
243+
"outputs": [],
244+
"source": [
245+
"mfccs_features = np.concatenate((mfccs, delta_mfccs, delta2_mfccs))"
246+
]
247+
},
248+
{
249+
"cell_type": "code",
250+
"execution_count": 14,
251+
"metadata": {},
252+
"outputs": [
253+
{
254+
"data": {
255+
"text/plain": [
256+
"(39, 1292)"
257+
]
258+
},
259+
"execution_count": 14,
260+
"metadata": {},
261+
"output_type": "execute_result"
262+
}
263+
],
264+
"source": [
265+
"mfccs_features.shape"
266+
]
267+
},
238268
{
239269
"cell_type": "code",
240270
"execution_count": null,

0 commit comments

Comments
 (0)