—> To Continue with Chapter 3

Fourier and the Sum of Sines

In this section, we'll try to really the explain the notion of a Fourier expansion, building on the ideas of phasors, partials, and sinusoidal components that we introduced in the previous section.

A long time ago, the French scientist and mathematician Jean Baptiste Fourier (1768-1830) proved the amazing mathematical fact that any periodic waveform can be expressed as the sum of an infinite set of sine waves. The frequencies of these sine waves must be integer multiples of some fundamental frequency.

In other words, if we have a trumpet sound at middle A (440 Hz), we know by Fourier’s theorem that we can express this sound as a summation of sine waves: 440 Hz, 880Hz, 1320Hz, 1760 Hz...., or 1, 2, 3, 4... times the fundamental, each at various amplitudes.. This is rather amazing, since it says that for every periodic waveform (one that, by the way, has pitch), we basically know everything about its partials except their amplitudes.

The spectrum of the sine wave has energy only at one frequency. The triangle wave has energy at odd-numbered harmonics (meaning odd multiples of the fundamental) with the energy of each harmonic decreasing as one over the square of the harmonic number (1/N2). In other words, at the frequency that is N times the fundamental we have 1/N2 as much energy as in the fundamental.

The partials in the sawtooth wave decrease in energy in proportion to inverse of the harmonic number (1/N). Pulse (or rectangle or square) waveforms have energy over a broad area of the spectrum, but only for a brief period of time.

Fourier Series


What exactly is a Fourier series, and how does it relate to phasors? We use phasors to represent our basic tones. The amazing fact is that
any sound can be represented as a combination of phase-shifted, amplitude-modulated, tones of differing frequencies. Remember that we got an inkling of this concept when we discussed adding phasors together in the previous section.

Since a phasor is essentially a way of representing a sinusoidal function, what this means, mathematically, is that any sound can be represented as a sum of sinusoids. This sum is called a Fourier series.

Note that we haven't limited these sounds to periodic ones — if we did, we'd have to add that last qualifier about integer multiples of a fundamental frequency! Non-periodic, or aperiodic sounds are just as interesting, maybe even more interesting, than periodic ones, but we have to do some special computer tricks to get a nice "harmonic" series out of them for the purposes of analysis and synthesis.

But let's get down to the nitty-gritty. First let's take a look at what happens when we add two sinusoids of the same frequency. Adding a sine and cosine of the same frequency gives a phase-shifted sine of the same frequency:

In fact the amplitude of the sum, C, is given by:

and the phase shift is given by the angle whose tangent is equal to A/B. The shorthand for this:

We can see this with a phasor. Remember that the cosine is just a phase-shifted sine. Since they are moving at the same frequency, they are always "out of sync" (and not N'Sync!) by /2, so when we add them it's like this

<<<PICTURE NEEDED: ADDITION OF PHASOR VECTORS AS TRIANGLE

And we get another sinusoid of that frequency.


Any periodic function of period 1 can be written as a:


Notice that these sums can be infinite!

We have a nice shorthand for those possibly infinite sums written above (also called infinite series):

are called the Fourier coefficients of the function f(t). The Fourier coefficient A0 has a special name, it is called the DC term, or the DC offset. It tells you the average value of the function. The Fourier coefficients make up a set of numbers called the "spectrum" of the sound. Now, perhaps when you think of the word spectrum, you might think of colors, like the spectrum of colors of the rainbow. The spectrum tells you how much of each frequency (color) is in the sound.

The values of An and Bn for "small" values of n make up the "low frequency" information, and we call these the low order Fourier coefficients. Similarly, the big values of n index the "high frequency" information. Most sounds tend to be comprised of a lot of low frequency information — so the low frequency Fourier coefficients have larger absolute value than the high frequency Fourier coefficients.

What this means that it is theoretically possible to take a complex sound, like a person's voice, and decompose it into a bunch of sine waves, each at a different frequency, amplitude and phase. These are called the sinusoidal or spectral components of a sound. To find them we do a Fourier Analysis. Fourier Synthesis is the inverse process, where we take varying amounts of a bunch of sine waves and add them together (play them at the same time) — to reconstruct a sound! Sounds a bit fantastic, doesn’t it? But it works. This process of analyzing or synthesizing a sound based on its component sine waves is called performing a Fourier Transform on the sound. When the computer does it, it uses a very cool and efficient technique called the Fast Fourier Transform (or FFT) for analysis, and the Inverse FFT (IFFT) for synthesis.

Figure .x What happens if we add a number of sine waves together? We end up with a complicated waveform that is the summation of the individual waves.This picture is a simple example, we just added up two sinewaves. For a complex sound, hundreds or even thousands of sinewaves are needed to accurately build up the complex waveform. By looking at the illustration from the bottom up, you can see that the inverse is also true — the complex waveform can be broken down into a collection of independent sinewaves.

Soundfile .x Adding sine waves.

Figures .x A trumpet note in an FFT (Fast Fourier Transform) analysis — 2 views. The trumpet sound can be heard by pressing on the moving waveform to the right. Both of these pictures show the evolution of the amplitude of spectral components in time.

The advantage of representing a sound in terms of its Fourier series is that it allows us to manipulate the frequency content directly. If we want to accentuate the high frequency effects in a sound (make a sound brighter), we could just make the high frequency Fourier coefficients all bigger in amplitude. If we wanted to turn a sawtooth wave into a square wave, we could just set to zero the Fourier coefficients of the even partials.

FFT Demo

Installed

In fact, we often modify sounds by removing certain frequencies. This corresponds to making a new function where certain Fourier coefficients are set equal to zero, while all others are left alone. When we do this we say that we
filter the function or sound. These sorts of filters are called bandpass filters, and the frequencies that we leave unaltered in this sort of situation are said to be in the passband. A lowpass filter puts all the low frequencies (up to some "bandwidth") in the passband, while a highpass filter puts all high frequencies (down to some cut-off) in the passband. When we do this we talk about highpassing and lowpassing the sound. Below we listen to a few sounds and their highpassed and lowpassed versions. We also listen to a few where we cut out some middle bands! We'll talk a lot more about filters in Chapter 5.

Soundfile .x

Filter Examples. We start with a sampled file of bugs. This recording was made by composer and sound artist David Dunn, using very powerful hydrophones (microphones that work under water) to amplify the "microsound" of bugs in a pond

Soundfile .x

This is David Dunn's bugs sound file filtered so that we hear only the frequencies above 1000 Hz. In other words, we have high-pass filtered the sound.

Soundfile .x

This is the bugs sound file filtered so that we hear only the frequencies below 1000 Hz. This time, we have low-pass filtered the sound.

Once you have the spectral content of a sound, there is a lot you can do with it, but how do you get it?! That's what the FFT does, and we'll talk about it in the next section.


—> To Continue with Chapter 3

<— Back to 3.2

<— To Table of Contents