[JPG image artwork that is a companion to the text]

What is Fourier Theory?



introduction

Fourier Theory describes additive synthesis. Fourier Theory is the basis for frequency analysis in science and engineering. Fourier Theory can be used to find the frequencies in sound. It can be used to analyse pictorial shapes and is the mathematical basis of wave optics. Atoms and subatomic particles are studied mathematically by physicists with quantum mechanics, which is largely a modified version of Fourier Theory.



2. adding waves

According to Fourier Theory, you can add together sine waves and cosine waves to create any shape. You just have to know which wavelengths to use and how big each one must be. In the graph below, three pure sinusoidal waves of frequencies 440 hz, 880 hz, and 1320 hz are added together to form a single waveform at the bottom.

[JPG image artwork that is a companion to the text]

This is easy to understand. Look at the bottom plot, say, at sample number 100. The amplitude of the wave at 100, if you look at how high it is on the vertical axis, is about +0.44. That amplitude was the result of adding the amplitudes of the other waves, at the sample point 100, and multiplying it by an amplitude factor. The first waveform at sample 100 has a value of -0.0142471. The second waveform at sample 100 is 0.9344076, and the third waveform at sample 100 is -0.0427297. The second waveform was multiplied by 0.5 and the third waveform was multiplied by 0.2. So the waveform at the bottom, at sample 100, is obtained by the following calulation:

            y   =  y1  +  0.5 * y2  +  0.2 * y3

                =  (-0.0142471) +  0.5 * (0.9344076)  +  0.2 * (-0.0427297)

                =  0.4444108
    

In standard mathematical notation the above sum is represented by

            y(x)  =  A1 * cos(x + p1) +  A2 * cos(x + p2) + A3 * cos(x + p3)
    

Notice the (x) in y(x), which is standard function notation. This means that the final sum, at some particular value of x, is found by adding the values of the sinusoidal curves, times an amplitude factor, at that same value of x. This arithmetic, this summing of waveforms, is represented in the math and engineering textbooks with the following equation:

[JPG image artwork that is a companion to the text]

At any given point, t, the answer y is the result of summing sinusoidal functions, each at the same value of t, for frequencies f1, f2, f3, etc. In order to get the whole set of points y(t), you have to repeat the sum at every point t along the horizontal axis.



3. decomposing waves

The real trick of fourier analysis is doing the opposite of the above. Given a waveform, what frequencies does it contain? The standard, complete description of the mathematics used to find a frequency component can be found, for example, at Wolfram MathWorld. The description in this tutorial will be oriented to getting started right away, and will leave out some of the formalism that you find in the textbooks.

In the sum of frequencies shown above, decomposing the wave would be like solving for one of the a(k) and b(k) coefficients. If we could only perform algebra on the equation, we would divide the whole equation by the other, unwanted, terms and leave behind the desired a(k) and b(k). But doing that wont work. We need a mathematical method to make all the terms cancel except the one we want. There is a way to do that in the algebra of vectors. And this is the deep thought behind fourier series, that the wave frequencies are orthonomal "vector" components in a "vector space".

One way to think of adding waves together is to imagine that each wave is the component of a vector, and the sum of waves is the resultant vector. If you follow this thinking, each component must be a completely independent object, that is, orthogonal.

[JPG image artwork that is a companion to the text] [JPG image artwork that is a companion to the text]

If the components are orthogonal, then the product of one component with another component will equal zero. But this is a special kind of product for vectors, called the vector product, or more commonly, the inner product. If the components are orthogonal, then the inner product of a component with it self is always non-zero, specifically, greater than zero ("positive definite"). The significance of being orthogonal or not orthogonal is that one orthogonal vector cannot be the component of one of the other orthogonal vectors. That way, all the orthogonal vectors form a set of building blocks such that any arbitrary vector can be formed with one or more of the orthogonal vectors (they form a vector space).

[JPG image artwork that is a companion to the text]

The point about vectors is that this vector multiplication gives us a kind-of arithmetic with the frequencies--we would like to divide both sides by a frequency so that we can solve for one of them, but we can't. But vector multiplication is zero between orthogonal components. So if we perform the vector multiplication of one of those orthogonal components on both sides of the equation, all the terms on the right side become zero except one. We're almost done.

When we apply this game of orthogonal vectors to sinusoidal waveforms, what makes them orthogonal or not orthogonal is whether their frequencies are whole number multiples of each other. The waveforms that were shown above are orthogonal waveforms.

    v1  =  cos(x)      (this is vector 1)
    v2  =  cos(2x)     (this is vector 2)
    v3  =  cos(3x)     (this is vector 3)
    v4  =  cos(4x)     (this is vector 4)
      .       .
      .       .
    

The vector product between any of these "waveform vectors" is performed by multiplying them together at each point in a time interval and adding the whole thing.

        < v1 , v2 >  =  v1(t1) * v2(t1)   +   v1(t2) * v2(t2)   +  ...
    

In terms of the sinusoids, this is

[JPG image artwork that is a companion to the text]

Note that each product is performed at the next time step, t1, t2, t3, etc, until the entire time interval is spanned. Multiply and add, multiply and add. The steps are usually represented with equation (2) and the summation notation of the big greek symbol sigma,

[JPG image artwork that is a companion to the text]

One last note: the summation in the above equation is also represented with the calculus notation of integrals. You should know this, because if you flip open a book on fourier series or other types of fourier analysis this notation will be everywhere. This is impressive, and it will make people think that you are an expert, but it is not as useful as you would expect. Equation (2) above shows the idea better.

[JPG image artwork that is a companion to the text]

These simple rules can be used to make a special kind of algebra for the components of vectors. And since we would like to think of waves as the components of vectors, this will also be a kind of algebra for the fourier components of sound waves.

So now we have a way, the inner product, of making the terms cancel in the sum of frequencies shown in equation (1). The inner product of a vector (sinusoid) with itself is nonzero (the square modulus), and the inner product of any of these base vectors (integral sinusoids) with each other is zero.

        < v1 , v1 >  =  A

        < v1 , v2 >  =  0
    

You can see this for yourself by doing an inner product with Scilab. Just create two simple sinusoids and perform the multiply-add steps automatically with the sum command:

        x = 0:0.01:(2 * %pi);

        y = sin(x);

        y2 = sin(2*x);

        sum(y .* y2);
    

Now let's make the sum of waves in equation (1) look more like an algebra equation.

        y  =  a0  +  a1 * v1  +  a2 * v2  +  a3 * v3  +  ... +
    

We want to find the value of a2 above, which would correspond to the amplitude of the first harmonic in a sound wave. We need all the other terms to cancel, so we use the inner product on both sides of the equation. We take the inner product of v2 with the left side, and then the inner product of v2 with the whole right side.

        < v2 , y >  =  < v2 , (a0 + a1*v1 + a2*v2 + a3*v3 + ...) >

        < v2 , y >  =  < v2 , a0 > + < v2 , a1*v1 > + < v2 , a2*v2 > +
    

And all the terms on the right side are zero except for the one where v2 is inner product-ed with itself:

        < v2 , y >  =  a2 * < v2 , v2 >

        < v2 , y >  =  a2 * A
    

Then you, of course, divide both sides by the square modulus of v2's inner product with itself, A, so that you have the final answer for the amplitude value of a2.

        a2   =   (1 / A)  *  < v2 , y >
    

This is the fourier series formula for finding the amplitude of a frequency component in a waveform. But the fourier series formula is always represented in the mathematics literature with calculus notation, as shown below.

[JPG image artwork that is a companion to the text]

This is the fourier series formula as you find it in the mathematics literature. And there are two concerns when you use the formula. One is that the multiply-add operation (integral) is done over that time interval for which the composite waveform, f(t), completely repeats. This is sometimes called the region of orthogonality. The second consideration is the factor in front of the waveform. That factor is there because we require that the inner product of a basis vector (cos(x) , sin(x), cos(2x), sin(2x), ...) with itself to equal unity. You divide the formula by the vector's square modulus. Why is this important? Because in the literature you will see the fourier formula variously represented with cos(n x) or cos(n pi x / L) or anything else. You will want to be sure your coefficients are correct for your work.



4. the big world of fourier theory

You either add waves, or you take them apart. That's the overview of fourier theory.

Academic mathematics presents this subject as various separate topics that require numerous college courses to cover. There are different kinds of fourier theory depending on whether your problem is analog, digital, analytical, signal processing, etc, etc. I don't think you need to let all this bother you if you just want to use the FFT to look at your sound waves. I think the differences between these mathematical topics are academic. I will discuss that some more in the tutorial called how to understand fourier theory.

  • The Fourier Series.

    The waveform is a continuous function, so there are no data points. You can learn about that in algebra and calculus. Each of the component sinusoids, their frequencies must be integer multiples of the fundamental frequency. The waveform in the time domain is continuous, whereas the frequencies are discrete values.

  • The Fourier Transform.

    Both the time domain and frequency domain are represented with continuous functions. The region of orthogonality for the basis sinusoids is infinity.

  • The Discrete-Time Fourier Transform.

    The time-domain data is represented by discrete data points, and the frequency domain is continuous over an infinite region.

  • The Discrete Fourier Transform.

    Both the time domain and the frequency domain information is represented by discrete data points. The frequency domain repreats itself every two PI. This transform is what the FFT algorithm is based on.

  • The Z Transform.

    Engineering stuff.



summary

We have seen how fourier theory is about adding waves and taking them apart. Waves are added together at each time point to make a composite waveform value at that time point. Frequency amplitudes are found by taking a frequency's basis sinusoid and performing the inner product of that sinusoid with the composite waveform over the interval of orthononality.

For further reading, consult the Center for Computer Research in Music and Acoustics (CCRMA) resources.




Music Synthesis and Physics Home
[JPG image artwork that is a companion to the text]
© Alfred Steffens Jr., 2007