Turning Data Into Sound

The human ear is hardwired to find patterns within complex sounds. Together with visual cues, we can use data sonification — or turning data into sound — to extract new information from complicated datasets that may be missed by just looking at the data. The Seismic Sound Lab at the Lamont-Doherty Earth Observatory works to combine both senses with audio-visuals in order to learn new things about the Earth as well as to communicate that knowledge to the general public. The following sections focus on how these sounds are made directly from seismic data.

Understanding Waves

In the previous section Make Your Own Maps, we introduced a simple sinusoid. In this section, we will explore sine waves further. We will use the same sine wave equation with amplitude $A$ and frequency $f$ (cycles per second), but this time we will also add phase $c$ and vertical offset $b$ :

$$ y = A \sin (2 \pi f x + c) + b $$

When we sonify data, we will want to make sure that the data are varying around 0 and therefore we will try our best to ensure that $b = 0$.

view code

slider.py example

Making Your Own Waves With trinket.io

Now, we will see what happens when waves are added together. This is called wave superposition, and interesting behavior occurs even when adding just two waves together. If the frequencies of the two waves are similar to one another, beats will be produced — a sine wave modulated by a lower frequency “envelope”. The frequency of the beat that you see is equal to the difference in the frequency of the two waves ($f_{beat} = |f_1-f_2|$). The human ear hears this as a single frequency with its amplitude modulated.

  • Try adjusting f1 and f2 up and down to see what happens!
  • What happens when the two frequencies get farther apart? Closer together?
  • What happens when the two frequencies are exactly the same?

Listening to Sine Waves

Now, we will listen to some of the waves we just made. The following figure shows on top 3 different sine waves, each 2 seconds of length and connected end-to-end. The first one has a frequency of 200 Hz, the second a frequency of 210 Hz, and the third is the sum of the two. In this one you will hear a clear beating sound. Clicking the tab at the top left will show an example for 200 Hz + 300 Hz. These frequencies are far enough apart that two distinct tones can be heard.

The bottom panel is a spectrogram that shows the power produced by different frequencies over time. The brighter colors (less negative numbers) represent more power. The numbers are negative because we have taken the $\log_{10}$ to get values in terms of decibels.

Use the “Wheel Zoom” tool in the top toolbar to expand the horizontal and vertical axes. Click the tabs on the top to change waveforms. Click the “save” button to download your favorite sound wave!

view code Bokeh Plot