Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
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.
Page 38
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-tounderstand 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 quantitative relationsirips anlong nurnerical, qulntities, usually called variables, since with algebra u,e balr ntanipulate the
relationships jn to various forms without specifying the particuquanrities 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
b=-x-2
but the latter fonu doesn,t show explicitly where
relationships corne from. What do we mean when we say that x can have art1, value? In fact, whal does value mean? Without going too iu afield into the theory of numbers, we stroukl note that in many cases, the value of the independent variable in a parricular function is restricted to the set oIalt natural nunrbers, or integers, or reals. Briefly, the set of natural numbers (denotcd here as N) is the set of nunrbers used for counting:
a=3x+4
y-l=x
if
we would be "saying" exactly the same thing, just as we would rve wrote any of the following:
N= {0, 1,2,3...1
To indicate that the independcnt variablc rnust be chosen fronr this set, we rvrite (the curly braces " } " denote a set, and the ellipsis ... . .,' means here tl'rat the set has an infinite nurnber of ilernents).
f(x)=x-l
where
;rN
of N", the set of all
"N"
natural numbers. Suppose we choose x equal to 0; what is /(x) equal to? Our Pavlovian rcsponse is,-of coursc, nrinus one, but notc that this nurnbcr is rr(r/ it natural nuurber as
defined above.
_ /(x)
So even though x might always be a natural number, ntight not be. Other sets of numbers frequently encoun-
tered are
I,
the set
I=
lo,r.l.+2,13,...1
f(x)=x+l
nreans tlrat
'f
x,
where
it
(read.:
"y
expression, such as r,?, and l/3, since r = 3.14159. . .. 2 = 2.000.. ., and l/3 = .333. . . . Somerimes R* is uscd to denote the positive reals, [t2 for thi set 6Tili ortrer&i-pairs of real numbers, etc. Just as the integcrs include alt ol'tlre natural numbers, the reals include the integers, as well as the rationals (nunrbers formed by the ratio of two integers, such as 113 or 2217),and the irrationals, like zr (rvhich is approxinutely equal to 22l7,but is not exactly equal to any ratto of two integers). It is a fundamental mystery that the ratio of the diarneter of a circle to its circunrference should so transcend our 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 metaphysical reasons (more about e later). So if we are perrnitted to use the integcrs, we can conlpletely solve/(x) = x - l,x N for all allowed values of-x. It is clear that the equation
and R, the set of all real numbers. Real nutnbers are those
to me:rn that the value of y (which is called a dependent tariable since its valuc depends on the value chosen forx) is a 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) explicitly states the name of thc varying quantity (the independent variable or argntent of the lunclion), and b) it gives a short name to what may be a conrplicated expreision, allowing its further manipulation. For example:
Iet
We might now define:
/(x) = -r + I g(x)=2x+3
a = f(x) +g(x) b = f(r) -s(-r)
3x=2
has
:rI
is
and
a!other type of nuntber needed to solve such eguations as xz + I = 0 , since no rcal number when multiplie<i by itself
is equal to
rvas
I
L Mathematieians simply tlefine the sqdare root as i, the irnaginary unit. (Engineers use 7, since already used to stand for current in the engineering
Page 39
we shall stick with i; since sigtal processing is a branch of engineering.) An imaginary number is any real number times i, and since the reals include the other number sets, we can have imaginary integers, imaginary rationals, even imaginary naturals! The final set of numbers is just a combination of the reals with the imaginaries, which are called complex numbers. The set of all complex numbers is denoted C, and each member of the set has the form
fiterature. In Part
Part
ll
will
I of this tutorial
use
,,
x+il
where
x,yR
x is cdled the "real part", and l), is called the "imaginary part." Complex numbers may be added, subtracted, multiplied and divided according to the usual rules of algebra. Ifc1 and c2 (read "c-sub-one and c-sub-2") are two complex numbers, with c1 = x rt ilr and c2 = xz* i!2, then the rules of complex arithmetic are as follows:
Rule
Cl
fG) =.5x + I
c1*c2 = (xr+
cr-cz
f(x)=mx+b
m,
constants
is the graph of a straight line. rn is called the slope of thc function since it is the amount by which the function changes for a unit change in.r. Setting m to -5, as in Figure l. lrreans
that every timex increases by one,.,f(.r) will increase by .5. hence a positive slopc is associatcd with lincs sloping upward to the right. /(.r) will aiways cross the vertical axis when x = 0, and since .f(x = 0) = 6, D is called the vertical axis intercept of / The horizontal axis will bc crosscd, of coursc, when /(x) equals zero, which occurs in this example at:
(:,
+ r.y,)
(x, + iyr) = xrxz+ iyr xz * ixtlz+ i2yrlz = (xr xz - lJ) + i (x1 y2 + yr xz)
- l)
f(x)='"*j:9,
Actually, Figurc I is not a graph of/(x) = .5x f l, but more precisely a graph of this function for the values oflx between - 4 and * 9, or in most proper notation:
obtained by multiplying by
which is equivalent to
l.
f(x)--.5x+l
-4<x(+9
"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,
sonte value of the independcnt variable, say, x = 3, we slide one finger along the horizontal axis until we point at 3, then move straight up (or down) to find the value /(:r = 3) (read:
While a function is most gcnerally stated in algebraic form, 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 the independent variable. and a vertical scale to rePresent values of the function. Tltus, in ordcr to find thc value of a function for
ping upwards to the right; second, it crosses the vertical at the value + I ; third, it crosses the horizontal axis at the value -2. In fact, any function which has the form
qis
Tlre original function could extend for oll .r, that is - o (.r ( * -, but graphing the entirety of such a functir:n would require a very big piece of paper indeed. Graphs are use' ful to get the genepl picture of a function, but they can serve other purposes as well. Forcxanrple, it is often uscful t<l ldd graphs directty, especially when it is dil'licult to do tltc addition algebraically, or when the algebraic sum of two functions is diflicult to interpret. Graphical addition of two functions consists of carefully drawing both functions on thc sarne graph, and then carefully adding up lllc vertical distances lbr all (or many) values of the independettt variablc, to obtain a graph of the sum function (see Figure 2). Such graphical techniques are, of course, only approxinrate, but oftcn sufficient to gain considerable insight into the shape of
composite functions.
Page
40
ll
Number
if the equation
hlx)=flx)+slxl
4 ,
then
oxz+bx*c=0
3.5
3
glxl
-6 +'fffi i=___z-
= x2
2.5
2
f(x
h(1)
.5x+l
1.5
-f-
.f(11+s(t)
yields
(-r+3)(x-21=6 x = -3 or*2
The method 3 solution, with a =l ,b
x2+x-6=0
= l,and c = - 5 also
\-1
flll
1.5 2
2.5
x=--- 6 + "ffrao-*
-t -.5
-t
_ _r tvrffiF_el
2.1
-1
_1.5
-z
Figure
_ -lt,raS =
T=
What about such formulas
=.x2
to ger
2. Graphical addition ot f(x) =.5x + I andg(x) graph of i (x) = [(x)+S(x) =x2 +.5x +l
-lts
as
well on those:
Polynomials and Roots A polynomial is an algebraic expression which has the forrn:
f(x)=
ool
ar
x * azx2 * atx3 *
" 'I
sovn
x2+t=(x*r)(x+i;=g
Th, Fundamental rheorem states polynomial nth'degree polynomial always of Algebra n roots'rhat azy :; has exactly that they ;n. may in general be complcx (having both real and imaginary ,h.;);;;, parts)' and that all the roots nray not be different from each (..if?;;;; othcr (distinct)' Also' we nright have guessed that if + i is quactraric,;i;;;;; also' rools ro"uli"d'r;; :*:"::i:::"1:'::l.t:tn -i is if thesince complexof the aPPear in conjugate pairs coefficients rur"ii'iir;r-;i, 1]ut" are real numbers ' (lf c = * + il is a complex .j,,;"' say. "quinric potynornials" instearl of "fifth-cle!#;;;;.l:l'nomial its conjugale' written c* is x ry') number' thsn ' ials." A polynornial is "solvcd" by setting it t;';#, iariabl:"TiL:j*,^ *. .,.'liT F.T::*[:'#i]i.n'"T:l,H'+i:"Jr1f,1l'oJ;" nnding *hicr, ,,rues or the independent equation true' Forcxantple, to find the roots
a
TIre a's are constanls (nur,bers) called coeffic'11i1;-1*"1" highest power of x which occurs in any given (rr ) is called tlte tlegree of the polyn"*irl. Th#7ir; Figure 2 is a first-degree polynomial, since powcr o[;r in .-sx + I is one. Bothg(x) rra a sarne figure are sccond degree, or lrird <regrec potynonrials are catred quartic, an<J so on, though after that "urrir, or.
equation x2 + x
l. try cvery value of x and see when tlre fonnula is true, 2. try to factor the polynomial, or 3. use the quadratic fonnula,which will give the roots for
ar.y, quadralic polynomial. Ivtethod I nray sound a bit absurd, but sornctimes it is the best \\,e can do. Ilethod 2 nreans trying to write the polynomial in tlrc fornr (x- zr) G - zr) = 0. zr and 22, are called the "zcroes" of the function, sincc if x is cqual to z1 , the first fuclrlr, and hcnce tlrc product, will bc zcro; and sitnilarly for x = 22. Method 3 rcquircs remernbering the general solution for any second-degrce polynonrial (or looking it up), called thc quadralic formula:
1-'^t:,:*. things:
simple and unfortunale: General formulas exist only for f,otynomials wiOr degree les than 5, and in fact the French
mathematician Galois proved that no such formulas can exist for degree 5 or more. Even the general cluartic formula is very complicated; it is olten easier to factor than to use it ! And finally, trial and error solutions are often implemented widr comPuters, using special guessing algorithms such as Ncwton's Method, which work remarkably well. Exponenls, Logarithms, and the Number
e
If we say that addition and subtraction are easy, that multiplication and division are harder, and that taking a
number to a power is most d.ifficult, then the rules of expoI
Page 4 I
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 and n arc positive integers (ar, n N).
ncnts show us how nrany problcms in mathematics may be made one lcvel easicr! [t is important to remember whiclt kintls of num bers these rulcs apply to, so in the following list,
colleagues
their lives to calculating "log tables" in order to relievc tlreir of the drudgery of multiplication and division:
or base I C
Rule
El:
AP.aQ =
gP+4
Rule E2: Rule E3: Rule E4: Rule E5: Rule E6: Rule E7:
ap
Iogarithms, and Napier the "natural", Napcrian, base e logarithrns. Ilase 2 logarithms are not found in mathematical handbooks, and they probably never will bc, since thcir computation 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 relationships:
= 6P-Q
aP?
@ry =
nJ-;frt
logox = K logrx
where
om/n
ar = vI
ao = I (ifa#0)
u_l J\-w
base changes anrong 10,
it
tra
vb
t0
s?6P
e
Rule
E8:
(aile =
t0
Using these rules, we can deduce such things as 4's = 2 lRut- E+, since .5 = %), x2 lxs = .r'-3 = l/x3 (Rules E2 and Fi5). and ,l-01,t7=.fJ(Rule E7).ln fact, the first 3 rules are so uselul in doing calculations, that the entire system of Iogarithnrs has been devised to make lhem universally appli'
0.30103.
,{
Thus
2 e
3.32193.
2.302s9. 0.6e315.
0.43429. 1.44270.
I
cable
lo916.r
l, then p is called the logoithu to tlrc base a o/x, written logrx = p. Thus, log28 = 3, since 2'= 8, and lo916 10000 = 4, since
10000 = 104. The rules for logarithms are derived front E1, I-2 and E 3. above:
and so on, where ln stands for "natural logarithm" (i.e., x = log"x). Logarithms are defined only for positive
Rule
logoxy
logox +lo1aY
Rule Rule
where
logr.x -lo1oY
7,
numbers. 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 number like zr, which means that its decimal expansion is both infinite and that it never repeats itself:
logox
e =
x,.y R.
is called the antilogarithm of p to llre base a, written -r = antilogop, since by definition af = x. Any nunrber except 0 or I may be used for the base, but in fact only thrce nunrbers are used very often: 10, 2, and e = 2.7 1828.. . . lngarithms to the base l0 are used because we commonly use a decinral (base 10) number system for everything else! Logarithrns to the base 2 are very often
e=l
4l
encountercd in the relatively new Iields of computer science and information theory, since computers typically oPerate using binary arithnretic (internally), and both computers and information 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 boon logarithms were to rnathematicians before the advent of com' puters and pocket calculators. Logarithnrs were so useful that two l6th century mathematicians litcrally devoted rnost of
Page
where n! means n factorial, which is the product of all the integers from one ton (3! =6,41 =24.51 = l20,etc.). A more uscful form of this infinitc expression yields thc value of e raised to any powcrr:
e* = I
fr -#*#*
#-"'
I
)
1
42
ll
Number
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 overn from one to infinity of x to the rr divided by z factorial".)
Sunrs and Series
their beautil'ul princess was known only to initiates, conveyed all of their secrets at once. The nanre of
princess was
Solrcahtoa.l
-l
Such formulas as the one above for e' are called inlinite series, or inl'inite scquences, since there are infinitely many ternrs in the sunr, even though rve know what any one of them would be. Such sunrs need not be infinite, of course. For cxample, tlre lollowing fornrula illustrates a finite sum:
If we label a right triangle (one which contains a right angle) with respect to an angle e (see Figure 3), side O is opposite llre angle, side A is adjacent to angle e, and
side H is, of course, the hypotenusc
of the triangle.
l+2+3+.-.+n
iL= I
f,r
which is just the surn of tlrc frrst n integers. It is both interesting and useful t.lrat nrany such sums haye a general, or "closedform" formula, making it unnecessary to carry out the lengthy addition se(luence. For exarnple: sa
n
t
Figure
k=l
Lk = l+2+3+...+n
n(n + ll
2
angle
O, A, and
and sides
Thc closcd fornr isclearly ntore useful if n is greater than 3 or 4 or so. Other sunr fornrulas often crop up in digital signal
pr<lcessin
as
g. For cxantple
e
a
= stne = o t.l
L oru k=0
= o+or+arz+"'
-r
cosine of tangent
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 the ratio, since it is multiplied by any term to get the next term in thc scquence. Thus, wc sce that
lll l+ -+248
/1
Clearly, the size of the right triangle doesn't matter, since, for a given angle e, if we double the length of one of the sides, the others will double as well. Only the rotios of their lcngths are necded to define the trigonontetric functions. The 3 remaining trigonometric functions are defined in terms of the first 3:
cosecantofa If there is not an infinite number of ternls, we can remove the restriction that r be less than l:
tt--l ')--'r,
-/-t ur o -
=csce =#
=8
IA
secantofe =sece=*=*
cotangent
k=O
cqual to
a(-l
'
- rl) I _ r
'
r*
ofe
= cot e
tan7 = 6-
a-rl l-r
Trigonometry
As almost everyone knows, if you slice a pie into 360 equal wedges, you lrave not only very srnall slices to cat. but the angle at the tip of eaclr slice will be one degree (1"). If you are very hungry, however, and slice the pie into 4 equal pieces, the angle at the tip of each slice rvill be 90", which is
IIt lras bccn said that a tribe called the Trigonometric lndjans once roarttcd thc carth, that they spoke in sine
languagc, and ttcver uscd rvrong anglcs. TIte secret name
of
exactly right. Another measure is to divide the circular pie into 400 egual pieccs, or 400 grads. But by far the most common measure of angles used in mathematics is thb radlan. Since the ratio o[ the circumference of a circle to its diameter is r= 3. 14159 26535 .. ., and since the radius df a circle
.
Page 43
of
circle is cxactly 2zr times the length of its radius, and we say there arc 2zr radians in a circle. A right angle is then any of 90o, 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 (see
Figure 4),
rvhere & is any integer. The pinciple values of the inverse trigononletric functions are chosen to be close to e = 0, and these arc used to rcsolve the problem of which answer I choose. Thus:
is also equal to one,.as is sin - 3t 12.ln fact sin-l I e has = infinitely many solutions, all of the form e = t12 + k2n,
-f* sin-'x ( f
0< -5 *
ran-tx
<+
Inspection of Figure 5 also shows that the sine and cosine functions are also idcntical to each other, except [or their starting place at e = 0,i.e., they differ only in phase
sin
$ 1 a) = cose , and
sine
cos(e-f) =
srn
Figure
.ffT , and A = ,GOz . Angtes are convenrionally measured counter-clockwise from the right hand horizontal axis (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.
Ci= Tlrc invcrse trigonometric functions arc dcfined in a sirnilar way to the antilogarithm: if sin e =x, then the arcsine of 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 is pcriodic, that is, it rcpeats itself over anC over again as e gcts largcr 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 thc
set
we can "solve" the triangles conveniently with the futhaeorean tlteorenr: O2 + A2 = H2, or O2 + A2 = I,
Otr
Figure
z
'
7l
s?r
21
5tr
3nh4a
e, e in radians.
5.
Graphs of sin
e,
between +
and
matical form:
- l, orin
more mathc-
Trigonometric Identities
sineR,
-l(sine(+l
Because of this restricted donrain, it is nreaninglcss to writc sin-r 2 = e, since no angle e has a sinc equal to 2. But what about 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
Page 44
Marty lonnulas nlay be dcrivcd from the basic definitions of the trigonometric functions which arc oftcn usefirl in the manipulation of equations involving trigonornetric functions. They are called idcntitics sincc, like all equations, tlre expressions on cithcr sidc of the equal sign "say" e,\actly the samc thing, but in a uscful way. ln llre following idcntitics,
ll
Number I
(Tl):
(T2): cos 2A = cos2 A - sin 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 of coursc, nrany rrrorc cxist.
each other, and,
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
'
a 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!, what these frecluencics, anrplitudcs, :rnd phascs tntrst be in rrrder to rc-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 as wcll as pcriodicity; sul'llcc it to be suid that aiy wavcfrxn which could cxist in the physical world will obcy thcsc other conditions (callcrl the Dirichlct conditions). Stated nrathenratically, the wavefornr must obcy the condition /(r) = f (t + 7"), rvhcre / is r[e perigdic waveform, I is tiure, and 7'is the peri<lcl o[ the waveform. Then
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 deviatc frorrr the atnrosplrcric rrrcan. Orre could nrcasure ttre pcak deviation 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 tlre loudness o[ u sound. Finally, thc gcneral shape of thc rvavefornr determirrcs its tone quality, or linlbre. All of these factors inleract pcrccptually. For instancc, thc pitch can be affccted b), thc aruplitude and tlre slrape uswcll as tttc period of a wavelbrnr. llence it is inrportalrt to distinguish bet*,cen frequency, rvlrich is a nlcasure of the repctition rate of a periodic rvavcfonn, and pitch, whiclr is our perceprion of sonrething Iike the "tonal hcig,ht" of a sound. Au irnportant rrrathclrratical tool which will be described irr Part II of this tutorial is Fourier's tlteorent, which slares lhat any periodic waveforur can be described as the sum of
Using Trigonometric Functions to Represent Ivlusical Sounds Onc of thc grcat pleasurcs of rnalltctnatics is lhat it can bc uscd to undcrsl,and portions r:f the "rcal world." If sornc
f(t) = i
rvlrcre:
nnsin(,ror+ca)
phcnonrcnorr naturally bchavcs in a way which can bc descri[:ed nrathcnratically, rnathcrnatics provides a wcalth
lo
of
be
anulyz.cd (i.c., undcrstootl), pcrhaps nrodificd in a prcdictablc and tlcsirublc way, and llossibly synthcsized (crcatcd in a nerv and llexible way). Such phcrronrena are lhc sounds of rnusic and specch. Sourtds arc vibrations in thc air to rvhich our cars are
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 stating
thc sanre thing
'6
o)
f(t).
of
is
scnsitive. Acoustical studies huvc shown that tlre quality of a sound as u'e perccive it is related to ccrtain cltaractcristics of the "slupe" of lhc vibrations, i.e., we draw a graplr of the air prcssurc lluctuations as a liutction oI tinrc and observc its graplrical slrapc. Il'thc wavcshapc is fairly rcgular and rcpctilivc (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 rvaveIorrn is irrci;ular and apcriodic, thc sound rvill lravc littlc <lr no pitch, but instc:ld sourrrJ likc a noisc such as stcanr rushilrg or a cyrnbal crash. ln spcech, periodic wavelbrnrs arc associated with voiced sounds, srrch as vowcls and voiced corrsonanls.
f (t)
= D k=0
kucos,tc,.rr
+ Do sin &c^:r)
rvhcrc both the arrrplitudcs und ;:lrases o[ the prcvious c.\prcssion 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)
@) : A sin Q cos kor, +l cos Q sin ktot = a cos kat + b sin kc,st
,tor
sin
and b
Page
45
a2 +62
Az
sin2 O + A2 cos2
O+
A2 (sin2
cos'
C)
= A2
Therefore, AIso,
simple. It tells us of a relationship among all of the known fundamental constants of mathematics in a way that mathe. maticians, and perhaps by now the reader, can only consider beautiful.lt is easy to see from Figure 5 that the following relationships are true: cosTr
t=JffiT
= -l sinr=0
i = m=
Therefore
ly led to what
If we substitute n for x in Eulcr's relationship, we are unerring' has been rightly called "the most beautiful :io= cosa+f sinz - -l +0
formula in mathematics:"
O=
tan-t
9u
What we have done is not only to show that the two fonnulas for f (t) above are the same, but also how to derive one form from thc other.
The Most Beautiful Formula in Mathematics
Therefore:
efr+l =0
Conclusion of Part I
Mathematir-'ians crcate mathematics, the rest of us merely use, and sometilncs appreciate, what the mathema-
eto = cosx+isinx
thercby relating algebraic exponentials to the trigonometric functions. This key formula is the basis for much of the nrathematics used in signal processing, for it allows some very por+'crful manipulations to be made using sinusoidal functions that would otherwise prove very tedious. For exantple, by using rules E3 and E8 regarding exponents, it is casy to see that
ticians have created. Computers have at the same time reduced the need for human calculation and increased many fold the utility of human mathematics, especially to non-mathematicians who can now apply these powerful toots to the study of virtually anything. We now have to discover the models which state tJre correspondence between phenomena and mathematics. Once rl,e koow that a vibration is periodic, for instance, wc know that we can use Fourier's techniques to find the elemental building blocks of thc vibration. We atso know that if we add up the same building blocks ourselves that we can reprorluce the phenomenon at will. Or perhaps we might improve on the original a bit, once we're sure that the original is understood corectly.
Thus we can make machines that talk and sing, we can study tle waves in the ocean, and the vibrations in an earthquake. Fourier himself was studying the transfer of heat at the time 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 things per se, and if a theorem correctly states that "A" has relation "R" to "8", and we note that the height of a mountain could be thought of as thing "A", then we know that something else will correspond to "8", and "R" will tcll us where to look for
[r (cose+ i
sin
e)]P =
7P (sos
pe+ i
sin
pa)
This form of De Moivre's theorent may be uscd to demonstrate many of thc trigonometric identities in a very economical way. For exarnple, if we let r -- I and p = 2, cos2e
+isin2e =
(cos6r
cos2e
it.
For the reader interested in using mathematics, a good mathenratical handbook is heartily recommended, such as the excellent and inexpensive Mathematical Hondbook of Fotmulas and Tables by Murray R. Spiegel, available as a Schaum Outline Serics paperback (McGraw-Hill). For the reader intercstcd .in understanding mathematics in greater detail, it is recommended that this be treated in the same way as a desire to learn to play a piano: a good teacher and regular practice will suffice in a way that nothing elsc can. Reading books helps,* and there are certainly plenty of books to read on mathematics at evcry conceivable level, but not much more than it helps to read a book about playing a piano.
Since two cornplex numbers are equal if an only if both their real parts are equal and their imaginary Parts are equal, this simple procedure has just shorvn that cos
and
Tlris dcmonstrates the validity of both identity Tl ond idcntity T2. ln other words, by using the complex exponential in Euler's relation, we can, in effect, solve two cquations at
once
!
* An excellent book to read is The Foundations of Mathemat' Tall (Oxford University Press).
ll
Numtrer
Some Problems
ates
of a point on that
plane
l.
x:
(Two solutions) (Four solutions)
(x
- I=0 b)xa-l=g
a) x2
r,
! rl
c) Iogls-r = .43429.
d) antilogl
5=x
(Hint: logoa =
l)
e)2x=20 D nx'+Dx+c-0
2. The sequence (i,
i2
(l{inr:20 = 10.2)
,
i3
, i4 , is , . .
.)
is
peiodic,
since
it
If we draw a straight line frorn the origin (point (0, 0) to ) point (x1,71 ), we- could also use the length r urd an$e e of 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 the lcngth-of the hypore-nuse of a ii-gtit triange il'eqrral to iL surn 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 series expansion, for ex').
power
3. Find
inclusive.
4. Rewrite the following scquences using summation notation (E) and find their solutions; a) I,000,000 + I00,000 + 10,000
tcrms)
+...
(infinitety many
b) I00 + 200 + 400 + 800 +. -. to t0 terns c) 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, wc csn use x1 andyl for thc horizontal and vertical coordin-
the
Lr-
4t+ .rr
J:
'u
-)-
-t.-
a
F
,c
,rrr;,r..22
j'r
*1-
?at
E\
'ri'-4.
-:
:
::::
J
."jjir5i,,:-^,,
-__
'-'!
:'1'
T"ii
{=}-
r'i "ri I
l_=:::::-_*=-S=*+lfj_iifffil+
;i,
".q tr,.,,,,,,"t'
'.'4 -r..
,,,
:,, ...
"--{
...,iri64t.tL.
''q"
or-,
-" r-+'
,t.i.+
"j:
1r'
nr,o
ot
J''':nt1-
)i?i j :q
/d,
; Ef'
{.
-t,'
or}.$' I
Monochord 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
pagelz