Professional recordings

from the comfort of your own home

052-3844071 [email protected]

The Fourier Transform Part IV – Complex Numbers

Fourier Blog Part 4

Filming is currently underway on a special online course based on this blog which will include videos, animations and work-throughs to illustrate, in a visual way, how the Fourier Transform works, what all the maths is all about and how it is applied in the real world.


Click here to reserve your free module

The module will be emailed to you the moment the course goes live.


Complex Numbers

Have you ever sat there working out an equation only to be left with a niggling plus sign where, if only it was a minus sign, your whole equation would work out beautifully?

Well such a thing has been happening to mathematicians for centuries as they sit in their little abstract worlds waiting for a physicist or engineer to come along and nick their ideas and actually put them to some practical use in the real world. So it seems to have happened to the Greek mathematician Heron of Alexandria. However, rather than give up, Heron decided that if a number didn’t exist to make his equation do what he wanted it to, he would just have to jolly well go out and invent one.

And so was born the square root of -1, or as it is otherwise known: “i” (or “j” if, like me, you have a background in electronics). Somehow, this simple little discovery, although ludicrous, all of a sudden started solving mathematical problems that had been plaguing the fraternity for centuries.

By now, you might have tried plugging the number -1 into your calculator and hit the square route button. Your calculator (unless it’s a very clever one) will have gallantly refused to give you an answer. Maybe the word “Error” is currently showing on its readout. That is because your calculator is a rational piece of electronics and cannot deal with numbers which don’t exist.

This was precisely my problem when I was first learning about the Fourier Transform. Maths and I have always had a bit of a love-hate relationship. I hated maths and all my tutors loved to give me low grades on my homework and exams. When I first learned about complex numbers, this was the final straw for me. I had enough trouble dealing with numbers that did exist let alone an invented number which didn’t!! It took me years to realize that our mate “i” was simply a cheat that made the abstract lives of my old friends in the maths tower back at Manchester University just that little bit easier. In all practical applications, “i” would conveniently get itself squared or divided by itself and either turn into -1 or cancel itself out completely long before any real world results were due. If all else fails and it’s still in your equation when you finish… well you just conveniently forget about it.

So it is with the Fourier Transform. Yes “i” is there in our formula but all we need to do is think of it as a little note to ourselves that the wave we are describing is a sine wave with magnitude (or amplitude) and phase, all of which are things we should already be familiar with (assuming of course you have read part II and part III of this blog).

So, from now on, although I will be writing “i” in the various formulae on this page, I’m going to completely ignore it, and you should too.

So what is a complex number and how do we write it? Complex numbers are so called as they are made up of 2 parts, a real part and an imaginary part. The real part is any real number like 1, 0.5, -5 or any number you want. The imaginary part is any real number multiplied by the square root of -1 which we’ll call “i”. So a complex number is written in the form:

…where a and b are any normal numbers.

“a” is the real part of the complex number and “b” (because it is multiplied by “i”), is the imaginary part. Since complex numbers are made up of two separate components, a real component and an imaginary component, we can represent them on a graph. We plot the real part on the x-axis and the imaginary part on the y-axis. So our complex number above is a point on the graph with coordinates (a, b) as shown below.

A complex number shown on a graph

You may notice a similarity between the way that we plot the real and imaginary parts of our complex number on the graph above and the way we plotted our sine and cosine components on the graph in the previous post when we were playing with phase. Our cosine component we plotted along the x-axis and our sine component we plotted along the y-axis. This similarity is logical if you look at the blue line on the graph above. Whenever we plot a point on a graph, we go along the x-axis by a certain amount (“a” in the graph above) and then up the y-axis by a certain amount (“b” in the graph above). Rather than going along and up, we could take a shortcut and get to the point quicker if we were to go there directly, along the blue line. The blue line is known as a vector. We could describe this vector as having magnitude (how long it is) and direction (the angle through which it has rotated from lying flat along the x-axis, marked “θ” on the graph above).

This means we could rewrite our complex number in the form:

…where “M” is the magnitude or length of the vector.

These two different ways of expressing our complex number are simply two ways of saying the same thing. The first:

expresses our number via its coordinates “a” and “b” (known as expressing it in “Cartesian form“), and the second:

expresses our number via the length and angle of its vector (known as expressing it in “Polar form”). For us, the polar form is more useful as it gives us the amplitude of our wave “M” and the phase of our wave “θ”. As I said before, in sound, we are less interested in the phase, but the amplitude is very important for us to know.

Mathematicians are a lazy bunch. They don’t like to do too much writing if they can avoid it. Writing out the polar form of a complex number takes rather a lot of ink, especially if all you want to know is the magnitude “M” and the phase “θ”. Therefore there is yet another way of expressing our complex number using a very special number in mathematics called Euler’s number. At the risk of making this blog any more mathematical than it already is, I won’t go into the background to Euler’s number, if you are interested in learning more about it and mathematically proving the formulae I am about to show you, then click on the following link for my video about Euler’s formula and Euler’s identity.

Euler’s number is usually written as “e” where:

It just so happens that if we raise this number “e” to the power of an imaginary number such as “i”, then:

which means we can rewrite our complex number in a much more ink saving way as:

This way of expressing our complex number is known as expressing it in “Exponential form” and gives us, at a glance, all the important information we want, the magnitude of our wave “M” and the phase “θ”.

But what do we do with the fact that the square root of -1 (or as we have come to know it: “i”) doesn’t exist and cannot be calculated?

Simple!

Just ignore it!

So if we are to ignore “i” for the moment, there is only one thing left preventing us from returning to the sound waves of the real world and it is this: A sound wave is a wave whose amplitude changes over time, not over angle. After all, if your wife asks you to pick the kids up at a quarter past three, she doesn’t say to you “Could you pick the kids up when both hands of the clock are at 90 degrees” now does she? How can we convert this weird Greek letter “θ” representing an angular measurement into something connected to time?

Well the first thing we have to realize is that it is all very well dealing with angles in degrees. There are 360 degrees in a circle and all that. The only thing is: Calculators and computers don’t like degrees very much. Calculators prefer radians. A radian is simply another way of measuring an angle. Instead of there being 360 degrees in a circle, as far as your calculator is concerned there are 6.28318530717959 radians in a circle. This is a bit of a mouthful, especially for a mathematician, but it just so happens that:

But radians don’t help us either. How do we convert that niggling angle into something to do with time? Well here’s where all the things we have been talking about in the past few blog posts: Sine waves, frequency, amplitude, time and phase, come together nicely into one neat little formula. In sound and music, our sound waves have a pitch or a frequency. The frequency of our wave is simply a measure of how many oscillations per second the wave is vibrating the air. Therefore if our sound wave has a frequency of 1Hz, i.e. 1 oscillation per second, the time it will take for the wave to complete one cycle will be 1 second. In the world of angles, the number of radians it will take to complete one cycle is 2π. Therefore we can relate the angle of the wave to its equivalent in time by the following formula:

…where “f” is the frequency of our wave and “t” is the time.

So we can now rewrite our formulae in terms of how the amplitude of our wave changes over time as follows:

In Polar Form:

In Exponential Form:

Now we have a formula that allows us to calculate what our wave looks like at any point in time. We know the amplitude of the wave (M), the phase of the wave (2πft) and its frequency (f); and as for “i”, well “i” is simply the square root of minus one…

…which doesn’t exist !

Therefore, we ignore it !!

There was our mathematician friend Heron of Alexandria, sitting one day in his abstract world of real and imaginary numbers, when along came Jean-Baptiste Joseph Fourier. He saw these strange things called complex numbers, saw how they helped him to describe the component parts of his signal in a very accurate way, liked the idea and therefore decided to nick it and put it to good use in the real world to mathematically describe his signals. However, although complex numbers gave Fourier a notation, a way of writing down what he was trying to do, a notation is only a set of individual letters. He still had to join up these letters into words to make up the sentences and chapters of his story. How he set about doing this we will find out next time when we talk about Convolution.

Next Time: Convolution >>

 

 

Share This: