Sound is a pressure wave conveyed through some medium like air or water. When objects vibrate, they push and pull on the particles in their immediate vicinity. As an object vibrates outward into its surroundings, it pushes on (compresses) the neighboring air particles. When the object retreats away from the surrounding particles it creates a region of low pressure causing the particles to rush back towards the object. This “push and pull” causes a chain reaction of pushing and pulling which allows the vibration of the object to propagate outward through the air.

Figure 1 depicts some vibrating body generating a sound wave. The large grey rectangle to the left of the figure is the vibrating body, and the small dots are meant to abstractly represent individual particles of air. If you pay close attention to a single particle, you’ll notice that it stays localized in a particular area. It will sway back and forth in response to the changes in pressure, but it does not travel far from the vibrating object. The vibrating object causes the particles around it to mimic its own pattern of vibration - to vibrate sympathetically.

Figure 1.  A Sound Wave.
Very much slowed down and very much zoomed in

The curve underneath the physical simulation plots the amount of compression or pressure between air particles. When the curve is above the horizontal axis, the particles are being squeezed together. When the curve is below, this indicates a region of low-pressure. In more terminologically rigorous circles, the squeezing is referred to as compression, and the spaciousness between particles is referred to as rarefaction. Note that particles in the rarefied sections of the wave are drawn a bit lighter to allow for better visualization of the wave motion.

The speed of vibration is known as the frequency. Frequency is measured in cycles per second, also known as Hertz. We measure the frequency of the wave by counting the number of compression/rarefaction cycles that occur in one second. One full compression/rarefaction cycle looks like the curve shown in Figure 1a.

Figure 1a.  One Cycle of Our Pressure Wave
X-Axis: Time
Y-Axis: Amplitude

Returning to Figure 1, we should note that as the frequency of the wave increases, its wavelength decreases. A wave’s length is defined as the distance between adjacent peaks or valleys in the waveform, and this distance is always inversely proportional to the frequency of the wave. It’s also worth noting that the speed at which sound waves travel is constant, even if the intensity or frequency of the wave happens to vary. You can convince yourself of this fact by noting how long it takes a single peak or valley of the waveform to travel from the left side to the right side of Figure 1.1

1. The speed at which sound waves travel depends upon the material through which they are being transmitted. At sea level, sound travels through air at a speed of 340 m/s. Sound waves travel much more quickly through a denser material like water, propagating at nearly 1500 m/s.


Smoothly oscillating objects like the object shown in Figure 1 produce pressure waves which our auditory system interprets as pure tones. We refer to low frequency tones as bass, and high frequency tones as treble. People with exceptional hearing can hear tones from about 20 hertz to 20,000 hertz. As you get older, you lose your ability to hear tones at the high and low ends of this range. Play around with Figure 2 to acquaint yourself with the sound of a sine wave.2 You can click and drag on the visualization to change the frequency of the generated tone. You wont hear anything until you click the Play Sound button.

Figure 2.  Listen to a Sine Wave
Click and Drag to Change the Frequency
X-Axis: Frequency in Hz
Y-Axis: Magnitude

The frequency scale of Figure 2 is not linear, but logarithmic. While we are able to hear sounds from 20 Hz to 20,000 Hz, most of the sounds that we are interested in - and the sounds that our ears are most sensitive to - exist in the range from about 20 Hz to 8,000 Hz. Human speech falls within 300 to 3,000 Hz. An 88 key piano produces notes with fundamental frequencies in the range of 22 to 4,000 hertz. A piano does produce sound above these frequencies in the form of overtones, and we’ll address this phenomenon in the next section.

2. You’ll probably need headphones to hear tones below 150Hz.

You'll also need a browser which supports web-audio. If you're not hearing any sound, please file an issue on the github site.