EEL335: Discrete-Time Signals and Systems. Introduction In our analysis of discrete-time signals and systems, complex numbers will play an incredibly important role; virtually everything we do from here on out will involve complex numbers in one form or another. Therefore, it is worthwhile, at this point, to do a short review of complex numbers. You can find additional discussions on complex numbers in Appendix A (pp, 378-98) of DSP First: A Multimedia Approach (J. H. McClellan, et. al.), the course textbook.. Introduction to complex numbers A. Basics Definition: The imaginary number j is defined as: j A consequence of definition () is that: () j. () Definition: A complex number z is defined as an ordered pair of real numbers x and y: z ( x, y) x + jy such that the real part of z Re[ z] x and the imaginary part of z is given by: is given by: (3) (4) Im[ z] y. (5) We can think of a complex number as a point in the complex plane, which consists of the horizontal, and the imaginary vertical axis, as shown in Figure below. Definition: The conjugate z of a complex number z is defined as: z x jy (6) B. Polar form and Euler s formula The complex number in equation (3) is in rectangular or Cartesian form. For our studies, oftentimes a more convenient form will be the polar form as shown in Figure, such that: z x+ jy rcos + jrsin (7) complex plane (x, y) Figure - -
EEL335: Discrete-Time Signals and Systems r complex plane (x, y) y rsin x rcos Figure where r x + y (8) atan( yx, ) Note that in equation (9) we use the two-argument inverse tangent function. Unlike the single-argument inverse tangent function atan( y x), which returns angles in the range [ π, π ] (first and fourth quadrants only), the two-sided inverse tangent function returns angles in the range [ π, π] (all quadrants). The following relationship exists between the two-argument and one-argument atan functions: (9) atan( yx, ) In Figure 3, we indicate the range of C. Euler s formula atan( y x) π + atan( y x) π + atan( y x) quadrants I and IV quadrant III quadrant II atan( yx, ) for each quadrant. () The polar form is often convenient because of an extremely important identity, known as Euler s formula: e j cos + jsin Equation () allows us to express any complex number as a complex exponential: () z x+ jy rcos + jrsin re j. () II [ π, π] I [, π ] III IV [ π, π ] [ π, ] Figure 3 - -
EEL335: Discrete-Time Signals and Systems for which all the standard laws of exponents apply. As such, it will help us deal with sinusoidal functions using exponentials, for which the algebra is typically much more straightforward. Given the polar form of complex numbers, we define two more quantities related to complex numbers: z r x + y magnitude of the complex number z, and, (3) arg( z) atan( yx, ) phase of the complex number z (in radians). (4) Proof of Euler s formula: We can show that Euler s formula makes sense by expanding each term in equation () as its Taylor Series expansion. Recall from calculus that any function in x can be approximated by a polynomial about x. The relevant Taylor series expansions are given below: e x x x x + + ---- + ---- 3 +! 3! x ---- k k! k (5) where, x cos( x) x ---- 4 x + ---- ---- 6 +! 4! 6! sin( x) x x 3 x ---- 5 x + ---- ---- 7 + 3! 5! 7! ( ) k x -------------------- k ( k)! k ( ) k x -------------------------------- ( k + ) ( k + )! k (6) (7) n! n ( n ). (8) Substituting equations (5) through (7) into equation (), we get: ( j) j ( j) ------------ 3 ( j) ------------ 4 ( j) ------------ 5 + + + + + ------------ + ----- + ----- 4 +! 3! 4! 5!! 4! j 3 + ----- + ----- 5 + 3! 5! (9) where, for convenience, we have truncated each Taylor series up to the fifth-order term. Using, j, () we can simplify equation (9) as: j j( ) ----- 3 ------------ 4 j( ) ----- 5 + + + ------------ ----- + ----- 4! 3! 4! 5!! 4! j 3 + ----- + ----- 5 3! 5! () We can readily observe that equation () is indeed correct by verifying that every term that appears on the left-hand side of the equation also appears on the right-hand side of the equation. Consequently, Euler s formula must be correct. D. Inverse Euler relations Euler s formula in equation () can be inverted to give the following extremely important inverse Euler relations: e cos j + e ----------------------- j (). So far in the class, I have frequently referred to the magnitude spectrum of a signal. As we will see soon, the frequency representation of a time-domain signal is, in general, a complex-valued function for which we typically plot the magnitude and phase separately as a function of frequency. Once we define the frequency transform formally, we will be concerned not only with the magnitude spectrum, but phase spectrum as well. - 3 -
EEL335: Discrete-Time Signals and Systems sin e j e ---------------------- j j (3) This can be shown relatively easily. Let us use Euler s formula to expand e j : e j cos( ) + jsin( ) (4) Note that the cosine function is an even function, while the sine function is an odd function, so that: cos( ) cos( ) (5) sin( ) sin( ). (6) Therefore equation (4) may be simplified to: e j cos jsin. (7) Using equations () and (4), we can now show that the left-hand and right-hand sides of equation () are equal: cos e j + e ----------------------- j ( cos + jsin) + ( cos jsin) ------------------------------------------------------------------------------ cos -------------- cos (8) The same can be done for equation (3): sin e j e ---------------------- j j ( cos + jsin) ( cos jsin) ------------------------------------------------------------------------------ j jsin ---------------- j sin (9) The inverse Euler formulas go a long way towards explaining the frequency representation of a sinusoidal signal. Let us consider the following function: xt () Acos( πf o t) (3) Using equation (), we can rewrite equation (3) as: xt () --Ae jπf o t + --Ae jπf t (3) Note that the complex representation in equation (3) has two components, each / the magnitude of the signal xt (), with a positive and negative exponential, corresponding to the negative and positive frequency terms with which we have seen many times in the spectrum representation Xf () of a sinusoid (see Figure 4). While equation (3) still does not fully explain the spectrum representation functions, it does take us one step closer. Xf () as two shifted Dirac delta - 4 -
EEL335: Discrete-Time Signals and Systems xt () Acos( πf o t) Xf () A T f t --Aδ ( f+ f ) --Aδ ( f f ) f Figure 4 3. Complex algebra A. Introduction Below we derive basic algebraic operations on complex numbers. As we will see, some of these operations are easier to carry out in the Cartesian form, z x+ jy while others are easier in the polar form, (3) z re j. (33) In our derivations below let, z x + jy r e j (34) where, z x + jy r e j, (35) r x + y, r x + y, atan( y, x ) and atan( y, x ), (36) and, conversely, B. Addition x r cos( ), y r sin( ), x r cos( ) and y r sin( ). (37) In Cartesian form, addition of two complex numbers is relatively straightforward: z + z ( x + jy ) + ( x + jy ) ( x + x ) + j( y + y ) (38) If z and z are given in polar form, one must first convert the two numbers into Cartesian form, and then follow equation (38) above: z + z r e j + r e j. (39) [ r cos( ) + r cos( )] + j[ r sin( ) + r sin( )] The result in equation (39) can then be converted back to polar form: x 3 r cos( ) + r cos( ) (4) - 5 -
EEL335: Discrete-Time Signals and Systems y 3 r sin( ) + r sin( ) r 3 x 3 + y 3 3 atan( y 3, z 3 ) (4) (4) (43) z + z r 3 e j 3. (44) C. Multiplications In Cartesian form, multiplication of two complex numbers is given by, z z ( x + jy ) ( x + jy ) x x + jx y + jx y + j y y ( x x y y ) + j( x y + x y ) (45) Multiplication is easier to carry out in polar form: z z r e j r e j r r e j ( + ) (46) D. Division In Cartesian form, division of two complex numbers is given by, z ---- z ( x + jy ) ----------------------- ( x + jy ) ( x + jy ) ( x jy ) ----------------------- ----------------------- ( x + jy ) ( x jy ) (47) ( x x + y y ) + j( x y x y ) ------------------------------------------------------------------------- x + y Division is easier to carry out in polar form: z ---- z r e j ------------- r e j (48) r ---- e j ( ) r E. Exponentiation Below, we compute z a, where, z x+ jy re j In polar form, z a is relatively straightforward to compute: z a ( re j ) a r a e ja (49) (5) - 6 -
EEL335: Discrete-Time Signals and Systems In Cartesian form, it is easiest to first convert the number to polar form, use equation (5) above, and then convert back to Cartesian form: z a ( x + jy) a If we let, ( x + y ) a e j[ a atan( y, x) ] ( x + y ) a e j[ a atan( y, x) ] r' ( x + y ) a ' a atan( y, x) then, the result in equation (5) can be written in Cartesian form as: (5) (5) (53) z a r' cos( ' ) + jr' sin( ' ). (54) F. Conjugate The conjugate z of a complex number, z x+ jy re j is given by, (55) z x jy in Cartesian form and, (56) z re j in polar form. (57) 4. Numeric examples See the web site for the Mathematica notebook complex_examples.nb and/or Matlab session log complex_examples.m for all of the numeric examples below. A. Conversion between Cartesian and polar forms Below, we give some examples of complex number conversions between Cartesian and polar forms: e j( π ) cos( π ) + jsin( π ) j (58) e jπ cos( π) + jsin( π) (59) e j( π ) cos( π ) + jsin( π ) j (6) e jnπ cos( nπ) + jsin( nπ) n {, ±, ± 4, } n { ±, ± 3, ± 5, } (6) e j( 3π 4) cos( 3π 4) + j sin( 3π 4) ------ + j ------ + j + j + e j atan(, ) e j( π ) + j ( ) + e j atan(, ) e j( 3π 4) 3 j4 ( 3) + ( 4) e j atan( 4, 3) 5e j.43 (6) (63) (64) (65) B. Algebraic operations Below we give some examples of algebraic operations with complex numbers: - 7 -
EEL335: Discrete-Time Signals and Systems j 3 [ e j( π ) ] 3 e j( 3π ) j (66) 3e j( π 3) 4e j( π 6) [ 3cos( π 3) + j3sin( π 3) ] + [ 4cos( π 6) j4sin( π 6) ] 3 -- j3 3 ------ 4 3 ------ + j4 -- 3 ----- 3 + j 3 --------- 3 + ( j) 8 [ ( ) + ( ) e j atan(, ) ] 8 [ 6e j.95537 ] 8 ( 6) 8 e j7.6453 96e j7.6453 96cos( 7.6453) + j96sin( 7.6453) 7 j67.4 (67) (68) ( j) + j ----------------- ----------------- ------------------ j j + j + j ------------------.357 + j.333333 6 (69) ( j) [ 6e j atan(, ) ] [ 6e j.95537 ] ------ e j.95537 6 ------ cos(.95537) + j------ sin(.95537) 6 6.357 + j.333333 [Note that equations (69) and (7) yield the same result, through two different approaches.] Im[ je j( π 3) ] Im[ j( cos( π 3) + jsin( π 3) )] Im j -- j 3 + --------- Im j -- 3 + ------ For the derivations below, assume the following complex numbers: (7) (7) z 4 + j3 and z j. (7) Note that the corresponding polar forms are given by, z 5e j atan( 3, 4) and z e j( π 4). (73) Below, some of the operations are carried out in either Cartesian or polar form, while others are carried out using both forms, to show that the same outcome results no matter which form is used. z 4 j3 z ( j) ( j) ( j) j + j j (74) (75) - 8 -
EEL335: Discrete-Time Signals and Systems z [ e j( π 4) ] e j( π ) j z + z ( 4 + j3) + ( + j) 3 + j4 jz j( j) + j (76) (77) (78) jz e j( π ) e j( π 4) e j( π 4) cos( π 4) + j sin( π 4) + j (79) z z ( 4 + j3) ( 4 j3) 6 j 9 5 (8) z z 5e j atan( 3, 4) 5e j atan( 3, 4) 5 (8) e z e ( j) e e j ecos( ) + jesin( ).46869 j.8736 (8) z z z z 4 + j3 4 + j3 + j 7 j ------------------ ------------------ ---------- -------------- 3.5 j.5 j j + j 5e ------------------------------ j atan( 3, 4) e j( π 4) 5 ------e j[ atan( 3, 4) + π 4] 3.53553e j3.8349 3.53553cos( 3.8349) + j3.53553sin( 3.8349) 3.5 j.5 (83) (84) 5. Trigonometric analysis using complex variables The principal reason we introduce complex variables in our study of signals and systems is that they significantly simply mathematical analysis, converting trigonometric functions to complex exponentials through Euler s formula. Below, we show how relatively straightforward it is to verify trigonometric identities using complex exponentials and the Euler relationship. We will specifically make use of the inverse Euler relations, cos e j + e ----------------------- j (85) sin e j e ---------------------- j j (86) presented previously in class and derived from Euler s equation: e j cos + jsin. (87) A. Example # Below, we prove the trigonometric identity, sin( ) sincos (88) using complex exponentials. Substituting equations (85) and (86) into (88): - 9 -
EEL335: Discrete-Time Signals and Systems sin( ) sincos ej e ---------------------- j e j + e ----------------------- j j ---- ( e 4j j e j ) e j e ---------------------------- j j sin( ) (89) B. Example # Below, we prove the trigonometric identity, cos( α+ cosα cosβ sinα sinβ using complex exponentials. Substituting equations (85) and (86) into (9): cos( α+ cosα cosβ sinα sinβ e jα + e ------------------------ jα e jβ + e ----------------------- jβ e jα e ----------------------- jα e jβ e ---------------------- jβ j j -- ( e 4 j( α+ + e j( α + e j( α + + e j( α ) ------- 4j ( e j( α+ e j( α e j( α + + e j( α ) (9) (9) Since, ------- 4j -- 4 (9) we can combine terms from the first and second terms in (9): cosα cosβ sinα sinβ -- ( e 4 j( α+ + e j( α + e j( α + + e j( α ) + -- ( e 4 j( α+ e j( α e j( α + + e j( α ) -- ( e 4 j( α+ + e j( α ) e j( α+ + e ----------------------------------------------- j( α+ cos( α+ (93) Using similar proofs, it is easy to show the following important trigonometric identities: cos( α± cosα cosβ + sinα sinβ (94) sin( α± sinαcosβ± cosαsinβ. (95) C. Example #3: DeMoivre s formula Below, we prove DeMoivre s formula, ( cos + jsin) n cos( n) + jsin( n) using complex exponentials. Using Euler s equation, (96) - -
EEL335: Discrete-Time Signals and Systems ( cos + jsin) cos( n) + jsin( n) ( e j ) n e jn e jn e jn 6. Plotting complex functions Here, we discuss the problem of plotting functions of complex variables f( z). The basic problem in visualizing functions of complex variables is that there are now two dimensions for the independent variable z namely, Re[ z] and Im[ z], or z and arg( z), and two dimensions for the function value fz ( ) namely, Re[ f( z) ] and Im[ f( z) ], or fz ( ) and arg( fz ( )). Therefore, we need four dimensions to plot functions of complex variables. One way to get around this problem is to show how the function transforms sets of lines that lie in the complex plane. Each line in the input space (complex plane) will be mapped into some curve in the output space (complex plane), each of which can be represented in two dimensions. This method of visualizing complex functions is known as complex mapping. A. Complex mappings Figures 5 through 8 show some complex mappings for the following simple functions: f( z) e z f( z) z f( z) sin( z) (Figure 5) (98) (Figure 6) (99) (Figures 7 and 8) () For Figures 5 and 7, the input space lines in the complex plane are defined as a rectangular grid, while for Figures 7 and 8, the input space lines are defined as a polar grid. The rectangular gird corresponds to the Cartesian form z x+ jy, while the polar grid corresponds to the polar form z re j. While most of these mappings are not particularly intuitive (that is, it is difficult to derive these mappings by hand), the mapping in Figure 6 is relatively straightforward to justify. For this polar mapping, (97) f( re j ) re j re j( ) That is, the square root function halves the input angle, as is shown in Figure 6. () B. One-dimensional complex plots Fortunately, in this class, we will most often be concerned with complex functions where we vary only one of the dimensions in the input space namely, arg( z), so that the input space is now one-dimensional. Thus, rather than resort to complex mappings, we can plot f( e j ) as two separate plots: fe ( j ) and, () arg( fe ( j )). (3) Term () above corresponds to the magnitude plot of f as a function of, while term (3) corresponds to the phase plot of f as a function of. Figures 9 through below plot fz ( ) and arg( fz ( )) for z e j and the following example complex-valued functions: f( z) e z f( z) z f( z) sin( z) (Figure 9) (4) (Figure ) (5) (Figure ). (6) (Figures 5 through were generated with the Mathematica notebook complex_functions.nb.). While we could also plot Re[ f( e j )] and Im[ f( e j )] as functions of, we will find that the magnitude and phase functions in () and (3) above will offer more physical insight. - -
EEL335: Discrete-Time Signals and Systems input space output space fz ( ) e z - - - - - - -.5.5 Figure 5 input space output space fz ( ) z.5.5 -.5 -.5 - - -.5.5 Figure 6 -..4.6.8 - -
EEL335: Discrete-Time Signals and Systems input space output space fz ( ) sin( z) 3 - - - -3-3 - - 3 - - -.5.5 Figure 7 input space output space.5 -.5.5 -.5 fz ( ) sin( z ) - - -.5.5 Figure 8 - -.75-.5-.5.5.5.75-3 -
EEL335: Discrete-Time Signals and Systems.5.5.5 fe ( j ) arg( fe ( j )).5 -.5 3 4 5 6 fz ( ) e z Figure 9-3 4 5 6.5.5.5 fe ( j ) arg( fe ( j )) 3 4 5 6.5 -.5 - fz ( ) z Figure -.5 3 4 5 6.5 fe j..5.95.9.85 3 4 5 6 3 ( ) arg( fe ( j )) - - fz ( ) sin( z) Figure -3 3 4 5 6-4 -