Audio Analysis

In this module, we'll look at audio signal representations of music from which we can obtain musical information (aka, music information retrieval). In order to do achieve this, we need to analyze audio signals, and some knowledge of how DSP, DFT, and other common techniques might be useful, but we wont go into here.

Our sections will be divided in four categories:

After this module, we would be ready to get the necessary data to work with some machine learning techniques.


A bit of history

This type of music analysis has been around 20 or more years, ever since computers and computer music software became cheaper and more powerful. Luckily, we can have a list of software to choose from to begin working: http://ismir.net/resources/software-tools/

We'll use mostly librosa, which is a well documented, strong python module. Its origins come from Columbia university's "labrosa" (https://labrosa.ee.columbia.edu/) and its main author is Brian McFee

You can read the docs, here: http://librosa.org/docs. Colab already has librosa, and you can obtain the latest librosa running pip3 install librosa on your machine.

Many of these examples have been adapted from https://musicinformationretrieval.com/ and the FMP notebooks: https://www.audiolabs-erlangen.de/resources/MIR/FMP/C0/C0.html

Beat Tracking

Automatic extraction of rhythmic pulse from musical excerpts. Also called beat-tracking and foot-tapping (SCHEIRER 1996). Automatic beat detection / beat tracking (ALONSO 2004)

Beat

The sequence of equally spaced phenomenal impulses which define a tempo for the music.

Pulse

A rhythmic pulse is described in terms of a frequency and phase component, just as for a periodic sound waveform (i.e., pitcH, or a note). The frequency of the pulse in a rhythmic musical signal is the tempo or rate of the rhythm, and the phase of the pulse indicates where the downbeat of the rhythm occurs

Usage

Algorithm structure

  1. a frontend analysis that efficiently extracts onsets
  2. a periodicity detection block
  3. the temporal estimation of beat locations

beat-tracking

The image above comes from Frieler 2004.

Imports

librosa is a python package for music and audio analysis. It provides the building blocks necessary to create music information retrieval systems. https://librosa.org/doc/latest/index.html

Audio Signal

Librosa's Beat Tracking

Use the IPython interactive widgets to observe how the output changes as we vary the parameters of the beat tracker.

Listen

Spectral Analysis

Spectral Energy Flux

(aka. Onset Strength Envelope)

Custom onset strength function

Detection Function

Listen

Periodicity Estimation

Autocorrelation

DFT

Essentia

Compare Tempo Estimations

References

These are some useful papers dealing with beat tracking and related tasks:

References

The following list includes many articles that comment on beat tracking research. Some of it is quoted and used on this text, but others are just for the curious mind.

Exercise

Create a dataframe in Pandas that provides the tempo estimates of ten recordings on your computer, using the five methods discussed this week (Librosa beat_track, tempo, autocorrelation, DFT, and Essentia.