Digital Signal Processing An Overview of Complex Numbers Moslem Amiri, V´aclav Pˇrenosil Embedded Systems Laboratory Faculty of Informatics, Masaryk University Brno, Czech Republic amiri@mail.muni.cz prenosil@fi.muni.cz February 24, 2012 The Complex Number System Example Consider throwing a ball straight up into air with an initial velocity (vi ) of 9.8 meters/sec Height of ball (h) at any instant of time (t) h = −gt2 2 + vi t −→ t = 1 ± 1 − h/4.9 E.g., ball reaches h = 3 meters twice: t = 0.38 (going up), t = 1.62 (going down) h = 10 −→ t =? Never in reality But h = 10 −→ t = 1 + √ −1.041 and t = 1 − √ −1.041 Contain square-root of a negative number Called complex numbers 2 / 16 The Complex Number System Every complex number is sum of two components A real part: an ordinary number An imaginary part: square-root of a negative number Imaginary part is usually reduced to an ordinary number times √ −1 Example Consider t = 1 + √ −1.041 = 1 + √ 1.041 √ −1 = 1 + 1.02 √ −1 Real part: 1 Imaginary part: 1.02 √ −1 Abstract term √ −1 is given a special symbol: j (sometimes i) Therefore, t = 1 + 1.02j 3 / 16 The Complex Number System Complex numbers are represented by locations in a two-dimensional display called complex plane Horizontal axis = real part of complex number Vertical axis = imaginary part Chapter 30- Complex Numbers 553 Real axis -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 2 + 6 j -4 - 1.5 j 3 - 7 j 8j 7j 6j 5j 4j 3j 2j 1j 0j -1j -2j -3j -4j -5j -6j -7j -8j ne. Every complex number ation in the complex plane, the three examples shown ntal axis represents the real vertical axis represents the Imaginaryaxis 4 / 16 The Complex Number System In equations, a complex number is represented by a single variable Example A = 2 + 6j Re A = 2, Im A = 6 Complex numbers follow the same algebra as ordinary numbers, treating j as a constant Addition, subtraction, multiplication, and division of complex numbers (a + bj) + (c + dj) = (a + c) + j(b + d) (a + bj) − (c + dj) = (a − c) + j(b − d) (a + bj)(c + dj) = (ac − bd) + j(bc + ad) (a + bj) (c + dj) = ac + bd c2 + d2 + j bc − ad c2 + d2 5 / 16 The Complex Number System Complex conjugate A complex number with sign of imaginary part switched Z = a + bj Z∗ = a − bj Some properties of complex numbers 1 Commutative property AB = BA 2 Associative property (A + B) + C = A + (B + C) 3 Distributive property A(B + C) = AB + AC 6 / 16 Polar Notation Complex numbers can be expressed in two notations Rectangular notation (which was just described) Polar notation In polar notation Magnitude Length of vector starting at origin and ending at complex point Phase angle measured between this vector and positive x-axis Rectangular-to-polar conversion M = (Re A)2 + (Im A)2 θ = arctan Im A Re A 7 / 16 Polar Notation Real axis -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 2 + 6 j or M = %40 2= arctan (6/2) 3 - 7 j or M = %58 2= arctan (-7/3) -4 - 1.5 j or M = %18.25 2= arctan (-1.5/-4) 8j 7j 6j 5j 4j 3j 2j 1j 0j -1j -2j -3j -4j -5j -6j -7j -8j bers in polar form. Three s in the complex plane are r coordinates. Figure 30-1 ame points in rectangular Imaginaryaxis This brings up a giant leap in the mathematics. (Yes, this means you should pay extra attention). A complex number written in rectangular notation Polar-to-rectangular conversion Re A = M cos(θ) Im A = M sin(θ) Using above equations a + jb = M(cos θ + j sin θ) 8 / 16 Polar Notation Euler’s relation ejx = cos x + j sin x Rewriting equation a + jb = M(cos θ + j sin θ) using Euler’s relation results in a complex exponential a + jb = Mejθ Using exponential polar form makes multiplication and division simple M1ejθ1 M2ejθ2 = M1M2ej(θ1+θ2) M1ejθ1 M2ejθ2 = M1 M2 ej(θ1−θ2) 9 / 16 Polar Notation In Euler’s relation ejx = cos(x) + j sin(x) or e−jx = cos(x) − j sin(x) one complex expression is equal to another complex expression This is not useful Rearranging relations cos(x) = ejx + e−jx 2 sin(x) = ejx − e−jx 2j = j(e−jx − ejx ) 2 10 / 16 Using Complex Numbers Question How to use a mathematics that has no connection with everyday experience? Answer Change physical problem into a complex number form Manipulate complex numbers Then change back into a physical answer Two ways that physical problems can be represented using complex numbers Substitution Mathematical equivalence 11 / 16 Using Complex Numbers by Substitution Substitution Takes two real physical parameters Places one in real part of complex number and one in imaginary part After mathematical operations, complex number is separated into its real and imaginary parts corresponding to physical parameters Substitution allows two values to be manipulated as a single complex number Example A boat is pushed in one direction by wind, and in another direction by ocean current Resulting force is vector sum of two force vectors Use complex numbers Place east/west coordinate into real part of a complex number North/south coordinate into imaginary part Substitution allows us to treat each vector as a single complex number 12 / 16 Using Complex Numbers by Substitution Example (Continued) Wind (2 parts to east, 6 parts to north) −→ A: 2 + 6j Ocean current (4 parts to east, 3 parts to south) −→ B : 4 − 3j Sum, C : 6 + 3j −→ 6 parts to east, 3 parts to northChapter 30- Complex Numbers 559 Real axis -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 B A+B=C North South 8j 7j 6j 5j 4j 3j 2j 1j 0j -1j -2j -3j -4j -5j -6j -7j -8j C AE 30-3 vectors with complex numbers. The A & B represent forces measured pect to north/south and east/west. /west dimension is replaced by the of the complex number, while the uth dimension is replaced by the ry part. This substitution allows x mathematics to be used with an real problem. Imaginaryaxis West East 13 / 16 Using Complex Numbers by Substitution Substitution method is mathematically awkward There is no equation, there is representation Example When A equals B, we know countless consequences: 5A = 5B, 1 + A = 1 + B, A/x = B/x, etc. When A represents B, without additional information, we know nothing E.g., when sinusoids are represented by complex numbers, we allow addition and subtraction, but prohibit multiplication and division 14 / 16 Using Complex Numbers by Mathematical Equivalence Mathematical equivalence is a way of making complex numbers mathematically equivalent to physical problem Example In DSP, sine and cosine waves can be described as having a positive frequency or a negative frequency Substitution method ignores negative frequencies Since there are applications where negative frequencies are important, mathematical equivalence is of help here This will be discussed throughout this course 15 / 16 References Steven W. Smith, The Scientist & Engineer’s Guide to Digital Signal Processing, California Technical Pub, 1997. 16 / 16