Design Article
The math of DSP, part 2: Complex numbers
James D. Broesch
10/26/2008 12:00 PM EDT
This series is excerpted from "Digital Signal Processing: Instant Access."
Order this book today and receive an additional 20% discount. Click here www.elsevierdirect.com and be sure to type in 92836. Or call 1-800-545-2522 and be sure to mention 92836. Offer expires 12/31/2008.
Part 1 introduces the basic math needed for DSP. Part 3 explains the basics of filters.
COMPLEX NUMBERS
Now, on to the subject of complex numbers. We have stayed away from this subject until now simply because we did not want to confuse things.
FAQ
How do "imaginary" numbers represent real-world quantities?
Part of the confusion over complex numbers—particularly as they relate to DSP— comes from a lack of understanding over their role in the "real world" (no pun intended). Complex numbers can be thought of as numbers with two parts: the first part is called the real part, and the second part is called the imaginary part. Naturally, most numbers we deal with in the real world are real numbers: 0, 3.3, 5.0, and 0.33 are all examples. Since complex numbers have two parts, it is possible to represent two related values with one number; x-y coordinates, speed and direction, or amplitude and phase can all be expressed directly or indirectly with complex numbers.
Initially, it is easy to think of signals as "real valued." These are what we see when we look at a signal on an oscilloscope, look at a time vs. amplitude plot, or think about things like radio waves. There are no "imaginary" channels on our TVs, after all.
But in practice most of the signals we deal with are actually complex signals. For example, when we hear a glass drop we immediately get a sense of where the glass hit the floor. It is tempting to think of the signals hitting our ear as "real valued" —the amplitude of the sound wave reaching our ears as a function of time. This is actually an oversimplification, as the sound wave is really a complex signal. As the glass hits the floor the signal propagates radially out from the impact point. Imagine a stone dropped in a pond; its graph would actually be three-dimensional, just as the waves in a pond are three dimensional. These three-dimensional waves are, in fact, complex waveforms. Not only is the waveform complex, but the signal processing is also complex. Our ears are on opposite sides of our head to allow us to hear things slightly out of phase. This phase information is perceived by our brains as directional information.
The points we have been discussing, such as P(0,0) and P(x,y), are really complex numbers. That is, they define a point on a two-dimensional plane. We do not generally refer to them this way, however, as a matter of convention. Still, it is useful to remember that fact if things get too confusing when working with complex notation.
Insider Info
Historically, complex numbers were developed from examining the real number line. If we think of a real number as a point on the line, then the operation of multiplying by (-1) rotates the number 180° about the origin on the number line. For example, if the point is 7, then multiplying by (-1) gives us (-7). Multiplying by (-1) again rotates us back to the original value of 7. Thus, the quantity (-1) can be thought of as an operator that causes a 180° rotation. The quantity (-1)2 is just one, so it represents a rotation of either 0°, or equivalently, 360°.
This leads us to an interesting question: If (-1)2 = 1, then what is the meaning of √-1 ? There is no truly analytical way of answering the question. One way of looking at it, however, is like this: If 1 represents a rotation of 360°, and (-1) represents a rotation of 180°, then √-1 must, by analogy, represent a rotation of 90°. In short, multiplying by √-1 rotates a value from the x-axis to the x -axis. Early mathematicians considered this operation a purely imaginary (that is, having no relation to the "real" world) exercise, so it was given the letter i as its symbol. Since i is reserved for current in electronics, most engineers use j as the symbol for √-1. This book follows the engineering convention.
Key Concept
In our earlier discussion, we pointed out that a point on the Cartesian coordinates can be expressed as P (x, y). This means, in words, that the point P is located at the intersection of x units on the x -axis, and y units on the y -axis. We can use the j operator to say the same thing:

Thus, we see that there is nothing magical about complex numbers. They are just another way of expressing a point in the x-y plane. Equation 4-23 is important to remember since most programming languages do not support a native complex number data type, nor do most processors have the capability of dealing directly with complex number data types. Instead, most applications treat a complex variable as two real variables. By convention one is real, the other is imaginary. We will demonstrate this with some examples later.
Next: Euler's relationship




Nach80
10/28/2008 8:38 AM EDT
Very interesting article!
One detail:
"...by √-1 rotates a value from the x-axis to the x -axis" I think you meant y-axis.
Sign in to Reply
Soreshnik
10/28/2008 8:55 AM EDT
Sorry for my bad English.
I think this is nonsense: "in practice most of the signals we deal with are actually complex signals".
There are no image (complex) signals in the real life! All of them are real. And complex numbers theory is not more than a powerful mathematical apparatus.
While teaching negative numbers to the child you may consider a problem like this: there were 10 cows, three of them went away. How did the herd increase? It increased by -3 cows is the correct answer. But you must explain that “negative cows” is an abstraction and that the herd decreased in reality.
Initially we have a real signal. It is difficult to process it in the real domain therefore we use Hilbert Transform and go to the complex domain. We do the needful there and return. The result is real signal again.
You may drop glasses end examine the results in two or three dimensions. Obviously all dimensions will have real values.
Negative frequencies, complex signals, and negative cows are very useful in solving problems but they do not exist in real life!
Sign in to Reply
TsJ
10/28/2008 12:32 PM EDT
Surely P(x,y) in 4.23 should be x+jx ? or have I missed something ?
Sign in to Reply
DSPer
11/8/2008 1:16 PM EST
Hello Soreshnik,
If complex signals did not exist in real life, your cell phone would not work. As it turns out it's easy to create a complex signal using two signal generators sitting on a laboratory workbench. That complex signal can then be transmitted, using two cables, to another laboratory down the hall.
Hello TsJ,
Eq. (4.23) is correct. Complex number "P" has a real part equal to "x", and an imaginary part equal to "y".
[-Rick-]
Sign in to Reply
Soreshnik
11/19/2008 2:23 PM EST
Hello DSPer,
No complex signal is created and transmitted, there are two real signals. We describe them by one complex function because it helps us solving many problems. It is mathematical trick only.
Sign in to Reply
dspread
11/25/2008 5:42 AM EST
Hello Soreshnik.
You are correct there are no _real_ "imaginary" signals, but there are many situations where a signal genuinely has complex properties. As DSPer said, all modern digital communication systems work this way. Think of an RF carrier which is modulated. In a coherent system, at any instant, it has a particular amplitude and phase, which can be represented on a two-dimensional plot, either in polar or complex form. Both of the two components are used in conveying information. The instantaneous phase can step clockwise (positive frequency) or anti-clockwise (negative frequency). OK the negaitve frequency is like taking away your cows, but it's awfully helpful to remove the carrier frequency from rotating phasor diagrams (just like they do for rotation machines). If we mix the signal down to baseband, _then_ we need two wires to carry the real (in-phase, I) and imaginary (quadrature, Q) components. Signal processing coefficients can equally be complex (for example inside an FFT).
It occurs to me that there are many other signals in real life that are complicated enough to require more than one wire (in baseband - let's leave out multiplexing schemes): colour video and stereo sound, for example. For the latter (which is trying to carry temporal and spatial information) we talk of balance and image position and do not regard the left and right signals as independent.
Understanding the relationship between complex maths and real-signals-in-hardware is fundamental to signal processing, and is worth the effort. You are right to question, both to elicit explanation and as part of the graft of gaining this understanding. Even if you must see complex signals ultimately as a mathematical convenience (what isn't?), they greatly assists both understanding and computation.
Hope that helps.
David
:0)
Sign in to Reply
Soreshnik
11/28/2008 7:55 AM EST
Hello David.
You are right of course.
And I'm right also :) :) :).
I see no contradictions in our texts.
Best wishes
Maria
Sign in to Reply
Peterman
12/16/2008 11:45 AM EST
I would agree with the fact that all signals are real! Complex numbers are just a mathematical abstraction that we humans use to keep track of time delay of sinusoidal signals (in the examples being discuss). Phase is basically the frequency normalized delay of a sinewave. The complex operator (square root of -1) simply represents 90 degrees of phase shift at a particular frequency, which is actually a time delay of 1/4 cycle at the frequency of concern. Of course if you delayed the sinewave by 90 degrees twice (which is equivalent to muliplying by the complex operator twice) you end up with an inverted sinewave, which equivalent to multiplying the original sinewave by -1. Similarly, if you delayed the signal by 90 degrees two more times, you would end up with a sinewave delayed by a complete cycle, which looks identical to the sinewave that you started with! The complex operator is merely a place holder to keep track of the delays of the components of a "real" signal.
Sign in to Reply
montrealrez
5/1/2009 2:17 PM EDT
I'd say...a complex signal is a combination of two real signals such that we can obtain the constituent real signals by mathematical manipulation. In signal processing, you can find out N point FFT of 2 N-pt real sequences: a & b by giving c=a+jb as input to the N-pt FFT block designed for complex N-pt input, and extracting from the composite output, the FFT of each inidividual signal
Sign in to Reply
montrealrez
5/1/2009 2:20 PM EDT
just like we say in chemistry(pardon the inaccuracies, its not my domain): a compound is made of elements and can be broken down into its constituent elements. Hence complex numbers are made up of real numbers and its a mathematical model that we can apply to any real world situation that would lend itself to it
Sign in to Reply