All sound is generated by vibrating objects. When objects vibrate repetitively and predictably our ears interpret the resulting pressure waves as tones or pitches - the sort of thing you could play a tune with. Objects which vibrate in non periodic and random ways generate waves which we interpret as being noisy or atonal.

Different patterns of vibration produce sounds with different timbres. Timbre is the quality of a sound that is distinct from pitch and intensity. In other words, a flute and a violin may play the same note, but the quality of the sound produced by each instrument is markedly different. The timbre of a sound is largely determined by the presence or absence of overtones or harmonics. Most musical sounds are composed of a fundamental frequency and additional harmonics which lie at multiples of the fundamental frequency.1 For example, the note A4 has a fundamental frequency of 440 Hz. Its harmonics are at 880 Hz, 1,320 Hz, 1,760 Hz, and so on. Most instruments generate sound not only at the fundamental, but also at harmonics of the fundamental when struck, bowed, or blown.

In digital terms, we often talk about 3 basic types of sound wave. The sine wave is a pure tone with no overtones. A square wave is composed of a fundamental and odd harmonics of the fundamental. A saw wave is composed of a fundamental and all harmonics of the fundamental. The fundamental is usually the loudest component of the signal, and the harmonics decrease in loudness as they increase in frequency.

In the visualization below you can hear a two second audio example of each wave shape and see the associated frequency spectrum. The spectrum is a visualization of the frequency content within a given signal. The spectrum tells you where the energy lies within a signal in terms of frequency. Click the Play button associated with each wave shape to see and hear it.

Sine Wave

Square Wave

Saw Wave

Noise Wave

Notice that the spectrum of the saw and square waves look as if they could be constructed by copying, pasting, and scaling the spectrum of the sine wave. When viewing their frequency components, it looks like the square and saw wave are simply comprised of many individual sine waves. We’ll investigate this idea in later sections, and even more amazingly show that arbitrarily complex waves can be explained as combinations of simple sine waves.2

1. The overtones don't necessarily lie at precise multiples of the fundamental. Many instruments derive their particular character from the drift or offset of the actual harmonic positions from the "ideal" harmonic positions. For example, the upper overtones of a piano tend to drift from the ideal harmonic positions.

Our treatment of music and mathematics is very cursory. If you want to learn more, I recommend Gareth Loy's Musimathics

2. We won't spend a great deal of time talking about music in this primer, but if you find the topic interesting, I suggest listening to this episode of In Our Time on Music and Mathematics.