Clustering of songs using Fourier Transform

cluster, Fourier, music, song, machine, learning, kmeans, distance, fourier-transform, machine-learning, songs, unsupervised-machine-learning
pip install foucluster==1.2



Build Status Coverage Status

This project was presented at PyCon ES 2018. PDF presentation can be found in spanish here Video of the presentation in spanish can be found in Youtube

Installation and use

Requirements are already added in, so you just need to run

python install

A documented example is available. Firstly, creative commons songs for the example must be downloaded from this Dropbox link. Unzip the songs, so .mp3 files can be found in song/ folder.

After that, just run

python test/

Clustering with other songs can be done by adding them into song/ folder.


Recommendation song systems nowadays, like Spotify, use song clustering by made up parameters such as danceability, energy, instrumentalness, ... etc, which need an expert in that area to create those parameters.

In order to avoid expert knowledge and make access to machine learning applied to song easier, this library use signal analysis for measuring distances between songs. With this distances, when the amount of songs is considerable clustering can be applied.

Because musical notes have associated frequencies, this proposal is based on transforming from time series to frequency series, and then grouping theses series using various techniques and distance metrics.