Spectrograms

Spectrograms are used in the WikiDelia to visualise the sonic content of Delia's music.

In each spectrogram, time runs from left to right, low frequencies are at the bottom and high ones at the top and the light at each point in the graph represents the energy in the sound at one frequency at a particular moment (or, rather, in one frequency band in a short sample taken around a particular moment.)

As well as helping us understand the internal structure of Delia's pieces and her instruments and effects, these also help us recreate conventional scores from her sound files, for example:

Contents

Logarithmic frequency axis

The Pattern Emerges - Linear spectrogram from 0 to 22kHz of the whole piece (177 sec)

Most FFT-based spectrographic programs' output has a linear frequency axis, usually from 0Hz to 22050Hz for a CD-quality piece, in which the top half of the graph represents the top octave of the sound, the inaudible 11025-22050Hz band, with all the musical detail crushed into the bottom rows of pixels.

The Pattern Emerges - linear spectrogram from 0 to 4kHz of the first 20s (the bottom left corner of the above)

Even if you zoom in on the interesting part of the spectrogram, the top half of the graph always represents the top octave of the visible frequency range.

The Pattern Emerges - log spectrogram from 50Hz to 3600Hz of the first 20 seconds

What we would like is for each octave to be given the same height in the graph.

The spectrograms used in the WikiDelia are not the usual kind. Their vertical scale is logarithmic, which gives the same number of pixel rows per octave.

Not only does this give a graphic representation to music similar to conventional score notation for the notes and rhythms
but also give a characteristic graphical footprint of constant visual size to different notes of the same instrument (in a linear spectrogram, the harmonics of higher notes are more widely spread than those of lower notes.)

Usage in the WikiDelia

The spectrogram of a piece goes in two places:

On the piece's page in a section Spectrogram usually just above Availability so that the Listen button is near.

Software

Noah - Grayscale spectrogram by mkjpg

The WikiDelia's spectrum analyser, "mkjpg", was written specifically for it using a modified version of sndfile-spectrogram to prepare a linear spectrogram which is then distorted by an ImageMagick script to give it a logarithmic frequency axis.

The program "Sox" can also be used to produce the linear spectrogram, but you need this modified version to remove the limits on output image size, to normalise the output's brightness, and to make it 250 times faster and not need 16GB of RAM.

Noah - Grayscale spectrogram by logft

Noah - Grayscale spectrogram by constant-q-cpp

An alternative technique would be to perform a Constant-Q tranform directly instead of distorting a linear spectrogram. Candidates are:

the free audio editor Audacity, though the output is blockier than ours

the free audio file viewer "sonic-visualiser", which also has a Constant-Q spectrogram VAMP plugin

the next release of sndfile-tools (after 1.03) will include a new --log-freq option to sndfile-spectrogram achieving the same effect as here. In the meantime, if you can compile C, you can get it on github.

Get spectrograms of your music!

Moogies Bloogies - Spectrogram with piano staff (detail)

I am happy to run the log spectrum analyser on your music. You can specify:

lowest pitch (usually 27.5Hz)

number of octaves (usually 9, to 14080Hz)

number of pixels per semitone on the frequency axis (usually 8)

number of pixel columns per second on the time axis (usually 50)

Optionally the software can superimpose single-pixel black and white lines at the frequencies of the piano keys and three-pixel-wide white lines at the positions of the manuscript stave lines, see the example on the right.

If this interests you, please Make a small donation and email delia.derbyshire.net@gmail.com attaching the sound file you would like turned into a picture.

Alternatively, if you can compile C for Linux, you can fetch spettro from github, which plays music files while showing a log spectrogram of it scrolling right to left with the current playing time at centre screen.