sunlight

Fourier Series Expansions

How do I make one?

You may well be wondering how I got the relative amplitudes of the sine waves to produce our square wave approximation. Well, that's what we're going to dive into here. There are two ways of doing it: standard solutions from HLT, and deriving it from Fourier integrals.

Odd and Even Functions

An important point to note, before you dive into the maths, is the difference between odd and even functions. For odd functions, on the other side of the y-axis, the function is inverted. That is to say:

Odd Functions 

sin is an odd function. So, from this, you should be able to see that an odd function is made up of sin functions only. And any combination of sin functions will produce odd functions.

Even Functions

Similarly, cos is an even function (mirrored about the y-axis), and so combinations of cos functions produce even functions.

This is all stated rather obliquely in HLT p11. Of course, some functions are neither wholly odd nor even: they are asymmetric. HLT miserably fails to produce any graphical examples of this, but it should (I hope) be fairly obvious that asymmetric functions are made up of both sin and cos functions:

Asymmetric Functions

Enough Messing Around

Okay, so you have an arbitrary function which isn't in HLT. Or you're in an exam and you want to prove from first principles.

What we're hoping for is a series of the form:

m-math is not installed. Please visit http://sunlightd.virtualave.net/m-math/ to download the latest version.

or

m-math is not installed. Please visit http://sunlightd.virtualave.net/m-math/ to download the latest version.

where ai and bi are constants we can find. From the previous section's discussion of odd and even functions, you should be able to see that ai will be zero for odd functions, and bi zero for even functions.

For ease of reference, I'm going to tell you the answer to the question now, and then explain it:

m-math is not installed. Please visit http://sunlightd.virtualave.net/m-math/ to download the latest version.  

m-math is not installed. Please visit http://sunlightd.virtualave.net/m-math/ to download the latest version.

Why? It has to do with the orthogonality of sin and cos functions. I refuse to talk much about this; suffice it to say that:

m-math is not installed. Please visit http://sunlightd.virtualave.net/m-math/ to download the latest version.

will be T/2 if i = j (¹ 0) and if i ¹ j, will be zero. (If you don't believe me, try it, or see my explanation.) Also, products of cos and sin terms will also be zero. You are then left with just one term multiplying: corresponding to ai (or bi if you're doing sines). So, if you just integrate this original function lots of times, each time multiplying it by cos(iwt), with i going up from 0, you will get the coefficients of the cos terms by:

m-math is not installed. Please visit http://sunlightd.virtualave.net/m-math/ to download the latest version.

which then yields the equation above for ai. A similar result is also obtained for sin, as above.

Easy-peasy lemon squeezy. So to speak. You can see these equations in HLT, page something .

Even More Complexity

Alert readers will say, Hang on - haven't we seen combinations of sin and cos functions before?

Well, combinations of sin and cos functions were found in 2nd order differential equations last year, and you may remember we got them from complex exponentials:

cos x + j sin x = e jx

So, if we fit these into our expression for the Fourier series, we get a new one in terms of j, with complex exponentials and complex coefficients ck. Oh joy.

m-math is not installed. Please visit http://sunlightd.virtualave.net/m-math/ to download the latest version.

where

m-math is not installed. Please visit http://sunlightd.virtualave.net/m-math/ to download the latest version.

m-math is not installed. Please visit http://sunlightd.virtualave.net/m-math/ to download the latest version.

Notice that now, instead of starting at zero, our counter starts at minus infinity. So, in summary, you can get a complex Fourier series from a real one quite easily. Or you can get c k straight away:

m-math is not installed. Please visit http://sunlightd.virtualave.net/m-math/ to download the latest version.

If you refer to HLT p10, you should be able to see the function X(w) which looks remarkably similar to our expression for c k earlier. This will lead us into the next big area: Fourier transforms. But for now: you can transform any periodic function (that you can integrate). Even better: easy functions like simple combinations of sin and cos functions you can transform immediately into a Fourier series. It shouldn't take too much effort to imagine doing it for linear combinations of complex exponentials either. Wahey!

Exampling

So, because this is so easy to do, let's have some really simple examples.

The easy way of obtaining the Fourier series of some functions is to reduce them to a sum of sine and cosine terms, then just read off the coefficients. For example, take the function

m-math is not installed. Please visit http://sunlightd.virtualave.net/m-math/ to download the latest version.

This is equal to

m-math is not installed. Please visit http://sunlightd.virtualave.net/m-math/ to download the latest version.

This is a simple Fourier series, with w0 = 200, a1 = 1, and b1 = j. Generating the complex coefficients is even easier: c1 = 1 (from the coefficient of ejwt).

Where did I get w0 from? The answer is quite simple: in cases like this, it's the lowest angular frequency expressed; in this case 200. In general, however, w0 = 2 p / T, where T is the minimum time between repeats of the function (period).

To illustrate this, let's take an easy function:

m-math is not installed. Please visit http://sunlightd.virtualave.net/m-math/ to download the latest version.

w0 = 4, a1 = 1, and b2 = 1. (The function repeats after p / 2, giving w0).

Our last example will demonstrate the integration method of determining coefficients. The function I'm going to transform looks like this:

e-t returns!

It has period 2, and x (t) = e -t for |t|<1.

m-math is not installed. Please visit http://sunlightd.virtualave.net/m-math/ to download the latest version.

m-math is not installed. Please visit http://sunlightd.virtualave.net/m-math/ to download the latest version.

And at this point, the Fourier analysis is finished! We now have an expression for each of the coefficients of the complex Fourier series, and the rest is just algebraic simplification.

Knowing that w T = 2 p, and T = 2, we get w = p, and:

m-math is not installed. Please visit http://sunlightd.virtualave.net/m-math/ to download the latest version.  

If you work out e - j·k·p and e j·k·p then you will see they are both equal to (cos k p) = (-1)k for integral k. Thus, this equation becomes:

m-math is not installed. Please visit http://sunlightd.virtualave.net/m-math/ to download the latest version.  

Note that although the c k terms are complex, the series results in a wholly real function x(t). This is because ck = c-k*: terms on each side of 0 are conjugate, and so the complex parts will cancel.

Next, we'll talk about non-periodic functions and the Fourier transform.

 

Copyright © David McCabe, 1998 - 2001. All rights reserved.

You will need to download and install the m-math control to display any equations on this Web site. Without this control, you will not see most of the equations. Please do not e-mail me asking why the equations do not display!

[an error occurred while processing this directive]