Chapter 4 Static digital images

The three fundamental quantities of sound waves are time, frequency, and amplitude. The most commonly used visualisations of sounds are consequently combinations of these properties.

The seewave package (Sueur, Aubin, and Simonis 2008) is the easiest way to produce these plots. We will use the sheep audio sample provided by seewave for the first plots.

library(seewave)
data(sheep, package="seewave")

4.1 The time domain

Time domain techniques analyse the recorded waveform directly. Conversion of a waveform to a spectrum of frequencies is a relatively costly computation. Before digital computers, frequency analysis was hard to achieve with the precision and resolution we are accustomed to today.

4.1.1 Oscillograms

Digitally sampled audio is a series of amplitude measurements sampled at a regular time interval. The most basic plot we could recreate from a sampled file would be plotting amplitude values against time, a plot known as an oscillogram.

Plotting a waveform

Figure 4.1: Plotting a waveform

Figure 4.1 shows 50 samples from the sheep audio file plotted using the standard R barplot()function. This representation has the advantage that the individual bars are a visual reminder that we are handling a sampled representation instead of a continuously varying waveform. It is common, however, to create a visual representation closer to that of an actual wave (Figure 4.2 shows how this is achieved using base R functions).

Plotting a waveform

Figure 4.2: Plotting a waveform

The oscillo() function from seewave handles the labelling of axes for us and is a very convenient solution. Figure 4.3 shows the resulting plot, an oscillogram, for the entire sheep file.

Oscillogram

Figure 4.3: Oscillogram

4.1.1.1 Relation to time series

The time series plot of a variable against time is often used in statistical analysis of time series. The oscillogram is in fact a time series plot, in this case a plot of a series of amplitude (air pressure) measurements against time.

4.2 The frequency domain

The frequency domain covers analyses in which frequency data are extracted from the sampled waveform, typically using the Fast Fourier Transform algorithm.

4.2.1 Plotting a spectrum

A spectrum is a plot of amplitude against frequency.

Spectrum

Figure 4.4: Spectrum

4.2.2 Plotting a spectrogram

Spectrogram

Figure 4.5: Spectrogram

4.2.2.1 Settings for a FFT

References

Sueur, J., T. Aubin, and C. Simonis. 2008. “Seewave: A Free Modular Tool for Sound Analysis and Synthesis.” Bioacoustics 18: 213–26. https://www.tandfonline.com/doi/abs/10.1080/09524622.2008.9753600.