Previous Up Next

28.2.13  Visualizing power spectra

The plotspectrum command displays the power spectrum of an audio clip.

Examples

With the file flute-C5.wav donwloaded from here:

flute:=readwav("/home/luka/Downloads/flute-C5.wav"):; plotspectrum(flute)

The audio file flute-C5 consists of a single C5 tone played by a flute. In the graph above, the fundamental of that tone is clearly visible at the corresponding frequency of about 523 Hz. You can also see its first overtone at about 1046 Hz (the next two overtones are barely visible).

With the file gettysburg10.wav downloaded from here:

clip:=readwav("/home/luka/Downloads/gettysburg10.wav"):; plotspectrum(clip,[0,2000],bins=4096,color=purple)

With the file sf1_n0H.wav downloaded from here:

clip:=readwav("/home/luka/Downloads/sf1_n0H.wav"):; plotspectrum(clip,frequencies=0..5000,bins=1024)

In the above graph you can see the two components of the stationary noise contained in ranges 0-440 Hz and 2500-3000 Hz. The rest of the spectrum belongs to the female speaker. Use the playsnd command to hear the audio (see Section 28.2.14).


Previous Up Next