+ All Categories
Home > Documents > An Introduction to the Mathematics of Digital Signal Processing - Part 1

An Introduction to the Mathematics of Digital Signal Processing - Part 1

Date post: 07-Mar-2015
Category:
Upload: greg-surges
View: 278 times
Download: 3 times
Share this document with a friend
10
An Introduction to the Mathematics of Digital Signal Processing Part L Algebra, Tiigonometry, arrd The Most Beautiful Formula in IVlathenratics @ 1978 F. R. Moore F. R. Moore Bell Laboratories Murray Hill, New Jersey 07974 Introduction As it says in the front of the Conputer Music Journal number 4, thcre are many musicians wilh an interest in musical signal processing with computers, but only a few have much competence in this area. There is of course a huge amount of literature in the field of digital signal processilrg, includlng some first-rate textbooks (such as l{abiner and Cold's Theory and Application of Digital Signal Processing, or Oppenheinr and Schafer's Digital Signal Processrrg), but most of the literature assumes that the reader is a graduate student in cngineering or computer sciencc (why else rvould lre be interested?), that hc wants to know everythittg about digitai signal processing, and that he already knows a trcat dcal sbout mathentatics and computcrs. Consequently, nruch of this information is shrouded in mathematical mystery to the musical reader, making it difficult to distinguish the wheat from the chaff, so to speak. Digital signal processing r a very mathematical subject, so to make past articlcs clearer and future articles possible, the basic mathematical ideas needed are presented in this two-part tutorial. In order to prevent this presentation from turning into several fat books, only the main ideas can be outlined; and rnathematical proofs are of course omitted. But keep in mirrd that learning mathematics is much like learning to play a piano: no amount of reading will suffice-it is necessary to actually practice the techniques described (in this case, by doing the problenrs) before the concepts becomc useful in the "rcal" world, flrerefore sonre problenrs are provided (without answers) to give the motivated reader an opportunity both to test his understanding and to acquire :, ,ine skill. Part I of the tutorial (this part) provides a general review of algebra and trigonontetry, including srrch areas as equations, graphs, polynonrials, logarithnrs, contplcx nuurbers, inl'inite series, radian mea$.rres, and lhe basic trigononre tric lirnctions. Part II will discuss the application of tlrese concepts and otlrers ilt transfonns, such as thc Fourier and z.translbmrs, transfer functions, impulse response, convotulicrrr, polcs and zeroes, and elementary filtering. Insofur as possible. thc ntathcmarical treatment always stops just short of using calculus, though a .deep understanding of nrany ol thc concepts presentcd requires understanding of calculus. Ilut digilal signal prr:cessing inherently rcquires less calculus than analog signal proccssing. since the intcgral signs arc rcplaced by the easier-to- understand diserete sutnntations. lt is an experimcntal goal of this tutorial to see hory far into digital signal processing it is possible to explore without calculus. Algebra To most people, mathcmatics rneaas lonnulas antl equations, which are expressions dcscribing the relationships among quitntities. As Iong as thc relationships do not rrse thc integration or diffcrentiation ideas of calculus. they usually, fall into the general donrain of algebra, nanred after the arabic best-seller of the 9th cenlury, Kitab al jobr w'al-ntuqabola ("Rules of Restoration and Reduction") by Abu Ju'far Mohammed ibn }{fisi al-Khowlriznri (frorn whosc narnc thc word algoithnr is derived). r Algebra is, in fact, nrercly a systernatic notation of quan- titative relationsirips anlong nurnerical, qulntities, usually called variables, since with algebra u,e balr ntanipulate the Page 38 Computer Music Journal, Box E, Mento Park, CA g4O25 Volume llNumbcr I
Transcript
Page 1: An Introduction to the Mathematics of Digital Signal Processing - Part 1

An Introduction to the Mathematics

of Digital Signal ProcessingPart L Algebra, Tiigonometry, arrd

The Most Beautiful Formula in IVlathenratics@ 1978 F. R. Moore

F. R. MooreBell Laboratories

Murray Hill, New Jersey 07974

Introduction

As it says in the front of the Conputer Music Journalnumber 4, thcre are many musicians wilh an interest inmusical signal processing with computers, but only a few havemuch competence in this area. There is of course a hugeamount of literature in the field of digital signal processilrg,includlng some first-rate textbooks (such as l{abiner andCold's Theory and Application of Digital Signal Processing,or Oppenheinr and Schafer's Digital Signal Processrrg), butmost of the literature assumes that the reader is a graduatestudent in cngineering or computer sciencc (why else rvould lrebe interested?), that hc wants to know everythittg about digitaisignal processing, and that he already knows a trcat dcal sboutmathentatics and computcrs. Consequently, nruch of thisinformation is shrouded in mathematical mystery to themusical reader, making it difficult to distinguish the wheatfrom the chaff, so to speak. Digital signal processing r a verymathematical subject, so to make past articlcs clearer andfuture articles possible, the basic mathematical ideas neededare presented in this two-part tutorial. In order to preventthis presentation from turning into several fat books, only themain ideas can be outlined; and rnathematical proofs are ofcourse omitted. But keep in mirrd that learning mathematicsis much like learning to play a piano: no amount of readingwill suffice-it is necessary to actually practice the techniquesdescribed (in this case, by doing the problenrs) before theconcepts becomc useful in the "rcal" world, flrerefore sonreproblenrs are provided (without answers) to give the motivatedreader an opportunity both to test his understanding and toacquire :, ,ine skill.

Part I of the tutorial (this part) provides a general reviewof algebra and trigonontetry, including srrch areas as equations,graphs, polynonrials, logarithnrs, contplcx nuurbers, inl'initeseries, radian mea$.rres, and lhe basic trigononre tric lirnctions.Part II will discuss the application of tlrese concepts and otlrersilt transfonns, such as thc Fourier and z.translbmrs, transferfunctions, impulse response, convotulicrrr, polcs and zeroes,and elementary filtering. Insofur as possible. thc ntathcmaricaltreatment always stops just short of using calculus, though a.deep understanding of nrany ol thc concepts presentcdrequires understanding of calculus. Ilut digilal signal prr:cessinginherently rcquires less calculus than analog signal proccssing.since the intcgral signs arc rcplaced by the easier-to-understand diserete sutnntations. lt is an experimcntal goal ofthis tutorial to see hory far into digital signal processing it ispossible to explore without calculus.

Algebra

To most people, mathcmatics rneaas lonnulas antlequations, which are expressions dcscribing the relationshipsamong quitntities. As Iong as thc relationships do not rrse thcintegration or diffcrentiation ideas of calculus. they usually,fall into the general donrain of algebra, nanred after the arabicbest-seller of the 9th cenlury, Kitab al jobr w'al-ntuqabola("Rules of Restoration and Reduction") by Abu Ju'farMohammed ibn }{fisi al-Khowlriznri (frorn whosc narnc thcword algoithnr is derived). r

Algebra is, in fact, nrercly a systernatic notation of quan-titative relationsirips anlong nurnerical, qulntities, usuallycalled variables, since with algebra u,e balr ntanipulate the

Page 38 Computer Music Journal, Box E, Mento Park, CA g4O25 Volume llNumbcr I

Page 2: An Introduction to the Mathematics of Digital Signal Processing - Part 1

relationships jn to various forms without specifying the particu-

quanrities we are manipulating' For example, the equation:

y=x+l

"says" thaty is an arbitrary name given to a quantity which is

one grcater than another quantity, x- If we were to write

y-l=x

we would be "saying" exactly the same thing, just as we wouldif rve wrote any of the following:

16Y = 16+l6x/12=k(x+l)

t(Y -Ir) = n(l -t)+txThe basic notion herc is that whatever is on the left hand sideol thc equal sign (=) is just another name for what is on theright halrd side. Of course, as the last exarnple above shows,there are sirnplc ways and conrplicated ways to say the samething, and it is usually the task olthe algebraist to find thesirnplest way of expressing a relationship so that it can beeasily understood.

Functions, Numbers, and Graphs

Stlrnetirrres it is dcsirablc to give a narne to an entirerclationship, ralher than just to the variables In a relationship.Itlathernaticians havc a keen scnse of brcvity, so thcse nanrcs

_ are usually sing.le letters as well, but they serve quite a differ-ent purpose. For example, the notation

f(x)=x+lnreans tlrat 'f is being defined as a function of x, where xis called the independent variable, since it can take on anyvalue wlratsoever. We can now write

y = f(x)(read.: "y cquals /of x ")

to me:rn that the value of y (which is called a dependenttariable since its valuc depends on the value chosen forx) isa lunction ofx, and thc function is named/. Remember that/(-r) is just another name forx * l, so the last equation above,is still saying the sanre thing as all of t,he previous examples.The advantages of the function notalion are that it a) explicit-ly states the name of thc varying quantity (the independentvariable or argntent of the lunclion), and b) it gives a shortname to what may be a conrplicated expreision, allowing itsfurther manipulation. For example:

Iet

We might now define:

a=3x+4b=-x-2

but the latter fonu doesn,t show explicitly whererelationships corne from.

What do we mean when we say that x can have art1,value? In fact, whal does value mean? Without going too iuafield into the theory of numbers, we stroukl note that inmany cases, the value of the independent variable in a parricu-lar function is restricted to the set oIalt natural nunrbers, orintegers, or reals. Briefly, the set of natural numbers (denotcdhere as N) is the set of nunrbers used for counting:

N= {0, 1,2,3...1

(the curly braces " { } " denote a set, and the ellipsis ... . .,'means here tl'rat the set has an infinite nurnber of ilernents).To indicate that the independcnt variablc rnust be chosen fronrthis set, we rvrite

/(x) = -r + I (as above), andg(x)=2x+3

a = f(x) +g(x) andb = f(r) -s(-r)

f(x)=x-l ;r€N

where "€N" means "is an element of N", the set of allnatural numbers. Suppose we choose x equal to 0; what is/(x) equal to? Our Pavlovian rcsponse is,-of coursc, nrinusone, but notc that this nurnbcr is rr(r/ it natural nuurber asdefined above.

_ So even though x might always be a natural number,/(x) ntight not be. Other sets of numbers frequently encoun-tered are I, the set ofall integer nunrbers,

I= lo,r.l.+2,13,...1

and R, the set of all real numbers. Real nutnbers are thosewhich can be written as a (possibly unending) decimalexpression, such as r,?, and l/3, since r = 3.14159. . ..2 = 2.000.. ., and l/3 = .333. . . . Somerimes R* is uscdto denote the positive reals, [t2 for thi set 6Tili ortrer&i-pairsof real numbers, etc. Just as the integcrs include alt ol'tlrenatural numbers, the reals include the integers, as well as therationals (nunrbers formed by the ratio of two integers, such as113 or 2217),and the irrationals, like zr (rvhich is approxinutelyequal to 22l7,but is not exactly equal to any ratto of twointegers). It is a fundamental mystery that the ratio of thediarneter of a circle to its circunrference should so transcendour ability to compute it exactly on any nunrber ol lingers,but that's just the way our particular uniyerse is arranged!r and e are also called trancendental numbers for such meta-physical reasons (more about e later).

So if we are perrnitted to use the integcrs, we can conl-pletely solve/(x) = x - l,x € N for all allowed values of-x.It is clear that the equation

3x=2 :r€I

has no solution, since no integer has the value 213. There isa!other type of nuntber needed to solve such eguations asxz + I = 0 , since no rcal number when multiplie<i by itselfis equal to - L Mathematieians simply tlefine the sqdare rootof minus one as i, the irnaginary unit. (Engineers use 7, sincei rvas already used to stand for current in the engineeringOf course, this "says" the sarne thing as

F- R. Moore: An lntroduction to the Mathematics of Digital Signal Processing, part I Page 39

Page 3: An Introduction to the Mathematics of Digital Signal Processing - Part 1

fiterature. In Part I of this tutorial we shall stick with i;Part ll will use ,, since sigtal processing is a branch ofengineering.) An imaginary number is any real number times i,and since the reals include the other number sets, we can haveimaginary integers, imaginary rationals, even imaginarynaturals!

The final set of numbers is just a combination of thereals with the imaginaries, which are called complex numbers.The set of all complex numbers is denoted C, and eachmember of the set has the form

x+il x,y€R

where x is cdled the "real part", and l), is called the "imagin-ary part." Complex numbers may be added, subtracted, multi-plied and divided according to the usual rules of algebra.

Ifc1 and c2 (read "c-sub-one and c-sub-2") arecomplex numbers, with c1 = x rt ilr and c2 = xz* i!2,the rules of complex arithmetic are as follows:

Rule Cl (complex addition): To add two complex numbers,add the real and imaginary parts independently, i.e.,

c1*c2 = (xr+ iy)+(xr+iy2)= (x1+-xr; +i(yr+y")

Rule C2 (complex subtraction) (sinrilar to addition):

cr-cz = (:r+ iy)-(x2+iyr1= (xr -xz) +i(yt-yz)

Rule C3 (complex multiplication): The product is formed bythe ordinary rules of dgebra:

cr c2 = (:, + r.y,) (x, + iyr) = xrxz+ iyr xz * ixtlz+ i2yrlz= (xr xz - lJ) + i (x1 y2 + yr xz)

(Remember that by definition, i2 = - l)Rule C4 (complex division): Again, ordinary algebra is used to

define the quotient:

gt = xrt iYr - xrxr+ YtYz+,i()'rxz- xrYz)c2 x2+ iy2

obtained by multiplying by

{-.'- l!.1 which is equivalent to l.xz- Uz

While a function is most gcnerally stated in algebraicform, it is often enlightening to draw graphs in order to get a

clear idea ofhow a function varies as its argument changes.

The conventional gaph uses a horizontal line to represent theindependent variable. and a vertical scale to rePresent values ofthe function. Tltus, in ordcr to find thc value of a function forsonte value of the independcnt variable, say, x = 3, we slideone finger along the horizontal axis until we point at 3, thenmove straight up (or down) to find the value /(:r = 3) (read:

"the function falx = 3").A glance at Figure I tclls us several things about the

f_unction f (x) = .5x + l. First, the graph is a straight line,ping upwards to the right; second, it crosses the vertical

qis at the value + I ; third, it crosses the horizontal axis at thevalue -2. In fact, any function which has the form

Figure 1. A graph of fG) =.5x + I

f(x)=mx+b m, , constants

is the graph of a straight line. rn is called the slope of thcfunction since it is the amount by which the function changesfor a unit change in.r. Setting m to -5, as in Figure l. lrreansthat every timex increases by one,.,f(.r) will increase by .5.hence a positive slopc is associatcd with lincs sloping upwardto the right. /(.r) will aiways cross the vertical axis whenx = 0, and since .f(x = 0) = 6, D is called the vertical axisintercept of / The horizontal axis will bc crosscd, of coursc,when /(x) equals zero, which occurs in this example at:

f(x)='"*j:9,

Actually, Figurc I is not a graph of/(x) = .5x f l, but moreprecisely a graph of this function for the values oflx between

- 4 and * 9, or in most proper notation:

f(x)--.5x+l -4<x(+9Tlre original function could extend for oll .r, that is

- o (.r ( * -, but graphing the entirety of such a functir:nwould require a very big piece of paper indeed. Graphs are use'

ful to get the genepl picture of a function, but they can serveother purposes as well. Forcxanrple, it is often uscful t<l lddgraphs directty, especially when it is dil'licult to do tltcaddition algebraically, or when the algebraic sum of twofunctions is diflicult to interpret. Graphical addition of twofunctions consists of carefully drawing both functions on thcsarne graph, and then carefully adding up lllc vertical distances

lbr all (or many) values of the independettt variablc, to obtaina graph of the sum function (see Figure 2). Such graphicaltechniques are, of course, only approxinrate, but oftcnsufficient to gain considerable insight into the shape ofcomposite functions.

Computer Music Journal, Box E, Menlo Park, CA 94025 Volume ll Number 1

twothen

Page 40

Page 4: An Introduction to the Mathematics of Digital Signal Processing - Part 1

Figure 2. Graphical addition ot f(x) =.5x + I andg(x) =.x2to ger graph of i (x) = [(x)+S(x) =x2 +.5x +l

Polynomials and Roots

A polynomial is an algebraic expression which has theforrn:

f(x)= ool ar x * azx2 * atx3 * " 'I sovn

l. try cvery value of x and see when tlre fonnula is true,2. try to factor the polynomial, or3. use the quadratic fonnula,which will give the roots for

ar.y, quadralic polynomial.

\\,e can do. Ilethod 2 nreans trying to write the polynomial intlrc fornr (x- zr) G - zr) = 0. zr and 22, are called the"zcroes" of the function, sincc if x is cqual to z1 , the firstfuclrlr, and hcnce tlrc product, will bc zcro; and sitnilarly forx = 22. Method 3 rcquircs remernbering the general solutionfor any second-degrce polynonrial (or looking it up), calledthc quadralic formula:

if the equation has the form

oxz+bx*c=0then

-6 +'fffii=___z-

The method 2 solution yields:

x2+x-6=0(-r+3)(x-21=6

x = -3 or*2

The method 3 solution, with a =l ,b = l,and c = - 5 alsoyields

- 6 + "ffrao-*x=---

_ _r tvrffiF_el2.1

_ -lt,raS -lts _= T= --=

-3ot2What about such formulas as x2 + I = 0? The quadraticformula works just as well on those:

.

a=l,b=0,c=l,so

0 !,1=4 !2ix=---T=-T=+ior-i

which says that again there are 2 roots, and that they are bothimaginary. In factorial form, we could have written

x2+t=(x*r)(x+i;=g

mathematician Galois proved that no such formulas can existfor degree 5 or more. Even the general cluartic formula is verycomplicated; it is olten easier to factor than to use it ! Andfinally, trial and error solutions are often implemented widr

Method, which work remarkably well.

Exponenls, Logarithms, and the Number e

If we say that addition and subtraction are easy, thatmultiplication and division are harder, and that taking a

number to a power is most d.ifficult, then the rules of expo-

4

3.5

3

2.5

2

1.5

hlx)=flx)+slxl

glxl = x2

,

II

f(x .5x+l

h(1) .f(11+s(t)

\-1

-t -.5-t

-1_1.5

-z

flll

1.5 2 2.5

TIre a's are constanls (nur,bers) called coeffic'11i1;-1*"1" Th, Fundamental rheorem of Algebra states rhat azyhighest power of x which occurs in any given polynomial :;(rr ) is called tlte tlegree of the polyn"*irl. Th#7ir; ;n. nth'degree polynomial always has exactly n roots' that they

Figure 2 is a first-degree polynomial, since ,h.;);;;, may in general be complcx (having both real and imaginary

powcr o[;r in .-sx + I is one. Bothg(x) rra a (..if?;;;; parts)' and that all the roots nray not be different from each

sarne figure are sccond degree, or quactraric,;i;;;;; othcr (distinct)' Also' we nright have guessed that if + i is a

lrird <regrec potynonrials are catred "urrir,

ro"uli"d'r;; :*:"::i:::"1:'::l.t:tn -i is also' since complex rools

quartic, an<J so on, though after that or. rur"ii'iir;r-;i, 1]ut" aPPear in conjugate pairs if the coefficients of the

say. "quinric potynornials" instearl of "fifth-cle!#;;;;.- l:l'nomial are real numbers ' (lf c = * + il is a complex

ials." A polynornial is "solvcd" by setting it t;';#, .j,,;"' number' thsn its conjugale' written c* ' is x - ry')

nnding *hicr, ,,rues or the independent iariabl:"TiL:j*,^ *. .,.'liT F.T::*[:'#i]i.n'"T:l,H'+i:"Jr1f,1l'oJ;"equation true' Forcxantple, to find the roots

"lih.t 1-'^t:,:*. simple and unfortunale: General formulas exist only forequation x2 + x - 6 = 0, rvc can do any of at least three things:

f,otynomials wiOr degree les than 5, and in fact the French

Ivtethod I nray sound a bit absurd, but sornctimes it is the best comPuters, using special guessing algorithms such as Ncwton's

-f-

F. R. Moore: An lntroduclion to the Mathematics of Digital Signal Processing, Part I Page 4 I

Page 5: An Introduction to the Mathematics of Digital Signal Processing - Part 1

Rule El:

Rule E2:

Rule E3:

Rule E4:

Rule E5:

Rule E6:

Rule E7:

ncnts show us how nrany problcms in mathematics may be

made one lcvel easicr! [t is important to remember whicltkintls of num bers these rulcs apply to, so in the following list,we will use p and 4 to stand for any real numbers (that is,p, q e R), a and b are positive rea.ls (a, D € R. ), and rz andn arc positive integers (ar, n € N).

AP.aQ = gP+4

ap7 = 6P-Q

@ry = aP?

nJ-;frt = om/n

Iar = vao = I (ifa#0)

Rule E8: (aile = s?6P

Using these rules, we can deduce such things as 4's = 2lRut- E+, since .5 = %), x2 lxs = .r'-3 = l/x3 (Rules E2 andFi5). and ,l-01,t7=.fJ(Rule E7).ln fact, the first 3 rules are

so uselul in doing calculations, that the entire system ofIogarithnrs has been devised to make lhem universally appli'cable to the more "difficult" problems of multiPlication,division. and exponentiation.

lf aP = x, wltcre a is not 0 or l, then p is called thelogoithu to tlrc base a o/x, written logrx = p. Thus,log28 = 3, since 2'= 8, and lo916 10000 = 4, since10000 = 104. The rules for logarithms are derived front E1,I-2 and E 3. above:

Rule Ll: logoxy = logox +lo1aY

Rule L2: log,* = logr.x -lo1oY-"yRule UJ: logoxY = 7, logox

where x,.y € R.

AIso, if logo.t = p, then x is called the antilogarithm of p tollre base a, written -r = antilogop, since by definition af = x.Any nunrber except 0 or I may be used for the base, but infact only thrce nunrbers are used very often: 10, 2, ande = 2.7 1828.. . . lngarithms to the base l0 are used becausewe commonly use a decinral (base 10) number system foreverything else! Logarithrns to the base 2 are very oftenencountercd in the relatively new Iields of computer science

and information theory, since computers typically oPerate

using binary arithnretic (internally), and both computers andinformation thcory define the unit of information as a Dir(slrort for binary digit). Loganthrns to thc base e are caUed"natural" Iogarithms, and are the most used in mathematics.

It is hard for us today to appreciate what a boonlogarithms were to rnathematicians before the advent of com'puters and pocket calculators. Logarithnrs were so useful thattwo l6th century mathematicians litcrally devoted rnost of

their lives to calculating "log tables" in order to relievc tlreircolleagues of the drudgery of multiplication and division:Briggs calculated the so-called corumon. Brigssian, or base I C

Iogarithms, and Napier the "natural", Napcrian, base e log-arithrns. Ilase 2 logarithms are not found in mathematicalhandbooks, and they probably never will bc, since thcircomputation today is largely a tnatter of button-pushing.Also, if the log of a number is available in any one base, it is

easy to change it to another base using tlre following relation-ships:

logox = K logrx

whereu_lJ\-w

K is given in the fotlowing table for base changes anrong 10,2, and e:

e

t0 0.30103. 0.43429.2 3.32193. 1.44270.e 2.302s9. 0.6e315. I

Thus

lo916.r = .30l03log2x = .43429 lnx

and so on, where ln stands for "natural logarithm" (i.e.,ln x = log"x). Logarithms are defined only for positivenumbers.

Where does the number e come from? Unfortunately,its true origins arc buried deep within calculus, which is not a

part ofour subject nratter, but some ofits properlies, as we

shall see, turn out to be remarkable. e is an irrational numberlike zr, which means that its decimal expansion is both infiniteand that it never repeats itself:

e = 2.71828 18284 59045 23536 0287...

If you would like to calculate it to more accuracy than this,the following formula may be used:

e=l

where n! means n factorial, which is the product of all theintegers from one ton (3! =6,41 =24.51 = l20,etc.).

A more uscful form of this infinitc expression yields thcvalue of e raised to any powcrr:

e* = I + fr -#*#* #-"'Another way to write the sarne thing is u'ith sunr notalion:

:vne* = l+.1-, i;!-l=l

which "says" cxactly the samc thing. Thc capital signra ( I ) is

btravbit =

t0

,{

lrtt' l! 2t' 3! ' 4l

Page 42 Computer Music Journal, Box E, Menlo Parll, CA 94025 Volume ll Number 1

Page 6: An Introduction to the Mathematics of Digital Signal Processing - Part 1

used to denote that rve should add up all values of x"fn!starting with n= l, then n = 2,etc. (lt is read: "the sum overnfrom one to infinity of x to the rr divided by z factorial".)

Sunrs and Series

Such formulas as the one above for e' are called inliniteseries, or inl'inite scquences, since there are infinitely manyternrs in the sunr, even though rve know what any one of themwould be. Such sunrs need not be infinite, of course. Forcxample, tlre lollowing fornrula illustrates a finite sum:

l+2+3+.-.+n =

which is just the surn of tlrc frrst n integers. It is both interest-ing and useful t.lrat nrany such sums haye a general, or "closed-form" formula, making it unnecessary to carry out the lengthyaddition se(luence. For exarnple:

their beautil'ul princess wasconveyed all of their secrets

known only to initiates,at once. The nanre of

princess was Solrcahtoa.l -l

If we label a right triangle (one which contains aright angle) with respect to an angle e (see Figure 3), sideO is opposite llre angle, side A is adjacent to angle e, andside H is, of course, the hypotenusc of the triangle.

Figure 3. A right triangleO, A, and I{

with inscribed angle e and sides

n

f,riL= I o

t

Thc closcd fornr isclearly ntore useful if n is greater than 3 or4 or so. Other sunr fornrulas often crop up in digital signalpr<lcessin g. For cxantple

= o+or+arz+"'

This sunr cxists onl;z if r ( l, since otherwise the sum will be

infinite. a is the first ternl in thc sequence, and r is called theratio, since it is multiplied by any term to get the next term inthc scquence. Thus, wc sce that

nsaLk = l+2+3+...+nk=l

n(n + ll2

E

= I2-h =)-.= 2a-t - I _11. k=O t /1

ot.l

AEor

o| -r

Thc 3 basicfollows:

sine of e

cosine of a

trigononrctric functions are defined as

= stne =

= cose =

If there is not an infinite number of ternls, we can removethe restriction that r be less than l:

tt--l')--'r, o - a(-l - rl) r* |/-t ur -- - I _ r

k=O ' '

lf r * l. and tltc last ternr I = arn -! , then this sum is alsocqual to

a-rll-r

Trigonometry

IIt lras bccn said that a tribe called the Trigonometriclndjans once roarttcd thc carth, that they spoke in sine

languagc, and ttcver uscd rvrong anglcs. TIte secret name of

tangent ofe = tan e =

Clearly, the size of the right triangle doesn't matter, since, fora given angle e, if we double the length of one of the sides, theothers will double as well. Only the rotios of their lcngths arenecded to define the trigonontetric functions.

The 3 remaining trigonometric functions are definedin terms of the first 3:

cosecantofa =csce =# =8

secantofe =sece=*=*

cotangent ofe = cot e =

Radians, Degrees, and Grads

As almost everyone knows, if you slice a pie into 360equal wedges, you lrave not only very srnall slices to cat. butthe angle at the tip of eaclr slice will be one degree (1"). Ifyou are very hungry, however, and slice the pie into 4 equalpieces, the angle at the tip of each slice rvill be 90", which isexactly right.

Another measure is to divide the circular pie into 400egual pieccs, or 400 grads. But by far the most common .

measure of angles used in mathematics is thb radlan. Sincethe ratio o[ the circumference of a circle to its diameter isr= 3. 14159 26535 .. ., and since the radius df a circle

l+

L oruk=0

lll-+-248

IAtan7 = 6-

F. R. Moore: An lntroduction 1o the Mathematics of Digital Signal Processing. Part I Page 43

Page 7: An Introduction to the Mathematics of Digital Signal Processing - Part 1

is exactly one half its dianretcr, the circumference of a

circle is cxactly 2zr times the length of its radius, and we saythere arc 2zr radians in a circle. A right angle is then any of90o, IOO grads, or r12 radians,depending on which ,neorur"we are using.

If we choose a circle with radius equal to one unil,and we inscribe our right triangles inside the circie (seeFigure 4),

Figure 4. A unit circle with inscribed right triangles

we can "solve" the triangles conveniently with thefuthaeorean tlteorenr: O2 + A2 = H2, or O2 + A2 = I,Ci= .ffT , and A = ,GOz . Angtes are convenrionallymeasured counter-clockwise from the right hand horizontalaxis (see 41 , and e2 in the figure)- Angles nreasured in a

clockwise direction arc considered negative.We can trcat the anglc e as an indcpendent variable and

graph thc basic functions as shown in Figure 5.Tlrc invcrse trigonometric functions arc dcfined in a

sirnilar way to the antilogarithm: if sin e =x, then the arcsineof x = sin'l x = e, and so on, for each of the six trigonomctric[unctions.

We can sce from the graph of sin e that the function ispcriodic, that is, it rcpeats itself over anC over again as e gctslargcr or smaller by 2tr, which is cailed the peiod of sin a.Furllrenrtore, sin e always has a value between + I and - I

inclusivc, so wc say that the donrain of thc sine function is thcset o[all rcal nunrbers between + I and - l, orin more mathc-matical form:

sine€R, -l(sine(+lBecause of this restricted donrain, it is nreaninglcss to writcsin-r 2 = e, since no angle e has a sinc equal to 2. But whatabout sin-r I = e? Fronr the graph, it is clear that sin rf2= l,so, e = tl2 is one solution to this cquation. But sin 5r/2

is also equal to one,.as is sin - 3t 12.ln fact sin-l I = e hasinfinitely many solutions, all of the form e = t12 + k2n,

rvhere & is any integer. The pinciple values of the inversetrigononletric functions are chosen to be close to e = 0,and these arc used to rcsolve the problem of which answer Ichoose. Thus:

sin-'x ( f ,

cos-tx < 7r , ild

-5 * ran-tx

Inspection of Figure 5 also shows that the sine andcosine functions are also idcntical to each other, except [ortheir starting place at e = 0,i.e., they differ only in phase

-f*0<

<+

1 a) = cose , and

cos(e-f) = sine

21 5tr7Figure 5. Graphs of sin e, cose, and tan e asfunctions ofe, e in radians.

' Trigonometric Identities

Marty lonnulas nlay be dcrivcd from the basic defini-tions of the trigonometric functions which arc oftcn usefirl inthe manipulation of equations involving trigonornetricfunctions. They are called idcntitics sincc, like all equations,tlre expressions on cithcr sidc of the equal sign "say" e,\actlythe samc thing, but in a uscful way. ln llre following idcntitics,A and B are dny angles:

sin $

3nh4aT

7l s?r

TOtr

z

srn e

Page 44 Computer Music Journal, Box E, Menlo Parl<, CA 94025 Volume ll Number I

Page 8: An Introduction to the Mathematics of Digital Signal Processing - Part 1

(Tl): sin 2A = 2 sin A cos A(T2): cos 2A = cos2 A - sin 2 A

(T3): sin2 A = th - tA cos2A(Ta): cos2 A = t7+ tA cos 2A

(T5): sin A+sin B = 2sinYz(A+ B)cos'u!(A - B)

(T6); sin A -sin B = 2cos%(A+ l3)sin %(A-B)(T7): cos A *cos B = 2 cos /:(A + B) cos %(A - B)

(78): cos A -ct:s B = 2sin%(A+B)sin 7!(B -A)(T9): sin A sin li = )/r [cos (A - B) - cos (A + B)]

(TI0): cos Acos B = % [cos (A - B) +cos (A + B)]

(Tl l): sin A cos B = )/: [sin (A - B) + sin (A + B)](Tl2): sin (A t B) = sin A cos B t cos A sin B

(Tl3): cos (A t B) = cos A cos B T sin A sin B

These idcntitics arc lairly casy to dcrivc fronr each other, and,of coursc, nrany rrrorc cxist.

Like e', tlre sinc and cosinc functions nray bc rcpresent.ed as sunurration scries:

si,x=-'-#.*-+ +...

cosx=t-t *4-4*-..21 4! 6!

wlrerc x is an angle nreasurcd in ractians.

Using Trigonometric Functions to RepresentIvlusical Sounds

Onc of thc grcat pleasurcs of rnalltctnatics is lhat it canbc uscd to undcrsl,and portions r:f the "rcal world." If sorncphcnonrcnorr naturally bchavcs in a way which can bc

descri[:ed nrathcnratically, rnathcrnatics provides a wcalth ofintcllectual "tools" rvhich allow that pltcnontcnon to beanulyz.cd (i.c., undcrstootl), pcrhaps nrodificd in a prcdictablcand tlcsirublc way, and llossibly synthcsized (crcatcd in a nervand llexible way). Such phcrronrena are lhc sounds of rnusicand specch.

Sourtds arc vibrations in thc air to rvhich our cars are

scnsitive. Acoustical studies huvc shown that tlre quality ofa sound as u'e perccive it is related to ccrtain cltaractcristicsof the "slupe" of lhc vibrations, i.e., we draw a graplr of theair prcssurc lluctuations as a liutction oI tinrc and observc itsgraplrical slrapc. Il'thc wavcshapc is fairly rcgular and rcpcti-livc (i.c., rcughly pcriodic) it will sound likc a totrc with a

stcady pitch, such as a violin notc or a fog horn. lf the rvave-Iorrn is irrci;ular and apcriodic, thc sound rvill lravc littlc <lrno pitch, but instc:ld sourrrJ likc a noisc such as stcanr rushilrgor a cyrnbal crash. ln spcech, periodic wavelbrnrs arc associat-ed with voiced sounds, srrch as vowcls and voiced corrsonanls.Apcriodic waveftrntrs ire associatcd rvilh unvoiced consonants,suclt as s and f. Thc pcriod of a pcriodic rvavclbrnr is closclyrclatcd to rvhat pitch it rvill havc. I'eriod and frcquency aretwo nanlcs for trvo ways of dcscribing thc sarrre tlring: howofrctr cJocs thc wavcltrrrr: rcgularly rcpcal itscll. lf lhcfrcrltrcncy of rcpctition is bctwccn ubout 20 to 20, 000 timcspcr secortrl. llrcrr tlrc vibr:rtiorr rvill bc lrcartl as a sorrnd. Irr

othcr words, pilchcd sounds have pcriocls ranging frorrr a!l/20 to l/20, 000 of a second. TIrc rrnpliturle, oi strengtli'!thc vibration is a rueasurc of how for rlrc prcssurc deviatcfrorrr the atnrosplrcric rrrcan. Orre could nrcasure ttre pcakdeviation flronr tlre rndan, or possibly thc average deviation,but tlre rvord anrplitude gerrerally, refcrs to tlte pcak deviation.runlcss statcd t:thcrrvisc. and is rclatcd to our percelltion of tlreloudness o[ u sound. Finally, thc gcneral shape of thcrvavefornr determirrcs its tone quality, or linlbre. All of thesefactors inleract pcrccptually. For instancc, thc pitch can beaffccted b), thc aruplitude and tlre slrape uswcll as tttc periodof a wavelbrnr. llence it is inrportalrt to distinguish bet*,cenfrequency, rvlrich is a nlcasure of the repctition rate of aperiodic rvavcfonn, and pitch, whiclr is our perceprion ofsonrething Iike the "tonal hcig,ht" of a sound.

Au irnportant rrrathclrratical tool which will be describedirr Part II of this tutorial is Fourier's tlteorent, which slareslhat any periodic waveforur can be described as the sum ofa nunrbcr, possibly an infinitc nurrrbcr, ot'sinusoitlal variations,eaclr witlr a particular fre<1uency, lrrrplitudc, and phase.Futhenrrore, tlrerc is a nrethod for dctermining cxactl!, whatthese frecluencics, anrplitudcs, :rnd phascs tntrst be in rrrder torc-construct thc wavcfornr by addirrg togctlrcr sine rvavcs,which arc seen to be the basic "brriltling blocks" of periodic' rvaveftrntrs. Actually thcrc arc a fcw jhcr rc,<;uircrircnts aswcll as pcriodicity; sul'llcc it to be suid that aiy wavcfrxnwhich could cxist in the physical world will obcy thcsc otherconditions (callcrl the Dirichlct conditions).

Stated nrathenratically, the wavefornr must obcy thecondition /(r) = f (t + 7"), rvhcre / is r[e perigdic waveform,I is tiure, and 7'is the peri<lcl o[ the waveform. Then

f(t) = i nnsin(,ror+ca)

rvlrcre:lo is tlrc arnplitude of the kth sinusoidal conrponcnt of

f(t).o) is tlrc funclottrental frequencl, ( = I lT) of rhe wavcform

tinres 22, and

Qp is thc phase of the &th sinusoidal conlponcnt of IG).

Another way which is nrore conrrnonly uscd of statingthc sanre thing is

'6

f (t) = D kucos,tc,.rr + Do sin &c^:r)k=0

rvhcrc both the arrrplitudcs und ;:lrases o[ the prcvious c.\prcs-sion ilre irubcddeci in lhe a's and D's of tlre secorrd expression.To scc tlrat tlds is so. wc can usc trigononretric identity Tl2(rvc ontit thc subscripts for thc nrorucrrt):

.4 sin (lf<^lt * 0) : .4 (sirr lk^rt cos O + cos ,tor sin @)A sin Q cos kor, +l cos Q sin ktot

= a cos kat + b sin kc,stwherc

a =Asin$ and b =Acose

Sinrilarly. wc can show frorn lhcsc cxprcssionl for a and btlr:lt:

F. R. Moore: An lntroduction to rhe Mathematics of Digital Signal Processing, Part I Page 45

Page 9: An Introduction to the Mathematics of Digital Signal Processing - Part 1

a2 +62 (.4 sin d)2 + (l cos @)'

Az sin2 O + A2 cos2 I (by Rule E8)

A2 (sin2 O + cos' C)

simple. It tells us of a relationship among all of the knownfundamental constants of mathematics in a way that mathe.maticians, and perhaps by now the reader, can only considerbeautiful.lt is easy to see from Figure 5 that the followingrelationships are true:

cosTr = -lsinr=0

If we substitute n for x in Eulcr's relationship, we are unerring'ly led to what has been rightly called "the most beautifulformula in mathematics:"

= A2 (sincesin2 O+cos' O=lbyfuthagorean theorent)

t=JffiTTherefore,

AIso,

Therefore

i = m= tano

O = tan-t 9u

(by thc basic defini-tion of sin, cos, andtan)

What we have done is not only to show that the two fonnulasfor f (t) above are the same, but also how to derive one formfrom thc other.

The Most Beautiful Formula in Mathematics

In thc lgth century, the Gerntan mathenratician Eulerproved the follorving remarkable identity:

eto = cosx+isinx

thercby relating algebraic exponentials to the trigonometricfunctions. This key formula is the basis for much of thenrathematics used in signal processing, for it allows some verypor+'crful manipulations to be made using sinusoidal functionsthat would otherwise prove very tedious. For exantple, byusing rules E3 and E8 regarding exponents, it is casy to see

that

(rei"1c = TPsipe (De Moivre's theorem)

By using Euler's relation we can see that this innocent-lookingequation "says" the same thing as

[r (cose+ i sin e)]P = 7P (sos pe+ i sin pa)

This form of De Moivre's theorent may be uscd to demonstratemany of thc trigonometric identities in a very economical way.For exarnple, if we let r -- I and p = 2,

cos2e +isin2e = (cos6r +f sine)2= cos2e -sin2e +i2 sine cose

Since two cornplex numbers are equal if an only if both theirreal parts are equal and their imaginary Parts are equal, thissimple procedure has just shorvn that

cos 2e = cos2g - sin2e andsin2e = 2sinecose

Tlris dcmonstrates the validity of both identity Tl ondidcntity T2. ln other words, by using the complex exponentialin Euler's relation, we can, in effect, solve two cquations atonce !

But Euler's relationship tells us sontetlting else,

something which is at the same time profound, elegant, and

Therefore:

€:io= cosa+f sinz- -l +0

efr+l =0

Conclusion of Part I

Mathematir-'ians crcate mathematics, the rest of usmerely use, and sometilncs appreciate, what the mathema-ticians have created. Computers have at the same time reducedthe need for human calculation and increased many fold theutility of human mathematics, especially to non-mathemati-cians who can now apply these powerful toots to the study ofvirtually anything. We now have to discover the models whichstate tJre correspondence between phenomena and mathe-matics. Once rl,e koow that a vibration is periodic, forinstance, wc know that we can use Fourier's techniques tofind the elemental building blocks of thc vibration. We atsoknow that if we add up the same building blocks ourselvesthat we can reprorluce the phenomenon at will. Or perhaps wemight improve on the original a bit, once we're sure that theoriginal is understood corectly.

Thus we can make machines that talk and sing, we canstudy tle waves in the ocean, and the vibrations in an earth-quake. Fourier himself was studying the transfer of heat at thetime hc devised his theorem about the way waves are shaped,which is all the more remarkable because il doesn'l matter!Mathematics deals with the relationships, not with thc thingsper se, and if a theorem correctly states that "A" has relation"R" to "8", and we note that the height of a mountain couldbe thought of as thing "A", then we know that something else

will correspond to "8", and "R" will tcll us where to look forit.

For the reader interested in using mathematics, a goodmathenratical handbook is heartily recommended, such as theexcellent and inexpensive Mathematical Hondbook ofFotmulas and Tables by Murray R. Spiegel, available as a

Schaum Outline Serics paperback (McGraw-Hill). For thereader intercstcd .in understanding mathematics in greaterdetail, it is recommended that this be treated in the same wayas a desire to learn to play a piano: a good teacher and regularpractice will suffice in a way that nothing elsc can. Readingbooks helps,* and there are certainly plenty of books to read

on mathematics at evcry conceivable level, but not muchmore than it helps to read a book about playing a piano.

* An excellent book to read is The Foundations of Mathemat'

rbs by Stewart and Tall (Oxford University Press).

Page 46 Computer Music Journal, Box E, Menlo Park, CA 94O25 Volume ll Numtrer 1

Page 10: An Introduction to the Mathematics of Digital Signal Processing - Part 1

Some Problems

l. Solve these equations for x:

2. The sequence (i, i2 , i3 , i4 , is , . . .) is peiodic, since it

3. Find the sum of all the integers between 100 and 100d,inclusive.

4. Rewrite the following scquences using summation notation(E) and find their solutions;

a) I,000,000 + I00,000 + 10,000 +... (infinitety manytcrms)

b) I00 + 200 + 400 + 800 +. -. to t0 ternsc) 106+ 2.5 x IOs+ 6.25 X 104+... ton lerms

5. If we graph a complex numbcr c = )i1 * iy 1 on a plane, wccsn use x1 andyl for thc horizontal and vertical coordin-

ates of a point on that plane

If we draw a straight line frorn the origin (point (0, 0) ) topoint (x1,71 ), we- could also use the length r urd an$e eof that line to define the locations of thi point (rr,-yr).Find r and e in terms ofx, and y, -(Hint: Pythagoras' theoren, ,rir_", that the square of thelcngth-of the hypore-nuse of a ii-gtit triange il'eqrral to iLsurn of the sguares of the other sitles).

6. Show that sin2a + cos2e = l.

7. Show that eto = cos e + f sin e(Hint: Usc the summation formula, also callcd the powerseries expansion, for ex').

a) x2 - I = 0b)xa-l=gc) Iogls-r = .43429. . .

d) antilogl 5=xe)2x=20D nx'+Dx+c-0

(Two solutions)(Four solutions)(Hint: logoa = l)

(l{inr:20 = 10.2)

(x r, ! rl

4t+J:'u

.rr -)--t.- aF,c

,rrr;,r..22 *1-

j'r 1? il-ej.f-'.o ! dra?

;'?z!.t!- i,:[:

Lr- %DeVS E..s? oiltne qtrcil csl

.?L e6 eo prrcedutt( omnii*ila'utrt.i{,v,. tn aum rdp"lutrlrtr:

?at'ri'-4.

E\

-: ."jjir5i,,:-^,, )i?i

: : :::: -__ l_=:::::-_*=-S=*+lfj_iifffil+ h j :qJ ".q

;i, ^ ,t.i.+

nr,o

ot J''':nt1- /d,tr,.,,,,,,"t'

"--{ ''q"

or-, r-+'

-" "j: 1r' ; Ef'

^::,^^,..,'..,,",'.],n.o..t.,li",.:t.-:)""M+b", "v,i, ,rie ...,iri64t.tL. "1'' ., or}.$'

'.'4 -r..

,,,:,, ...

-t,'

{.

qMonochord illustrating universal relationships (from Robert Fludd's ilotochordtm mundi, Frankfort, 1622.1

F. R. Moore: An lntroduction to the Marhematics of Digiral signal processing, part I pagelz

'-'! :'1' T"ii {=}- r'i "ri I


Recommended