Upload
others
View
2
Download
0
Embed Size (px)
Citation preview
DSP-First, 2/e
LECTURE #3Complex Exponentials& Complex Numbers
Aug 2016 1© 2003-2016, JH McClellan & RW Schafer
License Info for SPFirst Slides
§ This work released under a Creative Commons Licensewith the following terms:
§ Attribution§ The licensor permits others to copy, distribute, display, and perform
the work. In return, licensees must give the original authors credit.
§ Non-Commerical§ The licensor permits others to copy, distribute, display, and perform
the work. In return, licensees may not use the work for commercial purposes—unless they get the licensor's permission.
§ Share Alike§ The licensor permits others to distribute derivative works only under
a license identical to the one that governs the licensor's work.§ Full Text of the License§ This (hidden) page should be kept with the presentation
Aug 2016 2© 2003-2016, JH McClellan & RW Schafer
Aug 2016 © 2003-2016, JH McClellan & RW Schafer 3
READING ASSIGNMENTS
§ This Lecture:§ Chapter 2, Sects. 2-3 to 2-5
§ Appendix A: Complex Numbers
§ Appendix B: MATLAB§ Next Lecture: Complex Exponentials
LECTURE OBJECTIVES
§ Introduce more tools for manipulating complex numbers§ Conjugate§ Multiplication & Division§ Powers§ N-th Roots of unity
1,For /2 == NNkj zez p
Aug 2016 4© 2003-2016, JH McClellan & RW Schafer
LECTURE OBJECTIVES
§ Phasors = Complex Amplitude§ Complex Numbers represent Sinusoids
§ Next Lecture: Develop the ABSTRACTION:§ Adding Sinusoids = Complex Addition§ PHASOR ADDITION THEOREM
}){()cos( tjj eAetA wjjw Â=+
Aug 2016 5© 2003-2016, JH McClellan & RW Schafer
WHY? What do we gain?
§ Sinusoids are the basis of DSP, § but trig identities are very tedious
§ Abstraction of complex numbers § Represent cosine functions§ Can replace most trigonometry with algebra
§ Avoid all Trigonometric manipulationsAug 2016 6© 2003-2016, JH McClellan & RW Schafer
COMPLEX NUMBERS
§ To solve: z2 = -1§ z = j§ Math and Physics use z = i
§ Complex number: z = x + j y
x
y zCartesiancoordinatesystem
Aug 2016 7© 2003-2016, JH McClellan & RW Schafer
PLOT COMPLEX NUMBERS
}{zx Â=
}{zy Á=
Real part:
Imaginary part:}05{5 j+-Â=-
5}52{ =+Á j2}52{ =+Â j
Aug 2016 8© 2003-2016, JH McClellan & RW Schafer
COMPLEX ADDITION = VECTOR Addition
26)53()24()52()34(
213
jj
jjzzz
+=+-++=++-=
+=
Aug 2016 9© 2003-2016, JH McClellan & RW Schafer
*** POLAR FORM ***
§ Vector Form§ Length =1§ Angle = q
§ Common Values§ j has angle of 0.5p§ -1 has angle of p§ - j has angle of 1.5p § also, angle of -j could be -0.5p = 1.5p -2p§ because the PHASE is AMBIGUOUS
Aug 2016 10© 2003-2016, JH McClellan & RW Schafer
POLAR <--> RECTANGULAR
§ Relate (x,y) to (r,q) rqx
y
Need a notation for POLAR FORM
( )xyyxr1
222
Tan-=
+=
q
sincosryrx
==
Most calculators doPolar-Rectangular
Aug 2016 11© 2003-2016, JH McClellan & RW Schafer
Euler’s FORMULA
§ Complex Exponential§ Real part is cosine§ Imaginary part is sine§ Magnitude is one
re jq = rcos(q)+ jrsin(q)
)sin()cos( qqq je j +=
Aug 2016 12© 2003-2016, JH McClellan & RW Schafer
Cosine = Real Part
§ Complex Exponential§ Real part is cosine§ Imaginary part is sine
)sin()cos( qqq jrrre j +=
)cos(}{ qq rre j =ÂAug 2016 13© 2003-2016, JH McClellan & RW Schafer
Common Values of exp(jq)
§ Changing the anglepq njj eej 200110 ==+=®=
4/21 pjej ±=±
pppq )2/12(2/2/ +==®= njj eej
pppq )12(011 +==+-=-®= njj eej
ppppq )2/12(2/2/32/3 -- ===-®= njjj eeej
?1 =+± jAug 2016 14© 2003-2016, JH McClellan & RW Schafer
COMPLEX EXPONENTIAL
§ Interpret this as a Rotating Vector§ q = wt§ Angle changes vs. time§ ex: w=20p rad/s§ Rotates 0.2p in 0.01 secs
)sin()cos( tjte tj www +=
)sin()cos( qqq je j +=Aug 2016 15© 2003-2016, JH McClellan & RW Schafer
Cos = REAL PART
}{}{)cos( )(
tjj
tj
eAeAetA
wj
jwjw
Â=
Â=+ +So,
Real Part of Euler’s
}{)cos( tjet ww Â=General Sinusoid
)cos()( jw += tAtx
Aug 2016 16© 2003-2016, JH McClellan & RW Schafer
COMPLEX AMPLITUDE
}{)cos()( tjj eAetAtx wjjw Â=+=General Sinusoid
)}({}{)( tzXetx tj Â=Â= w
Sinusoid = REAL PART of complex exp: z(t)=(Aejf)ejwt
Complex AMPLITUDE = X, which is a constant
tjj XetzAeX wj == )(whenAug 2016 17© 2003-2016, JH McClellan & RW Schafer
POP QUIZ: Complex Amp§ Find the COMPLEX AMPLITUDE for:
§ Use EULER’s FORMULA:
p5.03 jeX =
)5.077cos(3)( pp += ttx
}3{
}3{)(775.0
)5.077(
tjj
tj
ee
etxpp
pp
Â=
Â= +
Aug 2016 18© 2003-2016, JH McClellan & RW Schafer
POP QUIZ-2: Complex Amp§ Determine the 60-Hz sinusoid whose
COMPLEX AMPLITUDE is:
§ Convert X to POLAR:33 jX +=
)3/120cos(12)( pp +=Þ ttx
}12{
})33{()(1203/
)120(
tjj
tj
ee
ejtxpp
p
Â=
+Â=
Aug 2016 19© 2003-2016, JH McClellan & RW Schafer
COMPLEX CONJUGATE (z*)
§ Useful concept: change the sign of all j’s
§ RECTANGULAR: If z = x + j y, then the complex conjugate is z* = x – j y
§ POLAR: Magnitude is the same but angle has sign change
z = re jq Þ z*= re- jqAug 2016 20© 2003-2016, JH McClellan & RW Schafer
COMPLEX CONJUGATION
§ Flips vector about the real axis!
Aug 2016 21© 2003-2016, JH McClellan & RW Schafer
USES OF CONJUGATION
§ Conjugates useful for many calculations§ Real part:
§ Imaginary part:
}{2
)()(2* zxjyxjyxzz
Â==-++
=+
}{22
2* zy
jyj
jzz
Á===-
Aug 2016 22© 2003-2016, JH McClellan & RW Schafer
Inverse Euler Relations§ Cosine is real part of exp, sine is imaginary part§ Real part:
§ Imaginary part:)cos(
2}{,
}{2*
qqq
qq =+
=ÂÞ=
Â=+
- jjjj eeeez
zzz
)sin(2
}{,
}{2*
qqq
qq =-
=ÁÞ=
Á==-
-
jeeeez
zyjzz
jjjj
Aug 2016 23© 2003-2016, JH McClellan & RW Schafer
Mag & Magnitude Squared
§ Magnitude Squared (polar form):
§ Magnitude Squared (Cartesian form):
§ Magnitude of complex exponential is one:
22 ||))((* zrrerezz jj === - qq
|e jq |2= cos2 q( )+ sin2 q( )=1
z z*= (x + jy)´ (x - jy) = x2 - j 2y2 = x2 + y2
Aug 2016 24© 2003-2016, JH McClellan & RW Schafer
COMPLEX MULTIPLY = VECTOR ROTATION
§ Multiplication/division scales and rotates vectors
Aug 2016 25© 2003-2016, JH McClellan & RW Schafer
POWERS
§ Raising to a power N rotates vector by Nθ and scales vector length by rN
zN = re jq( )N = rNe jNq
Aug 2016 26© 2003-2016, JH McClellan & RW Schafer
MORE POWERS
§
Aug 2016 27© 2003-2016, JH McClellan & RW Schafer
ROOTS OF UNITY
§ We often have to solve zN=1§ How many solutions?
kjNjNN eerz pq 21===
NkkNr pqpq 22,1 =Þ==Þ
1,2,1,0,2 -== Nkez Nkj !p
Aug 2016 28© 2003-2016, JH McClellan & RW Schafer
ROOTS OF UNITY for N=6
§ Solutions to zN=1 are N equally spaced vectors on the unit circle!
§ What happens if we take the sum of all of them?
Aug 2016 29© 2003-2016, JH McClellan & RW Schafer
Sum the Roots of Unity
§ Looks like the answer is zero (for N=6)
§ Write as geometric sum
e j2p k /N
k= 0
N-1
å = 0?
rkk= 0
N-1
å =1- rN
1- rthen let r = e j2p /N
01)(11Numerator 2/2 =-=-=- pp jNNjN eerAug 2016 30© 2003-2016, JH McClellan & RW Schafer
§ Needed later to describe periodic signals in terms of sinusoids (Fourier Series)
§ Especially over one period
jee
jede
jajbb
a
b
a
jj -
==òq
q q
0110/2
0
/2 =-
=-
=ò jjeedtejTTjT
Ttjp
p
Integrate Complex Exp
Aug 2016 31© 2003-2016, JH McClellan & RW Schafer
BOTTOM LINE
§ CARTESIAN: Addition/subtraction is most efficient in Cartesian form
§ POLAR: good for multiplication/division§ STEPS:
§ Identify arithmetic operation§ Convert to easy form§ Calculate§ Convert back to original form
Aug 2016 32© 2003-2016, JH McClellan & RW Schafer
Harder N-th Roots
§ Want to solve zN = c§ where c is a complex number
kjjNjNN eecerz pjq r 2)(===
NkkNr N pjqpjqr 22, +
=Þ+==Þ
1,2,1,0,2/ -== Nkeez NkjNjN !pjr
Aug 2016 33© 2003-2016, JH McClellan & RW Schafer
Euler’s FORMULA
§ Complex Exponential§ Real part is cosine§ Imaginary part is sine§ Magnitude is one
)sin()cos( tjte tj www +=
)sin()cos( qqq je j +=
Aug 2016 34© 2003-2016, JH McClellan & RW Schafer
Real & Imaginary Part Plots
PHASE DIFFERENCE = p/2
Aug 2016 35© 2003-2016, JH McClellan & RW Schafer
COMPLEX EXPONENTIAL
§ Interpret this as a Rotating Vector§ q = wt§ Angle changes vs. time§ ex: w=20p rad/s§ Rotates 0.2p in 0.01 secs
e jjq q q= +cos( ) sin( )
)sin()cos( tjte tj www +=
Aug 2016 36© 2003-2016, JH McClellan & RW Schafer
Rotating Phasor
See Demo on CD-ROMChapter 2
Aug 2016 37© 2003-2016, JH McClellan & RW Schafer
AVOID Trigonometry
§ Algebra, even complex, is EASIER !!!§ Can you recall cos(q1+q2) ?
§ Use: real part of ej(q1+q2) = cos(q1+q2)
( ) }{}{cos 2121 )(21
qqqqqq jjj eeeee Â=Â=+ +
)}sin)(cossin{(cos 2211 qqqq jje ++Â=
(...))sinsincos(cos 2121 j+-= qqqqAug 2016 38© 2003-2016, JH McClellan & RW Schafer
MULTIPLICATION§ CARTESIAN: use polynomial algebra
§ POLAR: easier because you can leverage the properties of exponentials
§ Multiply the magnitudes and add the angles
)(212121
2121 qqqq +=´=´ jjj errererzz
z1 ´ z2 = (x1 + jy1)´ (x2 + jy2)
= (x1x2 - y1y2)+ j(x1y2 - y1x2)
Aug 2016 39© 2003-2016, JH McClellan & RW Schafer
DIVISION
§ CARTESIAN: use complex conjugate to convert to multiplication:
§ POLAR: simpler to subtract exponents
z1z2
=r1e
jq1
r2ejq 2
=r1r2e j(q1-q 2 )
22
*21
*22
*21
22
11
2
1
||)()(
zzz
zzzz
jyxjyx
zz
==++
=
Aug 2016 40© 2003-2016, JH McClellan & RW Schafer
Complex Numbers
§ WHY? need to ADD sinusoids
§ Use an ABSTRACTION§ Complex Amplitude, X, has mag & phase§ Complex Exponential§ Euler’s Formula
z(t) = Xe jw t
s(t) = k cos(120p(t -0.002k))k=1
20
å
Aug 2016 41© 2003-2016, JH McClellan & RW Schafer