Feature engineering and representation of audio events
To build a robust classification model, we need robust and good feature representations from our raw audio data. We will leverage some of the techniques learned in the previous section for feature engineering. The code snippets used in this section are also available in the Feature Engineering.ipynb
Jupyter Notebook, in case you want to run the examples yourself. We will reuse all the libraries we previously imported and we will also leverage joblib
here to save our features to disk:
from sklearn.externals import joblib
Next, we will load up all our file names and define some utility functions to read in audio data and also enable us to get window indices for audio sub-samples, which we will be leveraging shortly:
# get all file names ROOT_DIR = 'UrbanSound8K/audio/' files = glob.glob(ROOT_DIR+'/**/*') # load raw audio data def get_sound_data(path, sr=22050): data, fsr = sf.read(path) data_resample = librosa.resample(data...