Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Digital Signal Processing. The Scientist and Engineers Guide. Steven W. Smith

.pdf
Скачиваний:
140
Добавлен:
02.05.2014
Размер:
7.24 Mб
Скачать

Chapter 29Getting Started with DSPs

547

MATH OPERATIONS

abs

absolute value

acos

arc cosine

asin

arc sine

atan

arc tangent

atan2

arc tangent of quotient

cabsf

complex absolute value

cexpf

complex exponential

cos

cosine

cosh

hyperbolic cosine

cot

cotangent

div

division

exp

exponential

fmod

modulus

log

natural logarithm

log10

base 10 logarithm

matadd

matrix addition

matmul

matrix multiplication

pow

raise to a power

rand

random number generator

sin

sine

sinh

hyperbolic sine

sqrt

square root

srand

random number seed

tan

tangent

tanh

hyperbolic tangent

PROGRAM CONTROL

abort

abnormal program end

calloc

allocate / initialize memory

free

deallocate memory

idle

processor idle instruction

interrupt

define interrupt handling

poll_flag_in

test input flag

set_flag

sets the processor flags

timer_off

disable processor timer

timer_on

enable processor timer

timer_set

initialize processor timer

TABLE 29-3

C library functions. This is a partial list of the functions available when C is used to program the Analog Devices SHARC DSPs.

CHARACTER & STRING MANIPULATION

atoi

convert string to integer

bsearch

binary search of array

isalnum

detect alphanumeric character

isalpha

detect alphabetic character

iscntrl

detect control character

isdigit

detect decimal digit

isgraph

detect printable character

islower

detect lowercase character

isprint

detect printable character

ispunct

detect punctuation character

isspace

detect whitespace character

isupper

detect uppercase character

isxdigit

detect hexadecimal digit

memchr

find first occurrence of char

memcpy

copy characters

strcat

concatenate strings

strcmp

compare strings

strerror

get error message

strlen

string length

strncmp

compare characters

strrchr

find last occurrence of char

strstr

find string within string

strtok

convert string to tokens

system

sent string to operating system

tolower

change uppercase to lowercase

toupper

change lowercase to uppercase

SIGNAL PROCESSING

a_compress

A-law compressing

a_expand

A-law expansion

autocorr

autocorrelation

biquad

biquad filter section

cfftN

complex FFT

crosscorr

cross-correlation

fir

FIR filter

histogram

histogram

iffN

inverse complex FFT

iir

IIR filter

mean

mean of an array

mu_compress

mu law compression

mu_expand

mu law expansion

rfftN

real FFT

rms

rms value of an array

DSPs. A tremendous advantage of using C is the library of functions, both standard C operations, as well as DSP algorithms. Table 29-3 shows a partial list of the C library functions for the SHARC DSPs. The math group includes many functions common in DSP, such as the trig functions (sin, cos, tan, etc.), logarithm, and exponent. If you need these type of functions in your program, this is probably enough motivation in itself to use C instead of assembly. Pay special attention to the "signal processing" routines in Table 29-3. Here you will find key DSP algorithms, including: real and complex FFTs, FIR and IIR filters, and statistical functions such as the mean, rms value, and variance. Of course, all these routines are written in assembly, allowing them to be very efficient in both speed and memory usage.

548

The Scientist and Engineer's Guide to Digital Signal Processing

 

 

/*

CIRCBUF.C

*/

 

/*

This is an echo program written in C for the ADSP-21061 EZ-KIT Lite. The

*/

 

/*

echo program takes the talkthru program and adds a circular buffering scheme.

*/

/*

The circular buffer is defined by the functions CIRCULAR_BUFFER, BASE,

 

*/

/*

and LENGTH. The echo is performed by adding the current input to the oldest

*/

/*

input. The delay in the echo can be modified by changing BUFF_LENGTH.

*/

 

/*

 

 

*/

/*

 

 

*/

#include <21020.h>

/*

for the idle() command */

 

#include <signal.h>

/*

for the interrupt command

*/

#include <macros.h>

/* for the CIRCULAR_BUFFER and segment functions */

#define BUFF_LENGTH 4000

/*

define echo as 21k DAG1 reg i1

*/

 

CIRCULAR_BUFFER (float,1,echo)

/*

a DM pointer to a circular buffer

*/

volatile float in_port segment (hip_reg0);

/*

hip_reg0 and hip-reg2 are */

 

volatile float out_port segment (hip_reg2);

/*

used in the architecture file */

 

void process_input (int); void main (void)

{

/*

Make this a variable length array. If emulator is stopped at main

 

*/

 

 

/* and _BUFF_LENGTH in dm window is modified, the echo delay

 

*/

 

 

/*

is modified. Do not make BUFF_LENGTH greater than stack size!

*/

 

float data_buff [BUFF_LENGTH];

 

 

 

 

 

interrupt (SIG_IRQ3, process_input);

 

 

 

 

 

BASE (echo) = data_buff;

/*

Loads b1 and i1 with buff start adr

*/

LENGTH (echo) = BUFF_LENGTH;

/* Loads L1 with the length of the buffer */

 

/*

as the array is filled, the nth location contains the newest value, while */

 

 

 

/*

the nth + 1 location contains the oldest value. */

 

 

 

while (1)

 

 

 

 

 

 

{

 

/*

the echo sends the sum of the most

*/

 

float oldest, newest;

/*

recent value and the oldest value

*/

 

 

idle();

 

 

 

 

 

 

 

/*

Echo is pointing to the nth location after the interrupt routine.

*/

 

 

 

/*

Place the new value in variable 'newest'. After the access, update

 

*/

 

 

/*

the pointer by one to point at location n+1.

*/

 

 

 

CIRC_READ (echo, 1, newest, dm);

 

 

 

 

 

 

/*

Now echo is pointing to n+1.

Read the location and place value in

*/

 

 

/*

variable 'oldest'. Do not update the pointer, since it is now

 

*/

 

 

/*

pointing to the new location for the interrupt handler.

*/

 

 

 

CIR_READ (echo, 0, oldest, dm);

 

 

 

 

 

 

/*

add the oldest and most recent and send out on port

*/

 

 

 

out_port=oldest+newest;

 

 

 

 

 

}

}

 

 

 

 

 

 

 

 

 

 

 

 

 

void process_input (int int_number)

 

 

 

 

 

{

/* The newest input value is written over the oldest value in the nth */

 

 

 

 

 

 

/*

location and the pointer is not updated.

 

 

*/

 

}

CIRC_WRITE (echo, 0, in_port, dm);

 

 

 

 

 

 

 

 

 

 

 

TABLE 29-4

Chapter 29Getting Started with DSPs

549

1

2

4

5

3

1.Move easily between Edit, Build, and Debug activities

2.Mix Assembly and C in a common source file

3.View "build" results

4.Powerful editor understands syntax

5.Easy access through bookmarks

FIGURE 29-7

Example screen from VisualDSP. This provides an integrated development environment for creating programs on the SHARC. All of the following functions can be accessed from this single interface: editing, compiling, assembling, linking, simulating, debugging, downloading, and PROM creation.

Table 29-4 shows an example C program, taken from the Analog Devices' "C Compiler Guide and Reference Manual." This program generates an echo by adding a delayed version of the signal to itself. The most recent 4000 samples from the input signal are stored in a circular buffer. As each sample is acquired, the circular buffer is updated, the newest sample is added to a scaled version of the oldest sample, and the resulting sample directed to the output.

The next advanced software tool you should look for is an integrated development environment. This is a fancy term that means everything needed to program and test the DSP is combined into one smoothly functioning package. Analog Devices provides an integrated development environment in a product called VisualDSP® , running under Windows® 95 and Windows NTTM. Figure 29-7 shows an example of the main screen, providing a seamless way to edit, build, and debug programs.

Here are some of the key features of VisualDSP, showing why an integrated development environment is so important for fast software development. The editor is specialized for creating programs in C, assembly, and a mixture of the two. For instance, it understands the syntax of the languages, allowing it to display different types of statements in different colors. You can also

550

The Scientist and Engineer's Guide to Digital Signal Processing

1

2

 

 

 

3

 

 

 

 

 

 

1.Profile code to identify bottlenecks

2.View mixed C and Assembly listings

3.Create custom Register window

FIGURE 29-8

VisualDSP debugging screen. This is a common interface for both simulation and emulation. It can view a C program interspersed with the resulting assembly code, track execution of instructions; examine registers (hardware, software, and memory); trace bus activity; and many other tasks.

edit more than one file at one. This is very convenient, since the final program is created by linking several files together.

Figure 29-8 shows an example screen from the VisualDSP debugger. This is an interface to two different types of tools: simulators and emulators. Simulators test the code within the personal computer, without even needing a DSP to be present. This is generally the first debugging step after the program is written. The simulator mimics the architecture and operation of the hardware, including: input data streams, interrupts and other I/O. Emulators (such as the Analog Devices EZ-ICE® ) examine the program operation on the actual hardware. This requires the emulator software (on your PC) to be able to monitor the electrical signals inside of the DSP. To support this, the SHARC DSPs feature an IEEE 1140.1 JTAG Test Access Port, allowing an external device to track the processor's internal functions.

After you have used an evaluation kit and given some thought to purchasing advanced software tools, you should also consider attending a training class. These are given by many DSP manufacturers. For instance, Analog Devices offers a 3 day class, taught several time a year, at several different locations. These are a great way of learning about DSPs from the experts. Look at the manufacturer's websites for details.

CHAPTER

Complex Numbers

30

Complex numbers are an extension of the ordinary numbers used in everyday math. They have the unique property of representing and manipulating two variables as a single quantity. This fits very naturally with Fourier analysis, where the frequency domain is composed of two signals, the real and the imaginary parts. Complex numbers shorten the equations used in DSP, and enable techniques that are difficult or impossible with real numbers alone. For instance, the Fast Fourier Transform is based on complex numbers. Unfortunately, complex techniques are very mathematical, and it requires a great deal of study and practice to use them effectively. Many scientists and engineers regard complex techniques as the dividing line between DSP as a tool, and DSP as a career. In this chapter, we look at the mathematics of complex numbers, and elementary ways of using them in science and engineering. The following three chapters discuss important techniques based on complex numbers: the complex Fourier transform, the Laplace transform, and the z-transform. These complex transforms are the heart of theoretical DSP. Get ready, here comes the math!

The Complex Number System

To illustrate complex numbers, consider a child throwing a ball into the air. For example, assume that the ball is thrown straight up, with an initial velocity of 9.8 meters per second. One second after it leaves the child's hand, the ball has reached a height of 4.9 meters, and the acceleration of gravity (9.8 meters per second2) has reduced its velocity to zero. The ball then accelerates toward the ground, being caught by the child two seconds after it was thrown. From basic physics equations, the height of the ball at any instant of time is given by:

 

& g t 2

h '

 

% v t

2

 

 

551

552

The Scientist and Engineer's Guide to Digital Signal Processing

where h is the height above the ground (in meters), g is the acceleration of gravity (9.8 meters per second2), v is the initial velocity (9.8 meters per second), and t is the time (in seconds).

Now, suppose we want to know when the ball passes a certain height. Plugging in the known values and solving for t:

t ' 1 ± 1& h /4.9

For instance, the ball is at a height of 3 meters twice: t ' 0.38 (going up) and t ' 1.62 seconds (going down).

As long as we ask reasonable questions, these equations give reasonable answers. But what happens when we ask unreasonable questions? For example: At what time does the ball reach a height of 10 meters? This question has no answer in reality because the ball never reaches this height. Nevertheless, plugging the value of h ' 10 into the above equation gives two answers: t ' 1 % & 1.041 and t ' 1 & & 1.041 . Both these answers contain the square-root of a negative number, something that does not exist in the world as we know it. This unusual property of polynomial equations was first used by the Italian mathematician Girolamo Cardano (1501-1576). Two centuries later, the great German mathematician Carl Friedrich Gauss (1777-1855) coined the term complex numbers, and paved the way for the modern understanding of the field.

Every complex number is the sum of two components: a real part and an imaginary part. The real part is a real number, one of the ordinary numbers we all learned in childhood. The imaginary part is an imaginary number, that is, the square-root of a negative number. To keep things standardized, the imaginary part is usually reduced to an ordinary number multiplied by the square-root of negative one. As an example, the complex

 

 

 

 

 

 

 

number: t ' 1 % & 1.041 , is first reduced to: t ' 1 % 1.041 & 1 , and then to

the final form: t ' 1 % 1.02

& 1

.

The real part of this complex number is 1,

while the imaginary part is 1.02

& 1

. This notation allows the abstract term,

& 1

, to be given a special symbol. Mathematicians have long used i to denote

& 1

. In comparison, electrical engineers use the symbol, j, because i is used

to represent electrical current. Both symbols are common in DSP. In this book the electrical engineering convention, j, will be used.

For example, all the following are valid complex numbers: 1 % 2 j , 1 & 2 j , & 1 % 2 j , 3.14159 % 2.7183 j , (4/3) % (19/2) j , etc. All ordinary numbers, such as: 2, 6.34, and -1.414, can be viewed as a complex number with zero for the imaginary part, i.e., 2 % 0 j , 6.34 % 0 j , and & 1.414 % 0 j .

Just as real numbers are described as having positions along a number line, complex numbers are represented by locations in a two-dimensional display called the complex plane. As shown in Fig. 30-1, the horizontal axis of the

Chapter 30Complex Numbers

553

FIGURE 30-1

The complex plane. Every complex number has a unique location in the complex plane, as illustrated by the three examples shown here. The horizontal axis represents the real part, while the vertical axis represents the imaginary part.

Imaginary axis

8j

7j

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2 + 6 j

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

6j

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

5j

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

4j

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3j

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

2j

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1j

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

0j

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

--1j

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

--2j

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

-4 - 1.5 j

 

 

 

 

 

 

 

 

 

 

--3j

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

--4j

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

--5j

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

--6j

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

--7j

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

3 - 7 j

 

 

 

 

 

--8j

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

-8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Real axis

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

complex plane is the real part of the complex number, while the vertical axis is the imaginary part. Since real numbers are those complex numbers that have an imaginary part equal to zero, the real number line is the same as the x-axis of the complex plane.

In mathematical equations, a complex number is represented by a single variable, even though it is composed of two parts. For example, the three complex variables in Fig. 30-1 could be written:

A ' 2 % 6 j

B' & 4 & 1.5 j

C' 3 & 7 j

where A, B, & C are complex variables. This illustrates a strong advantage and a strong disadvantage of using complex numbers. The advantage is the inherent shorthand of representing two things by a single symbol. The disadvantage is having to remember which variables are complex and which variables are ordinary numbers.

The mathematical notation for separating a complex number into its real and imaginary parts uses the operators: Re ( ) and Im ( ) . For example, using the above complex numbers:

Re A = 2

Im A = 6

Re B

= -4

Im B = -1.5

Re C

= 3

Im C = -7

554 The Scientist and Engineer's Guide to Digital Signal Processing

Notice that the value returned by the mathematical operator, Im ( ), does not include the j. For example, Im (3 % 4 j ) is equal to 4, not 4 j .

Complex numbers follow the same algebra as ordinary numbers, treating the quantity, j, as a constant. For instance, addition, subtraction, multiplication and division are given by:

EQUATION 30-1

Addition of complex numbers.

EQUATION 30-2

Subtraction of complex numbers.

EQUATION 30-3

Multiplication of complex numbers.

EQUATION 30-4

Division of complex numbers.

(a % b j ) % (c % d j ) ' (a % c ) % j (b % d )

(a % b j ) & (c % d j ) ' (a & c ) % j (b & d )

(a % b j ) (c % d j ) ' (ac & bd ) % j (bc % ad )

(a % b j )

'

a c % b d

% j

 

 

b c & a d

 

 

 

 

 

 

c 2 % d 2

(c % d j )

c 2 % d 2

 

 

Two tricks are used when manipulating equations such as these. First, whenever a j 2 term is encountered, it is replaced by -1. This follows from the definition of j, that is: j 2 ' (& 1 )2 ' & 1 . The second trick is a way to eliminate the j term from the denominator of a fraction. For instance, the left side of Eq. 30-4 has a denominator of c % d j . This is handled by multiplying the numerator and denominator by the term c & jd , cancelling all the imaginary terms from the denominator. In the jargon of the field, switching the sign of the imaginary part of a complex number is called taking the complex conjugate. This is denoted by a star at the upper right corner of the variable. For example, if Z ' a % b j , then Z t ' a & b j . In other words, Eq. 30- 4 is derived by multiplying both the numerator and denominator by the complex conjugate of the denominator.

The following properties hold even when the variables A, B, and C are complex. These relations can be proven by breaking each variable into its real and imaginary parts and working out the algebra.

EQUATION 30-5 Commutative property.

EQUATION 30-6 Associative property.

EQUATION 30-7 Distributive property.

A B ' B A

(A % B ) % C ' A % (B % C )

A (B % C ) ' AB % AC

Chapter 30Complex Numbers

555

Polar Notation

Complex numbers can also be expressed in polar notation, besides the rectangular notation just described. For example, Fig. 30-2 shows three complex numbers in polar form, the same ones previously presented in Fig. 30-1. The magnitude is the length of the vector starting at the origin and ending at the complex point, while the phase angle is measured between this vector and the positive x-axis. Complex numbers can be converted between rectangular and polar notation by the following equations (paying attention to the polar notation nuisances discussed in Chapter 8):

EQUATION 30-8

Rectangular-to-polar conversion. The complex variable, A, can be changed from rectangular form: Re A & Im A, to polar form: M & 2.

EQUATION 30-9

Polar-to-rectangular conversion. This is changing the complex number from M & 2 to Re A & Im A.

M ' (Re A)2 % (Im A)2

Im A

2 ' arctan

Re A

Re A ' M cos (2)

Im A ' M sin(2)

This brings up a giant leap in the mathematics. (Yes, this means you should pay extra attention). A complex number written in rectangular notation

FIGURE 30-2

Complex numbers in polar form. Three example points in the complex plane are shown in polar coordinates. Figure 30-1 shows these same points in rectangular form.

 

8j

 

 

 

7j

 

2 + 6 j or

 

6j

 

 

 

M = %40

 

5j

 

 

 

2 = arctan (6/2)

 

4j

 

 

 

3j

 

 

axis

2j

 

 

1j

 

 

Imaginary

 

 

0j

 

 

--1j

 

 

--2j

 

 

 

 

 

 

--3j

-4 - 1.5 j or

 

 

M = %18.25

 

 

--4j

 

 

2 = arctan (-1.5/-4)

3 - 7 j or

 

-

 

M = %58

 

-5j

 

 

--6j

 

2 = arctan (-7/3)

 

 

 

 

--7j

 

 

 

--8j

 

 

 

 

-8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8

Real axis

556

The Scientist and Engineer's Guide to Digital Signal Processing

is in the form: a % b j . The information is carried in the variables: a & b , but the proper complex number is the entire expression: a % b j . In polar form, the key information is contained in M & 2, but what is the full expression for the proper complex number?

The key to this is Eq. 30-9, the polar-to-rectangular conversion. If we start with the proper complex number, a % b j , and apply Eq. 30-9, we obtain:

EQUATION 30-10

Rectangular and polar complex numbers. The left side is the rectangular form of a complex number, while the expression on the right is the polar representation. The conversion between: M & 2 and a & b, is given by Eqs. 30-8 and 30-9.

a % j b ' M ( cos 2 % j sin 2 )

The expression on the left is the proper rectangular description of a complex number, while the expression on the right is the proper polar description.

Before continuing with the next step, let's review how we arrived at this point. First, we gave the rectangular form of a complex number a graphical representation, that is, a location in a two-dimensional plane. Second, we defined the terms M & 2 to be consistent with our previous experience about the relationship between polar and rectangular coordinates (Eq. 30-8 and 30-9). Third, we followed the mathematical consequences of these actions, arriving at what the correct polar form of a complex number must be, i . e . , M (cos2% j sin 2) . Even though this logic is straightforward, the result is difficult to see with "intuition." Unfortunately, it gets worse.

One of the most important equations in complex mathematics is Euler's relation, named for the clever and very prolific Swiss mathematician, Leonhard Euler (1707-1783; Euler is pronounced: "Oiler"):

EQUATION 30-11

 

 

e jx ' cos x % j sin x

 

 

 

 

 

 

 

 

 

Euler's relation. This is a key equation

 

 

 

 

 

 

 

 

 

 

 

for using complex numbers in science

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

and engineering.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

If you like such things, this relation can be proven by expanding the

exponential term into a Taylor series:

 

 

 

 

 

 

 

 

 

 

 

 

4

 

 

 

 

 

 

 

4

 

%

1

 

 

 

 

 

 

 

 

4

 

 

 

 

 

 

 

 

 

e jx ' j

( j x )n

'

 

j (&1)k

x 2k

 

% j

j (&1)k

x 2k

 

 

 

 

 

 

 

 

 

 

 

 

 

 

n !

 

(2k)!

(2k %1 )!

 

 

 

 

n ' 0

 

 

k ' 0

 

 

k ' 0

 

 

 

 

 

 

 

 

 

 

The two bracketed terms on the right of this expression are the Taylor series for cos(x) and sin(x) . Don't spend too much time on this proof; we aren't going to use it for anything.

Соседние файлы в предмете Электроника