ECE 410 Digital Signal Processing D. Munson University of Illinois A. Singer
ECE 410 Digital Signal Processing D. Munson University of Illinois A. Singer
Singer
Overview of Digital Signal Processing Notation: xa(t) ~ analog or continuous signal x(n) or xn ~ sequence 1) Fourier transform of xa(t): Xa() = Inverse: xa(t) = 1 X ( )e jt d 2 a
x a (t)e jt dt
Suppose xa(t) is BL to B = 2F rad/sec = F Hz. Twice the highest frequency in xa(t), i.e., 2F, is referred to as the Nyquist frequency. If we sample above the Nyquist frequency, i.e., 1 T > 2F then it is possible to exactly recover xa(t) from its samples. Specifically xa(t) =
n =
x a (nT) sinc
(t nT)
1 1 = 2F is referred to as sampling at the Nyquist rate. Choosing > 2F is T T referred to as sampling above the Nyquist rate. In practice, we sample above the Nyquist rate so that the samples { x a (nT)} contain all of the information present in xa(t).
n =
sin(t) t
Question: Instead of processing xa(t) directly, can we process its samples? 3) Analog versus Digital Filtering Analog:
xa(t) Analog Filter ya(t)
R, C, op amps
Digital:
{xn } xa(t) T A/D = Q[ xa(nT)] , , storage registers Q[] Digital Filter { yn } D/A ^ ya(t) ya(t)
Example signals:
xa(t)
1.3
xn
yn
^ ya(t)
Digital filter implements a difference equation. For example, might have yn = a0 xn + a1 xn1 + a2 xn2 + + aN xnN or yn = b1 yn1 + b2 yn2 + + bM ynM + a0 xn + + aN xnN (recursive) (nonrecursive)
a is as close as you like to ya. Can choose digital filter coefficients so that y
Digital filter can be implemented using a computer, DSP microprocessor, or specialized hardware. D/A essentially produces an analog signal that passes through the samples {yn}. 4) Simple, 2nd-order digital filter:
1.4
a0 z1 a1 b1 z1 yn2 a2 b2 yn1
yn
(recursive)
To remove noise could use A/D, digital filter, D/A with coefficients in digital filter chosen to place a notch in the frequency response at 60 Hz. 6) Programmable DSPs: TI-TMS 320XX Lucent Motorola 56000 NEC 7720 AT&T 7) More sophisticated uses of DSP: a) Telecommunications: Modulation Coding Echo Cancellation Equalization b) Speech processing: Analysis/Synthesis for low bit-rate transmission Speech Recognition c) Image processing:
1.5 Coding for video conferencing, video phone, fax, HDTV, and image archiving; noise removal; deblurring; object recognition. d) Consumer electronics: CD player, Digital Satellite TV e) Medical imaging: Computer Tomography (CT) Magnetic Resonance Imaging (MRI) 8) Reasons Digital Often Preferred a) More versatile complicated processing, time varying and adaptive filtering, nonlinear processing, multidimensional (especially image processing) b) Guaranteed accuracy determined by register lengths, not nonideal R, L, C, op amps c) Digital often smaller, cheaper, lower power Note: Due to speed limitation of A/Ds and computers, digital signal processing was initially employed (during 1960s) in application areas having low-bandwidth signals, such as speech (BW 3 KHz). The practical frequency range for digital processing has increased vastly over the years and continues to climb. As an example, digital signal processing is now commonly employed in radar, where sampling rates may be tens or even hundreds of megahertz.
We begin with a review of several properties of complex numbers, their representation, and some of their basic properties. The use of complex numbers, complex-valued functions, and functions of a complex variable will prove essential for an understanding of the material in this text, so it is important that before proceeding with the rest of this material, some basic notions are well understood. Without the ability to manipulate complex numbers and functions, our treatment of discrete-time system theory would be much more difficult. There are many ways in which complex numbers may be represented. Two representations that will be used extensively in this text are the rectangular form and the polar form. The rectangular form, also called the Cartesian form, represents a complex number z as an ordered pair of real numbers, usually written z = x + jy , where x and y are real numbers, with x referred to as the real part of z and y referred to as the imaginary part of z and j = 1 . We can write x = {z}, and y = {z}, to illustrate taking the real part and the imaginary part of the complex number z. In polar form, we can write z = re j
1.6 where r>0 is referred to as the magnitude of z and is referred to as the angle (or phase) of z. We can then express these relationships as r = z , and = z , and use Eulers relation e j = cos + j sin , to relate the polar and Cartesian forms for complex numbers as
y r = x 2 + y 2 , and = arctan( x ). These relationships can be obtained by considering the real and imaginary parts of a complex number as points in the complex (x,y) plane. Then the complex number can be thought of as a vector in the plane from the origin to the point (x,y), with the magnitude of the vector being r and the angle formed from the real line to the vector yielding , as in the next figure
y r
Figure: Vector representation of a complex number, relating the polar and Cartesian forms. Eulers relation can be used to relate the real part and imaginary parts with the magnitude and phase.
We see that by Eulers relation, we have z = re j = (r cos ) + j (r sin ), and then we obtain x = r cos , and y = r sin . We can similarly write
x 2 + y 2 = r 2 (cos 2 + sin 2 ) = r , and
such that
y Complex numbers are simply a useful tool that enables us to describe a wider class of equations than do the real numbers alone. For example, if we consider the equation x2 + 1 = 0 , and ask for what values of x does this equation have a solution? We find that when x takes on values from the real numbers, then there are no solutions. However we can learn more about this equation, and about equations involving higher order polynomials in x if we can introduce a solution to this equation. In order to do so, we must now think of the function
= arctan . x
1.7 f ( x) = x 2 + 1 not as a function over the reals, but rather as a function over a new number system one for which a solution to this equation exists. By creating this solution, and giving it the name j, we create a number that did not exist in the reals, namely the square root of -1. By constructing a field of numbers over which our algebraic structures behave as we have come to expect, based on the real numbers, we need to introduce a way to add, subtract, and multiple complex numbers. In Cartesian form, we have that the sum of two complex numbers can be written ( x1 + jy1 ) + ( x2 + jy2 ) = ( x1 + x2 ) + j ( y1 + y2 ) , that is, to add two complex numbers, we simply can use real addition of the real parts and real addition of the imaginary parts, separately to construct the real part and the imaginary part of the sum. Multiplication of two complex numbers in Cartesian form can be written ( x1 + jy1 )( x2 + jy2 ) = ( x1 x2 y1 y2 ) + j ( x1 y2 + x2 y1 ) , where we can apply the distributive law of multiplication over addition, and using our newly formed relation that j2=-1. By using this relation, we can think of j as a variable, and apply the same algebraic manipulations to complex numbers as we would to polynomials in the variable j, so long as once the algebraic manipulations are completed, we agree to replace j2 with the numer -1, and repeat this process until we have exhausted all powers of j. We can then write the resulting complex number in Cartesian form by collecting the remaining terms without this variable, and term them the real part and those that contain the variable become the imaginary part. Suppose we use different notation for a complex number: c=a+ b Using this notation, the real number sitting next to the smiling face is the imaginary part of c and the real number not sitting next to the smiling face is the real part of c. Now, pretend that c is a polynomial in the variable . Then write: c1 c2 = (a1 + b1) (a2 + b2) = a1 a2 + 2 b1 b2 + [a1 b2 + a 2 b1] If we agree to replace 2 by 1 this gives a1 b2 + a 2 b1 c1 c2 = a1 a2 b1 b2 +
which is the right answer! We agree to use j instead of , and everywhere j2 appears we replace it with 1. So, in this sense j2 = 1 but j is just a notational aid. We can now consider algebraic functions of complex variables by considering the functions as taking algebraic operations on the complex numbers, again treating them as polynomials in j, and then reducing the resulting expression into a single complex number after the algebraic operations are complete. For example, for the function f ( z) = z 2 + 1 we can simply write f ( x + jy ) = ( x + jy ) 2 + (1 + j 0) = ( x 2 y 2 + 1) + j (2 xy )
1.8 and see that the resulting value has both a real part and an imaginary part, each of which can be expressed in terms of the real parts and imaginary parts of z. Now the function f itself is complex valued, and notions of graphically displaying such functions is no longer as simple as it was for real-valued functions. However we can simply plot the real part or the imaginary part of f(z), to graphically depict its behavior. Similarly, we could consider other representations of the resulting complex number, such as its polar form, and plot the magnitude, |f|, and the phase, f over the complex (x,y) plane. As a result, we can then ask whether there is any ( x + jy ) at which f ( x + jy ) = (0 + j 0) = 0 , which is true if and only if Re[f] = Im[f] = 0, or if or if and only if |f| = 0. We can check this: 2 f ( x + jy ) = ( x + jy ) + (1 + j0) = ( x 2 y 2 + 1) + j (2 xy ) { 14243 {z} {z} This expression is zero, i.e. (0 + j 0) if and only if x = 0, and y = 1, i.e., if z is a complex variable, then f(z) = 0 at z = (0 1 j ) = j.
If z = x + jy is a complex variable, then we can plot |f( z)| as a surface over the x y plane. It hits zero at the points shown:
1.9
|z 2+1|
9 8 7 6 5 4 3 2 1 0 2
-1
-2
-2
-1
We can similarly plot the phase of the function, i.e. we can plot f(z), over the (x,y) plane.
1.10
2 z +1
To simplify notation, and to accommodate a broad class of operations using complex numbers, we call the complex conjugate, denoted z* , of a complex number z to represent the complex number that has the same real part but an imaginary part with the opposite sign, i.e. for z = x + jy, we have z* = x jy, and z* = r e-j. As a result, we can compactly represent the relationship between the magnitude of a complex number and the number itself, i.e. we have r2 = z*z. We can also obtain (z + z* ) = 2 x, and (z z* ) = j 2 y. Conjugation distributes over addition and multiplication (and division) of complex numbers, i.e. (z1+z2)*= z1*+ z2*, and (z1z2)*= z1* z2*.
Complex Functions of Complex Variables
Recall that X ( s ) , the Laplace transform as given in Equation Error! Reference source not found.), is a complex function of a complex variable. This has a number of important mathematical implications and can be developed in great detail. In this text, however, we will keep our treatment of such functions brief and limited in scope. To continue with the development of the z-transform for sequences, we will briefly review some of the properties of such complex functions. When we say that the function is a complex function, we simply mean that the function takes on values in the complex numbers. That is X ( s ) has both real and imaginary parts, as well as a magnitude and phase. Similarly, when we say that a function is a function of a complex variable, then the argument of the function takes on values in the complex numbers. For example, consider the complex function of the complex variable
1.11
f (z) = z complex variable which takes on values exactly equal to its argument. Now, since the function is complex, it has both real and imaginary parts, and since its argument is complex, it also has both real and imaginary parts. As a result, it is difficult to conceptualize, or to plot, the whole function all at once. This is why we often look at one real-valued property of f ( z ) at a given time, and since the variable is complex, then a single real-valued property can be thought of as a surface over the complex plane. As the variable z takes on all possible values, for which f ( z ) is defined, we can imagine a surface defined by, say, the real-part of f ( z ) . We can now describe the surfaces { f ( z )}, { f ( z )}, | f ( z ) |, and f ( z ) as over the 2-D complex z-plane. Recall that f ( z ) = z = x + jy , so we have that the real-part satisifies, ( f ( z )) = x , which defines a plane through y-axis of the complex z-plane with unit slope. This is shown in Figure 1.
Real Part of f(z), (f(z))
2 1.5 1 0.5 0 -0.5 -1 -1.5 -2 2 1 0 -1 Imaginary Part, (z) -2 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2
1.12
Figure 1 The surface defined by the real-part of the function f ( z ) = z = x + jy is shown as a plane over the complex plane, intersecting complex plane along the y-axis, and linearly increasing as a function of x.
( f ( z )) = y , which defines a plane through x-axis with unit slope as shown in Figure 2.
Imaginary Part of f(z), (f(z))
2 1.5 1 0.5 0 -0.5 -1 -1.5 -2 2 1 0 -1 Imaginary Part, (z) -2 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2
Figure 2 The surface defined by the imaginary-part of the function f ( z ) = z = x + jy is shown as a plane over the complex plane, intersecting complex plane along the x-axis, and linearly increasing as a function of y.
We can also consider the magnitude of the function, f ( z ) , which is non-negative and will always lie on or above the complex plane as shown in Figure 3. Note that for a given value of z, the magnitude is given by | f ( z ) |= x 2 + y 2 . All values of z that take on the same magnitude would trace out a circle in the complex plane. As the magnitude increases, the radius of the circle also increases. As a result, the surface defined by the magnitude, f ( z ) , is an inverted cone, of slope one, centered at the origin.
1.13
3 2.5 2 1.5 1 0.5 0 2 1 0 -1 Imaginary Part, (z) -2 -2 -1.5 -1 -0.5 0 0.5 1 1.5 2
Figure 3 The surface defined by the magnitude of the function f ( z ) = z = x + jy is shown as a cone of slope one over the complex plane, centered at the origin.
Finally, the phase of the function is given by y f ( z ) = arctan x which defines a spiral ramp starting at +x-axis (which z cuts through), and which ramps up in a counter clockwise direction to the height along the x-axis. In the clockwise direction from the +x-axis, the surface ramps down to the level along the x-axis. This is shown in Figure 4.
1.14
Figure 4 The surface defined by the phase of the function f ( z ) = z = x + jy is shown as a spiral ramp through the complex plane.
A real-valued function can be fully described by a plot of the values of the function along an axis describing its independent variable. A complex-valued function of a complex variable can be fully described by the surfaces defined by its real and imaginary parts. Similarly, it can be fully described by the surfaces defined by its magnitude and phase.