audio-processing/processing.ipynb

219 lines
1.6 MiB
Plaintext
Raw Normal View History

{
"metadata": {
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.8.4-final"
},
"orig_nbformat": 2,
"kernelspec": {
"name": "python3",
"display_name": "Python 3",
"language": "python"
}
},
"nbformat": 4,
"nbformat_minor": 2,
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import numpy as np\n",
"\n",
"from scipy.io.wavfile import read\n",
"from scipy.fft import fft, fftfreq\n",
"\n",
"from IPython.display import Audio\n",
"\n",
"from math import log10\n",
"\n",
"import matplotlib.pyplot as plt"
]
},
{
"source": [
"# Audio Processing\n",
"\n",
"Playing around loading, visualising and processing speech"
],
"cell_type": "markdown",
"metadata": {}
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"16000"
]
},
"metadata": {},
"execution_count": 2
}
],
"source": [
"Fs, data = read('sounds/f-news.wav')\n",
"N = len(data)\n",
"\n",
"Fs"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"output_type": "execute_result",
"data": {
"text/plain": [
"<IPython.lib.display.Audio object>"
],
"text/html": "\n <audio controls=\"controls\" >\n <source src=\"data:audio/wav;base64,UklGRqRwBQBXQVZFZm10IBAAAAABAAEAgD4AAAB9AAACABAAZGF0YYBwBQDl+1D8zvyX/ST+E/80/w3/LP/Z/2wAAAADAJEAfgDWAE8BUQG1AIEAWwCy/3T/4v5h/rz+Y//c/1D/p/5Q/sX9kPwp+2X64fqS+1v8If2h/Tn+CP9J/yf/yf9bACUB/QGjAfcA4wCHAPP/rf9sAA0CawNVA0EDegMgBDYFkAUdBbMEawR3A7MDTAOvAjMCIQLdAtUBoQFFAbQAGAA+/2792PyJ/F/8MvxW/Mb8L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heLEzoV6RVXFhAXgxU+FuAWDBQtFAAN0QidCNr+dfUu78zm0N8Z1hrPYskmwy7ABsEYxKTDt8lT0KDX99/b5UnsiPbc/dMDyQbACr0OgA/cEYUSyxBJER8TIhMEFSUXuhc7GVAcZRw8GhwbQhruGO8VJxCADMYLKQp0Bg8FxQOxAl8E6wR3CMUJ5Ap9D40T+xR2FWQYWhhEF14U4g14CTQFBgDD9Zns6eQR27HUU80mxeO/ib7IvffBNsZwyj7SRttY4+ns/Pbn/cME/gzyEbgVjxfbF08YtRq2G8UYWxnfGpMcKR7gGyEbUxq7HZIb8ReGFrYSXg81CTwFVgE9/sL9vPsB/Gr/5v+TAkcG9QmLDkUSmxcCHRceOCBdIU4aHBWnDjEFwftW79bgntXYz5zFjLzmt6G1HLRQtg2+7MIRyuHSa9yr55vzavxkAbsJPRIQFmcWQBiQGb8anxtWGSsYrxhOHJ8dRBwdHOManBtZGigY
},
"metadata": {},
"execution_count": 3
}
],
"source": [
"Audio(data, rate=Fs)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": "<Figure size 432x288 with 1 Axes>",
"image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\r\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n<!-- Created with matplotlib (https://matplotlib.org/) -->\r\n<svg height=\"277.314375pt\" version=\"1.1\" viewBox=\"0 0 410.070312 277.314375\" width=\"410.070312pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n <metadata>\r\n <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\r\n <cc:Work>\r\n <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\r\n <dc:date>2021-01-24T13:51:10.404262</dc:date>\r\n <dc:format>image/svg+xml</dc:format>\r\n <dc:creator>\r\n <cc:Agent>\r\n <dc:title>Matplotlib v3.3.3, https://matplotlib.org/</dc:title>\r\n </cc:Agent>\r\n </dc:creator>\r\n </cc:Work>\r\n </rdf:RDF>\r\n </metadata>\r\n <defs>\r\n <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\r\n </defs>\r\n <g id=\"figure_1\">\r\n <g id=\"patch_1\">\r\n <path d=\"M 0 277.314375 \r\nL 410.070312 277.314375 \r\nL 410.070312 0 \r\nL 0 0 \r\nz\r\n\" style=\"fill:none;\"/>\r\n </g>\r\n <g id=\"axes_1\">\r\n <g id=\"patch_2\">\r\n <path d=\"M 68.070312 239.758125 \r\nL 402.870313 239.758125 \r\nL 402.870313 22.318125 \r\nL 68.070312 22.318125 \r\nz\r\n\" style=\"fill:#ffffff;\"/>\r\n </g>\r\n <g id=\"matplotlib.axis_1\">\r\n <g id=\"xtick_1\">\r\n <g id=\"line2d_1\">\r\n <defs>\r\n <path d=\"M 0 0 \r\nL 0 3.5 \r\n\" id=\"mcfff5275ed\" style=\"stroke:#000000;stroke-width:0.8;\"/>\r\n </defs>\r\n <g>\r\n <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"83.288494\" xlink:href=\"#mcfff5275ed\" y=\"239.758125\"/>\r\n </g>\r\n </g>\r\n <g id=\"text_1\">\r\n <!-- 0 -->\r\n <g transform=\"translate(80.107244 254.356562)scale(0.1 -0.1)\">\r\n <defs>\r\n <path d=\"M 31.78125 66.40625 \r\nQ 24.171875 66.40625 20.328125 58.90625 \r\nQ 16.5 51.421875 16.5 36.375 \r\nQ 16.5 21.390625 20.328125 13.890625 \r\nQ 24.171875 6.390625 31.78125 6.390625 \r\nQ 39.453125 6.390625 43.28125 13.890625 \r\nQ 47.125 21.390625 47.125 36.375 \r\nQ 47.125 51.421875 43.28125 58.90625 \r\nQ 39.453125 66.40625 31.78125 66.40625 \r\nz\r\nM 31.78125 74.21875 \r\nQ 44.046875 74.21875 50.515625 64.515625 \r\nQ 56.984375 54.828125 56.984375 36.375 \r\nQ 56.984375 17.96875 50.515625 8.265625 \r\nQ 44.046875 -1.421875 31.78125 -1.421875 \r\nQ 19.53125 -1.421875 13.0625 8.265625 \r\nQ 6.59375 17.96875 6.59375 36.375 \r\nQ 6.59375 54.828125 13.0625 64.515625 \r\nQ 19.53125 74.21875 31.78125 74.21875 \r\nz\r\n\" id=\"DejaVuSans-48\"/>\r\n </defs>\r\n <use xlink:href=\"#DejaVuSans-48\"/>\r\n </g>\r\n </g>\r\n </g>\r\n <g id=\"xtick_2\">\r\n <g id=\"line2d_2\">\r\n <g>\r\n <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"137.932183\" xlink:href=\"#mcfff5275ed\" y=\"239.758125\"/>\r\n </g>\r\n </g>\r\n <g id=\"text_2\">\r\n <!-- 2 -->\r\n <g transform=\"translate(134.750933 254.356562)scale(0.1 -0.1)\">\r\n <defs>\r\n <path d=\"M 19.1875 8.296875 \r\nL 53.609375 8.296875 \r\nL 53.609375 0 \r\nL 7.328125 0 \r\nL 7.328125 8.296875 \r\nQ 12.9375 14.109375 22.625 23.890625 \r\nQ 32.328125 33.6875 34.8125 36.53125 \r\nQ 39.546875 41.84375 41.421875 45.53125 \r\nQ 43.3125 49.21875 43.3125 52.78125 \r\nQ 43.3125 58.59375 39.234375 62.25 \r\nQ 35.15625 65.921875 28.609375 65.921875 \r\nQ 23.96875 65.921875 18.8125 64.3125 \r\nQ 13.671875 62.703125 7.8125 59.421875 \r\nL 7.8125 69.390625 \r\nQ 13.765625 71.78125 18.9375 73 \r\nQ 24.125 74.21875 28.421875 74.21875 \r\nQ 39.75 74.21875 46.484375 68.546875 \r\nQ 53.21875 62.890625 53.21875 53.421875 \r\nQ 53.21875 48.921875 51.53125 44.890625 \r\nQ 49.859375 40.875 45.40625 35.40625 \r\nQ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YoeU+sTtn7hpHcMnxW/M6GYfiCKZocMPXb9YEef+Pm7QCsNDfqhEiSbc9O+CZnchhGdcQUTQ4Y8vwXrNy4OfDzfLt2U+DnKFS27zTzmGGEhSmaHLF+07bAjr1iQ0SJTVu8PrBzFDr3vz8PsDx0hhEGpmiKABuse6d85fe+HOexjxYwapbltDMML4SqaETkCRFZKSIzXW3NRGS0iMxz/jZ12kVEHhCRchGZISK9XPsMdvrPE5HBrvZDRORLZ58HRCSZqd6oBkS9zbLlthGzufrZKb4cyzCKnbBnNE8BA2PahgLvq2pX4H3nM8BJQFfndRXwEEQUE3ArcBjQG7g1qpycPle69os9l2EYhhEwoSoaVf0QWBvTPAh42nn/NHCGq/0ZjTABaCIibYEBwGhVXauq64DRwEBnWyNVnaCRQIlnXMcykrBjp3LwX97jo3mrwhYl7xk7d2XYIhhG3hP2jCYerVV1mfN+OdDaed8OWOzqV+G0JWuviNNeBRG5SkQmi8jkVauCebg+8fFCZlSsD+TYfvLZ/DV0vmEk6zZt4+LHPw9bnLxnZsV3YYtgGHlPPiqaXTgzkcCXulX1EVUtU9Wyli1bBnKOYZMWc/q/P0lrn3tGf83Ub9el7OenR9u7M5el7mTs4mufnAsMo5jJR0WzwjF74fyN2iaWAB1c/do7bcna28dpLxgeeH8eP/nPpyn7PTfRv4DDmUs3+HasYsVS1hhGeuSjonkTiHqODQaGu9ovcbzP+gDfOSa2UcCJItLUcQI4ERjlbNsgIn0cb7NLXMcqLlI890bNWs6b05d6OtR3P1aeHX2z5odMpcp7SoeOyGi/FRt2Z2CYvcwUcxC8PWMpQ57/ImwxDJ8I2735BeAzoJuIVIjIFcAdwAkiMg843vkMMBJYAJQDjwK/AFDVtcBfgUnO6y9
},
"metadata": {
"needs_background": "light"
}
}
],
"source": [
"time_x = [i/Fs for i in range(N)] # samples to seconds\n",
"# data_db = [20 * log10(i/20e-6) for i in data]\n",
"\n",
"plt.plot(time_x, data)\n",
"plt.xlabel('Seconds')\n",
"plt.ylabel('Amplitude')\n",
"plt.title('Audio Waveform')\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 5,
"metadata": {},
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": "<Figure size 432x288 with 1 Axes>",
"image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\r\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n<!-- Created with matplotlib (https://matplotlib.org/) -->\r\n<svg height=\"277.314375pt\" version=\"1.1\" viewBox=\"0 0 395.328125 277.314375\" width=\"395.328125pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n <metadata>\r\n <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\r\n <cc:Work>\r\n <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\r\n <dc:date>2021-01-24T13:51:11.101259</dc:date>\r\n <dc:format>image/svg+xml</dc:format>\r\n <dc:creator>\r\n <cc:Agent>\r\n <dc:title>Matplotlib v3.3.3, https://matplotlib.org/</dc:title>\r\n </cc:Agent>\r\n </dc:creator>\r\n </cc:Work>\r\n </rdf:RDF>\r\n </metadata>\r\n <defs>\r\n <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\r\n </defs>\r\n <g id=\"figure_1\">\r\n <g id=\"patch_1\">\r\n <path d=\"M 0 277.314375 \r\nL 395.328125 277.314375 \r\nL 395.328125 0 \r\nL 0 0 \r\nz\r\n\" style=\"fill:none;\"/>\r\n </g>\r\n <g id=\"axes_1\">\r\n <g id=\"patch_2\">\r\n <path d=\"M 53.328125 239.758125 \r\nL 388.128125 239.758125 \r\nL 388.128125 22.318125 \r\nL 53.328125 22.318125 \r\nz\r\n\" style=\"fill:#ffffff;\"/>\r\n </g>\r\n <g clip-path=\"url(#p28e3cf6984)\">\r\n <image height=\"218\" id=\"image62157d9453\" transform=\"scale(1 -1)translate(0 -218)\" width=\"335\" x=\"53.328125\" xlink:href=\"data:image/png;base64,\r\niVBORw0KGgoAAAANSUhEUgAAAU8AAADaCAYAAAAmEcC2AAEAAElEQVR4nJz92ZIkyZIliB1hEVFVW3yJJe9WVV29VGNAQ3gB4W1+BF+APwXhAa8YEAFDvWC66tZdMjMi3N3MdJGF8cDMomIecXsIUKLIyHC3RVUWFubDhw+7//P/7f/CAHDwCaewAgC+pQMuaURlwlY9KjuQ4/YnuILBFxAYp7BhpIy5RLzlEbkS3tKEt3WEc4zfn17x03TBXCJ+Wc6Yc8TDsOLTeEVhh//y8hm/vJ4wDBn/9PEX/O7wBrsKO3zdjnjdJgDA47BgoILMhFsekCvp/VSQqziGhINP+E+vn/Hf/uffY/yVMP8h4x/+w894nmYMlDFQAQBkJlR2mHxuz/1//9M/4uVfnsCO4Z83HI8rTuOG359ecQwJlzTiLY2o7DD6jMEXrDng63LAmgLO04qfDlcMPmPyCSMVfN0O+H/++fdYXkegOqA4AMDh8w3/9tMXDFQQqLSxPfgEAPi//pf/gOH/cYRj4PpvM55//4ppSPj96RXnuOKP12f88y/PqMXj8eGG35wvKEz49XrEskWcDyv+/fOveAgrIhUEJ88dnXxXYo9rlmexKzHhP798xq+vJxAxYigIvuAQMz4ebiAwlhKwliDzUwkAQI7h9P5T8diKrJk1BZRKKIWwrQFcHMJQMB02AMCyROQtwIeKT88XPIwrciVsxaNUwpY9thywrQH1Xw8YvhG254rhHy94PC64bRHLPKBkAn4eMbwQ0kPF8G8v+Hi+tediALd1wJoCvK/4cJxxjBtYn73CIVdCKh4MYEkBuXhcLhPoXyb41WH7dwv+p3/6L3iMCy55wFIiXrcJf3x5wrpEHA4bfvNwgXcVb9uIeYtwjhF9hXOM0Rcc4wZyjLUErFnG0Ma/sMOWPZjlXkqRsXUO+jkFH44z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32eRX0YSLdJ1vDz1eONyvnhxm+ciCdBZ2U6kpIJ7X3Oo5dSOfU1yd+32chbSbYYg0cvww3XzSNe34ilKOQdmW6NwOkZnuHqcDt51YOX3hBeXLk5U++4fxU/N3aRdKupN2uWQ7+DmZb3yRIZ9+LBaZ7ZTq
},
"metadata": {
"needs_background": "light"
}
}
],
"source": [
"plt.specgram(data[0: 1 *Fs], Fs=Fs)\n",
"plt.xlabel('Seconds')\n",
"plt.ylabel('Frequency')\n",
"plt.title('Audio Spectrogram')\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 6,
"metadata": {},
"outputs": [
{
"output_type": "display_data",
"data": {
"text/plain": "<Figure size 432x288 with 1 Axes>",
"image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\r\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n<!-- Created with matplotlib (https://matplotlib.org/) -->\r\n<svg height=\"277.314375pt\" version=\"1.1\" viewBox=\"0 0 388.965625 277.314375\" width=\"388.965625pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n <metadata>\r\n <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\r\n <cc:Work>\r\n <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\r\n <dc:date>2021-01-24T13:51:11.716259</dc:date>\r\n <dc:format>image/svg+xml</dc:format>\r\n <dc:creator>\r\n <cc:Agent>\r\n <dc:title>Matplotlib v3.3.3, https://matplotlib.org/</dc:title>\r\n </cc:Agent>\r\n </dc:creator>\r\n </cc:Work>\r\n </rdf:RDF>\r\n </metadata>\r\n <defs>\r\n <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\r\n </defs>\r\n <g id=\"figure_1\">\r\n <g id=\"patch_1\">\r\n <path d=\"M 0 277.314375 \r\nL 388.965625 277.314375 \r\nL 388.965625 0 \r\nL 0 0 \r\nz\r\n\" style=\"fill:none;\"/>\r\n </g>\r\n <g id=\"axes_1\">\r\n <g id=\"patch_2\">\r\n <path d=\"M 46.965625 239.758125 \r\nL 381.765625 239.758125 \r\nL 381.765625 22.318125 \r\nL 46.965625 22.318125 \r\nz\r\n\" style=\"fill:#ffffff;\"/>\r\n </g>\r\n <g id=\"matplotlib.axis_1\">\r\n <g id=\"xtick_1\">\r\n <g id=\"line2d_1\">\r\n <defs>\r\n <path d=\"M 0 0 \r\nL 0 3.5 \r\n\" id=\"m6e3f11e783\" style=\"stroke:#000000;stroke-width:0.8;\"/>\r\n </defs>\r\n <g>\r\n <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"62.183807\" xlink:href=\"#m6e3f11e783\" y=\"239.758125\"/>\r\n </g>\r\n </g>\r\n <g id=\"text_1\">\r\n <!-- 0 -->\r\n <g transform=\"translate(59.002557 254.356562)scale(0.1 -0.1)\">\r\n <defs>\r\n <path d=\"M 31.78125 66.40625 \r\nQ 24.171875 66.40625 20.328125 58.90625 \r\nQ 16.5 51.421875 16.5 36.375 \r\nQ 16.5 21.390625 20.328125 13.890625 \r\nQ 24.171875 6.390625 31.78125 6.390625 \r\nQ 39.453125 6.390625 43.28125 13.890625 \r\nQ 47.125 21.390625 47.125 36.375 \r\nQ 47.125 51.421875 43.28125 58.90625 \r\nQ 39.453125 66.40625 31.78125 66.40625 \r\nz\r\nM 31.78125 74.21875 \r\nQ 44.046875 74.21875 50.515625 64.515625 \r\nQ 56.984375 54.828125 56.984375 36.375 \r\nQ 56.984375 17.96875 50.515625 8.265625 \r\nQ 44.046875 -1.421875 31.78125 -1.421875 \r\nQ 19.53125 -1.421875 13.0625 8.265625 \r\nQ 6.59375 17.96875 6.59375 36.375 \r\nQ 6.59375 54.828125 13.0625 64.515625 \r\nQ 19.53125 74.21875 31.78125 74.21875 \r\nz\r\n\" id=\"DejaVuSans-48\"/>\r\n </defs>\r\n <use xlink:href=\"#DejaVuSans-48\"/>\r\n </g>\r\n </g>\r\n </g>\r\n <g id=\"xtick_2\">\r\n <g id=\"line2d_2\">\r\n <g>\r\n <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"100.229688\" xlink:href=\"#m6e3f11e783\" y=\"239.758125\"/>\r\n </g>\r\n </g>\r\n <g id=\"text_2\">\r\n <!-- 1000 -->\r\n <g transform=\"translate(87.504688 254.356562)scale(0.1 -0.1)\">\r\n <defs>\r\n <path d=\"M 12.40625 8.296875 \r\nL 28.515625 8.296875 \r\nL 28.515625 63.921875 \r\nL 10.984375 60.40625 \r\nL 10.984375 69.390625 \r\nL 28.421875 72.90625 \r\nL 38.28125 72.90625 \r\nL 38.28125 8.296875 \r\nL 54.390625 8.296875 \r\nL 54.390625 0 \r\nL 12.40625 0 \r\nz\r\n\" id=\"DejaVuSans-49\"/>\r\n </defs>\r\n <use xlink:href=\"#DejaVuSans-49\"/>\r\n <use x=\"63.623047\" xlink:href=\"#DejaVuSans-48\"/>\r\n <use x=\"127.246094\" xlink:href=\"#DejaVuSans-48\"/>\r\n <use x=\"190.869141\" xlink:href=\"#DejaVuSans-48\"/>\r\n </g>\r\n </g>\r\n </g>\r\n <g id=\"xtick_3\">\r\n <g id=\"line2d_3\">\r\n <g>\r\n <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"138.27557\" xlink:href=\"#m6e3f11e783\" y=\"239.758125\"/>\r\n </g>\r\n
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAYUAAAEWCAYAAACJ0YulAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAAApwUlEQVR4nO3dd5xU9b3/8ddHepGOghTBgjUWJEZCigaDBk30l6j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hKjpFBLSVnN6Sw0JFVEsomSQi2VrjQgItlLSaER6mgWkWyipCAiIjFKCrXUVzOwevZMWZibumBERNJMSaGWZ+blNOn4nz+5MDWBiIhEQEmhlo/W7Yg6BBGRyESSFMysl5k9a2bLzWyZmY02sz5mNsPMVoU/e0cRm4hINouqpnA38Kq7HwucDCwDJgIz3f1oYGa4LiIiaZT2pGBmPYEvAA8DuHuZu+8CLgAmhYdNAi5Md2wiItmu0aRgZl3N7HozezBcP9rMzm9BmcOBAuARM1tgZg+ZWTfgUHfPC4/ZAhxaTzxXm9lcM5tbUFDQgjBERKS2RGoKjwClwOhwPRe4uQVltgdGAve5+6lAMbWaitzdqWeGCXd/wN1Hufuo/v37tyAMERGpLZGkcKS7/wkoB3D3Elp2oW8OkOPuH4brzxIkia1mNhAg/JnfgjKSxnRJs4hkkUSSQpmZdSH85m5mRxLUHJrF3bcAm8zsmHDTWOATYCowIdw2AZjS3DJERKR52idwzA3Aq8AQM3scGANc0cJyfwo8bmYdgbXAlQQJ6mkzuwrYAFzSwjKSonp+vFX5hdEGIiKSBo0mBXefYWbzgTMImo1+7u7bWlKouy8ERtW
},
"metadata": {
"needs_background": "light"
}
}
],
"source": [
"spectrum = np.abs(np.fft.rfft(data)[:int(N/2)]/N)\n",
"frequency_x = np.fft.rfftfreq(data.size, d=1/Fs)[:int(N/2)]\n",
"\n",
"plt.plot(frequency_x, spectrum)\n",
"plt.xlabel('Frequency')\n",
"plt.ylabel('Amplitude')\n",
"plt.title('Audio Spectrum')\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [
{
"output_type": "stream",
"name": "stdout",
"text": [
"x: 89120, cep: 44561\n"
]
},
{
"output_type": "display_data",
"data": {
"text/plain": "<Figure size 432x288 with 1 Axes>",
"image/svg+xml": "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\r\n<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\r\n \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\r\n<!-- Created with matplotlib (https://matplotlib.org/) -->\r\n<svg height=\"277.314375pt\" version=\"1.1\" viewBox=\"0 0 410.070312 277.314375\" width=\"410.070312pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\r\n <metadata>\r\n <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\r\n <cc:Work>\r\n <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\r\n <dc:date>2021-01-24T13:52:11.288376</dc:date>\r\n <dc:format>image/svg+xml</dc:format>\r\n <dc:creator>\r\n <cc:Agent>\r\n <dc:title>Matplotlib v3.3.3, https://matplotlib.org/</dc:title>\r\n </cc:Agent>\r\n </dc:creator>\r\n </cc:Work>\r\n </rdf:RDF>\r\n </metadata>\r\n <defs>\r\n <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\r\n </defs>\r\n <g id=\"figure_1\">\r\n <g id=\"patch_1\">\r\n <path d=\"M 0 277.314375 \r\nL 410.070312 277.314375 \r\nL 410.070312 0 \r\nL 0 0 \r\nz\r\n\" style=\"fill:none;\"/>\r\n </g>\r\n <g id=\"axes_1\">\r\n <g id=\"patch_2\">\r\n <path d=\"M 68.070312 239.758125 \r\nL 402.870313 239.758125 \r\nL 402.870313 22.318125 \r\nL 68.070312 22.318125 \r\nz\r\n\" style=\"fill:#ffffff;\"/>\r\n </g>\r\n <g id=\"matplotlib.axis_1\">\r\n <g id=\"xtick_1\">\r\n <g id=\"line2d_1\">\r\n <defs>\r\n <path d=\"M 0 0 \r\nL 0 3.5 \r\n\" id=\"mac0a3a320e\" style=\"stroke:#000000;stroke-width:0.8;\"/>\r\n </defs>\r\n <g>\r\n <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"83.288494\" xlink:href=\"#mac0a3a320e\" y=\"239.758125\"/>\r\n </g>\r\n </g>\r\n <g id=\"text_1\">\r\n <!-- 0 -->\r\n <g transform=\"translate(80.107244 254.356562)scale(0.1 -0.1)\">\r\n <defs>\r\n <path d=\"M 31.78125 66.40625 \r\nQ 24.171875 66.40625 20.328125 58.90625 \r\nQ 16.5 51.421875 16.5 36.375 \r\nQ 16.5 21.390625 20.328125 13.890625 \r\nQ 24.171875 6.390625 31.78125 6.390625 \r\nQ 39.453125 6.390625 43.28125 13.890625 \r\nQ 47.125 21.390625 47.125 36.375 \r\nQ 47.125 51.421875 43.28125 58.90625 \r\nQ 39.453125 66.40625 31.78125 66.40625 \r\nz\r\nM 31.78125 74.21875 \r\nQ 44.046875 74.21875 50.515625 64.515625 \r\nQ 56.984375 54.828125 56.984375 36.375 \r\nQ 56.984375 17.96875 50.515625 8.265625 \r\nQ 44.046875 -1.421875 31.78125 -1.421875 \r\nQ 19.53125 -1.421875 13.0625 8.265625 \r\nQ 6.59375 17.96875 6.59375 36.375 \r\nQ 6.59375 54.828125 13.0625 64.515625 \r\nQ 19.53125 74.21875 31.78125 74.21875 \r\nz\r\n\" id=\"DejaVuSans-48\"/>\r\n </defs>\r\n <use xlink:href=\"#DejaVuSans-48\"/>\r\n </g>\r\n </g>\r\n </g>\r\n <g id=\"xtick_2\">\r\n <g id=\"line2d_2\">\r\n <g>\r\n <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"121.334803\" xlink:href=\"#mac0a3a320e\" y=\"239.758125\"/>\r\n </g>\r\n </g>\r\n <g id=\"text_2\">\r\n <!-- 500 -->\r\n <g transform=\"translate(111.791053 254.356562)scale(0.1 -0.1)\">\r\n <defs>\r\n <path d=\"M 10.796875 72.90625 \r\nL 49.515625 72.90625 \r\nL 49.515625 64.59375 \r\nL 19.828125 64.59375 \r\nL 19.828125 46.734375 \r\nQ 21.96875 47.46875 24.109375 47.828125 \r\nQ 26.265625 48.1875 28.421875 48.1875 \r\nQ 40.625 48.1875 47.75 41.5 \r\nQ 54.890625 34.8125 54.890625 23.390625 \r\nQ 54.890625 11.625 47.5625 5.09375 \r\nQ 40.234375 -1.421875 26.90625 -1.421875 \r\nQ 22.3125 -1.421875 17.546875 -0.640625 \r\nQ 12.796875 0.140625 7.71875 1.703125 \r\nL 7.71875 11.625 \r\nQ 12.109375 9.234375 16.796875 8.0625 \r\nQ 21.484375 6.890625 26.703125 6.890625 \r\nQ 35.15625 6.890625 40.078125 11.328125 \r\nQ 45.015625 15.765625 45.015625 23.390625 \r\nQ 45.015625 31 40.078125 35.4375 \r\nQ 35.15625 39.890625 26.703125 39.890625 \r\nQ 22.75 39.890625 18.8125 39.015625 \r\nQ 14.890625 3
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAZkAAAEWCAYAAAC0Q+rDAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjMuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/Il7ecAAAACXBIWXMAAAsTAAALEwEAmpwYAAAjOUlEQVR4nO3de5wV9X3/8deb3YUFBBZwBQQUVJQfGjW43qo1iI3iJcGkJtVepKkNaaJp0qvaNI252BrbxMQ0lxo1YmrqrUklidZQozVNvbAoomiIK2gBUZC7Ipfd/fz+mO+yZ5e9sZw5Z1nfz8fjPHbmM9+Z+ZzZy2fn+50zo4jAzMwsDwPKnYCZmfVfLjJmZpYbFxkzM8uNi4yZmeXGRcbMzHLjImNmZrlxkTEzs9y4yJjtI0m/K6le0puS1kh6QNLpOe1rkqSQVJnH9s2KzUXGbB9I+nPga8DfA2OAQ4BvAbPLmJMLkPUZLjJmvSRpBPAF4PKI+GFEvBURuyLixxHxV5IGSLpK0kuS1ku6W9KotG7LGclcSa+mM6C/LNj2SensaIuk1yV9NS16NH3dlM6cTpX0h5J+KekGSeuBayRdI+lfC7bX5gxI0iOSviTpf9N2fixptKQ70j4XSppUiuNo/ZuLjFnvnQpUAz/qZPkngQuB9wAHAxuBb7ZrcyYwBTg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PLAJB0ONmZjZmZWZd6cu+yzwH/CUyUdAdwGvCHeSZlZmb9Q7dFJiIWSHoKOIWsm+xTEfFG7pnth/zIMjOztjotMpKmtwutSV8PkXRIRDyVX1r7H3mUysxsD12dyXwlfa0G6oBnyM5kjgXqab3azMzMrEOdDvxHxJkRcSbZGcz0iKiLiBP
},
"metadata": {
"needs_background": "light"
}
}
],
"source": [
"cepstrum = np.fft.rfft(np.log(spectrum))\n",
"\n",
"plt.plot(frequency_x[:int(len(frequency_x)/2)], cepstrum[:int(len(frequency_x)/2)])\n",
"plt.xlabel('Quefrency')\n",
"plt.ylabel('Amplitude')\n",
"plt.title('Cepstrum')\n",
"plt.show()"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
]
}