Commit a7b27e87 authored by Leigh Smith's avatar Leigh Smith

Renamed lab1a to spectral_features_knn

parent 1140c091
{ {
"metadata": { "metadata": {
"name": "", "name": "",
"signature": "sha256:dac21bcd06bbdee8425399e96535c0efb0f06203600f7296c0aa1edd94bcd286" "signature": "sha256:37b907afa0f5a76b50f919ebf9d6804feda3a709475bfd7c09ce3cbccdb32313"
}, },
"nbformat": 3, "nbformat": 3,
"nbformat_minor": 0, "nbformat_minor": 0,
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "source": [
"Section 2: Spectral Features & k-NN\n", "Spectral Features & k-NN\n",
"------------------------------------\n", "------------------------\n",
"\n", "\n",
"My first audio classifier: introducing K-NN! \n", "My first audio classifier: introducing K-NN! \n",
"\n", "\n",
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
"\n", "\n",
"We're also going to be using the new features in our arsenal: cherishing those \"spectral moments\" (centroid, bandwidth, skewness, kurtosis) and also examining other spectral statistics. \n", "We're also going to be using the new features in our arsenal: cherishing those \"spectral moments\" (centroid, bandwidth, skewness, kurtosis) and also examining other spectral statistics. \n",
" \n", " \n",
"### TRAINING DATA\n", "### Training Data\n",
"\n", "\n",
"First off, we want to analyze and feature extract a small collection of audio samples - storing their feature data as our \"training data\". The commands below read all of the drum example .wav files from the MIR web site into an array, snareFileList. \n", "First off, we want to analyze and feature extract a small collection of audio samples - storing their feature data as our \"training data\". The commands below read all of the drum example .wav files from the MIR web site into an array, snareFileList. \n",
"\n", "\n",
...@@ -159,13 +159,13 @@ ...@@ -159,13 +159,13 @@
" frameSize = 0.100 * sample_rate # 100ms\n", " frameSize = 0.100 * sample_rate # 100ms\n",
" currentFrame = audio[0 : frameSize]\n", " currentFrame = audio[0 : frameSize]\n",
" # featuresSnare[i, 0] = zcr(currentFrame)\n", " # featuresSnare[i, 0] = zcr(currentFrame)\n",
" # [centroid, bandwidth, skew, kurtosis] = spectralMoments(currentFrame, sample_rate, 8192)\n", " # centroid, bandwidth, skew, kurtosis = spectralMoments(currentFrame, sample_rate, 8192)\n",
" # featuresSnare[i, 1:4] = [centroid, bandwidth, skew, kurtosis]" " # featuresSnare[i, 1:4] = [centroid, bandwidth, skew, kurtosis]"
], ],
"language": "python", "language": "python",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
"prompt_number": 6 "prompt_number": 14
}, },
{ {
"cell_type": "markdown", "cell_type": "markdown",
......
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