The Mathematics of Sound

Professor Cross’s laser and video displays came out of a desire to visualize sound. Sound, while itself a phenomenon experienced through one’s sense of hearing, can be rendered visually on a medium such as an oscilloscope... or a laser light show. Knowing the qualities of sound waves, one can create an endless number of unique patterns, ranging from simple geometric shapes to quasi–random “squiggles.”

Single-channel audio as a function of time

Sound can be represented mathematically by the function:

[x(t) = A [ fx ( 2 pi n t ) ]]

When dealing with audio signals, it is common to refer to degrees of phase, so 2·pi can be changed to 360°:

[x(t) = A [ fx ( 360deg n t ) ]]

Where:

t = elapsed time;
A = amplitude;
n = fundamental frequency or first harmonic;
fx = waveform.

These qualities can all be represented graphically by plotting the overall wave function against time:

[qualities of an x(t) plot]

An oscilloscope allows for the visualization of waveforms in real time.

AMPLITUDE

[x(t) with different amplitudes]

Changes in amplitude result in changes in the volume of the sound. When translated into visualization, these are the extremes reached by the crest and trough of the waveform. The “height” increases and decreases from changes in amplitude.

FREQUENCY

[x(t) with different fundamental frequencies]

Changes in the fundamental frequency (a.k.a. first harmonic) result in changes in the pitch of the sound. When translated into visualization, the shape of the waveform will appear to stretch or compress.

WAVEFORM

[fx and gx, two different waveforms]

When a piano, violin, or trumpet play the same pitch, their distinctive sound is still apparent. Timbre is the distinctive quality that is unique for an instrument, singing voice, or generated tone. The timbre is a result of a specific waveform which is a summation of the fundamental frequency and higher harmonics (a.k.a. overtones).

The purest timbre is produced by a sine wave tone generator; the tone consists only of the fundamental frequency (no higher harmonics). As expected, a sine wave tone appears as a sine wave on an oscilloscope.

Tone generators are also capapble of producing square, triangle, and sawtooth waveforms. All of these waveforms visually translate to their respective patterns on an oscilloscope.

Two-channel audio in the x–y domain

Stereo audio has two channels (left and right), and the signals on the respective channels can be displayed simultaneously using an oscilloscope’s x–y mode. In mathematics, this is analogous to a parametric plot.

[fx(t) = fy(t) in x-y plot]
[fx(t) = fy(t) = sin(t)]

If the same audio signal is sent over both channels (in essence being monaural), the resulting x–y plot is rather underwhelming: a line rotated 45° between the two axes.

PHASE

Visualizations become more interesting as deviations in phase are introduced. While two like channels in phase (or 180° out of phase) produce the 45° line, any other phase difference will start to create true two–dimensional images.

[fx(t), fy(t) 90deg out of phase]

For a simple sine wave, a 90° phase difference changes the pattern from a 45° to a circle.

[fx(t) = sin(t + 90deg) = cos(t); fy(t) = sin(t)]

While phase changes may not be audible, they certainly are apparent (and important) in the visualization of sound.

AMPLITUDE

[change of amplitude in x-y plot]

Adjustments in amplitude have an effect on dimensions of the visualization. In case of the circle plot, the circle will grow and shrink as the volume gets louder and softer. The plot stays a circle as long as the amplitude in both channels is equal.

As the amplitudes between the left and right channels vary, the plot becomes elliptical, with the ratio of its two dimensions equal to the ratio of the amplitudes in each channel.

FREQUENCY

The input frequencies of the left and right channel affect the speed of the trace in the x–y plot. At low frequencies, the trace of the circle plot will move slowly, often to the point where its movement is visible to the human eye. At sufficiently high frequencies, however, the trace is moving fast enough that it appears as a continuous line.

[change of frequency in x-y plot]

In addition to trace speed, the ratio of frequencies between the left and right channels has an effect on the shape of the plot, deviating from the circle or ellipse pattern. The patterns created by different frequency ratios was first investigated by Nathaniel Bowditch. Jules-Antoine Lissajous studied the phenomenon in greater detail by reflecting light off mirrors affixed to tuning forks with specific pitch ratios. These patterns are known as Lissajous figures.

WAVEFORM

[change of waveform in x-y plot]

Patterns are also affected by the respective harmonics in the waveform of each channel. The addition of various harmonics in waveforms have a significant impact on the shape of an x–y plot. Waveforms based on sine, square, and other artificially–generated tones can be used to produce geometric patterns—however, they are generally less pleasing to the ear than non–electronic sounds. On the other hand, music that may be enjoyable to listen to will usually result in quasi–random “squiggles,” which are a direct effect of the countless harmonics produced by a group of instruments and/or voices. Often times when creating an audio visualization experience, one may choose electronically–generated sounds for the x–y plot, played in sync or mixed with a non–electronic music soundtrack.

Knowledge of the mathematical quality of sounds can allow an artist–musician to create and visualize audio that can be appealing to the eyes (and the ears).