R. Brigola


Supplement to my lectures on Fourier analysis
A first step into audio spectral analysis

Here we consider a first example for the generation of simple spectral fingerprints
of an audio file series as data base for a first audio recognition test.
The purpose of this example is to experience, whether we can identify a music track by a very simple "spectral fingerprint"
of a short track section of about 30 seconds duration, taken from an arbitrary time interval of the track.


In the file fingerprint.m spectral fingerprints are computed for a series of tracks.
For an unknown track section the analogous fingerprint has to be computed and compared with the data base.


We test the following type of a spectral fingerprint:

The bandwidth is partitioned into a series of subbands. For each subband we compute the so-called "spectral flatness",
i.e. the quotient of the geometric and the arithmetic mean of all amplitudes in the subband. The vector of these values
in the interval [0,1] is considered as the spectral fingerprint.


For recognition of a piece we compare its analogous fingerprint. The orthogonal projections of the test fingerprint
into the data base fingerprint directions are computed. As "identification" per channel is chosen that track,
where we find the largest component. This is done in fingerprint_test.m


For more details please read the text and comments in the m-files. The m-files are

m-file for the generation of a series of spectral fingerprints from a list of music tracks
m-file for the recognition test

The output of the first m-file is the data base for the test. Matlab (on my dual core notebook) needs only about 170 s
computation time for 20 tracks of about 3-4 minutes duration.
(FFT for about 350 million samples in the 2 channels, i.e. for more than 104 million complex operations!
A naively programmed DFT without the FFT algorithm would need more than 100 years of computation time at the same speed!)

The output of the second m-file is displayed in the Command Window of Matlab and shows the computed track no. per channel and
the components of the test fingerprint into the corresponding fingerprint directions of the displayed track no.

You can check the test success or mismatch by comparing the track list provided below.
You can also display or print out the generated correlations per test and compare them with your perceptive impressions of the tracks in test.


For new Matlab users:
You can open the m-files in the Matlab editor by double-clicking, and run them by
" Evaluate current cell", a menu point found in the top line of the Matlab window clicking "cell".


Test Examples and generated fingerprints

The fingerprint data base of 20 music tracks computed as above
The corresponding track list of the music examples I used

To experience how it works, you can download segments of the used examples with the filenames test_trackN.wav
(each about 30 s, 5 MB) from the folder


test_track1 test_track2 test_track3 test_track4
test_track5 test_track6 test_track7 test_track8
test_track9 test_track10 test_track11 test_track12
test_track13 test_track14 test_track15 test_track16
test_track17 test_track18 test_track19 test_track20
test_track21 test_track22 test_track23 test_track24
test_track25

The soundfiles have to be available in the folder, where you save the m-files and the data base fingerprint_db.mat.
Run the file fingerprint_test.m with a test_trackN.wav as input name. The number N runs from 1,2, ... to 25.
The recognition test with one track segment of about 30 s needs about 16 s on my notebook.


Test Results

A few remarks on the test results


References: Please read the Wikipedia entry on acoustic fingerprints and the references therein.