Commit cde201cc authored by Sushil Bhattacharjee's avatar Sushil Bhattacharjee

Merge branch 'master' of gitlab.idiap.ch:master-biometrics/04-lab-speaker

parents 463395f7 71df5dc0
Pipeline #24353 failed with stage
in 2 seconds
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -14,7 +14,7 @@
},
{
"cell_type": "code",
"execution_count": 46,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
......@@ -38,7 +38,7 @@
},
{
"cell_type": "code",
"execution_count": 44,
"execution_count": 8,
"metadata": {
"scrolled": false
},
......@@ -104,7 +104,7 @@
" for x in fourier_cf])))\n",
"\n",
"# compute the Fourier using numpy's built in function\n",
"fourier_cf_numpy = numpy.fft.fft(signal)\n",
"fourier_cf_numpy = numpy.fft.fft(signal, n_samples)\n",
"print('Fourier coeffficients with numpy implementation: \\n {0}'.format(fourier_cf_numpy))\n",
"\n",
"# plot the result of our Fourier transform\n",
......@@ -121,8 +121,8 @@
"# plot the result of numpy implementation of Fourier transform\n",
"plt.subplot(1, 2, 2)\n",
"plt.title('numpy implementation of Fourier transform')\n",
"plt.plot(freq, fourier_cf_numpy.real, label=\"real\")\n",
"plt.plot(freq, fourier_cf_numpy.imag, label=\"imag\")\n",
"plt.plot(range(0, n_samples), fourier_cf_numpy.real, label=\"real\")\n",
"plt.plot(range(0, n_samples), fourier_cf_numpy.imag, label=\"imag\")\n",
"plt.legend(loc=1)\n",
"\n",
"plt.show()"
......
{
"cells": [
{
"attachments": {},
"cell_type": "markdown",
"metadata": {},
"source": [
"# From signal to spectrum/spectrogram\n",
"\n",
"In this excerise, for a given audio signal, we compute spectrum and spectrogram step by step. We present all processing steps that are usually performed to compute a spectrogram. Here are the steps:\n",
"In this notebook, for a given audio signal, we compute spectrum and spectrogram step by step. The typical processing steps for computing spectrum (as part of computing MFCC features) are shown on this figure: \n",
"\n",
"![](figures/spectrum-diagram.png)\n",
"\n",
"Here are the steps in details:\n",
"\n",
"1. Read the audio signal from WAV file\n",
"2. Compute the number of overlapping windows based on the desired window size and the overlapping length\n",
......
......@@ -10,8 +10,15 @@
"\n",
"The Mel-scale aims to mimic the non-linear human ear perception of sound, by being more discriminative at lower frequencies and less discriminative at higher frequencies. \n",
"\n",
"In this notebook, starting from spectrum, we finish computing MFCC features by performing the steps illustrated in this figure:\n",
"\n",
"\n"
"![](figures/mfcc-diagram.png)\n",
"\n",
"Here are the steps in more details:\n",
"\n",
"1. Build the Mel-scale filters (number of filters ``num_mel_filters`` is a parameter you can change) that would cover the length of the spectrum.\n",
"2. Multiply spectrum of each window by these Mel-scaled filters.\n",
"3. For each window, apply discrete cosine transform (DCT) on the filtered result and take the first ``num_mfcc`` values. These values are the MFCC features we were trying to compute."
]
},
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment