{VERSION 2 3 "APPLE_PPC_MAC" "2.3" } {USTYLETAB {CSTYLE "Maple Input" -1 0 "Courier" 0 1 255 0 0 1 0 1 0 0 1 0 0 0 0 }{CSTYLE "2D Math" -1 2 "Times" 0 1 0 0 0 0 0 0 2 0 0 0 0 0 0 }{CSTYLE "2D Comment" 2 18 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 256 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 257 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 258 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 }{CSTYLE "" -1 259 "" 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 } {CSTYLE "" -1 260 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{CSTYLE "" -1 261 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }{PSTYLE "Normal" -1 0 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }{PSTYLE "Heading 1" 0 3 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 0 0 0 0 0 0 0 }1 0 0 0 6 6 0 0 0 0 0 0 -1 0 }{PSTYLE "Title" 0 18 1 {CSTYLE "" -1 -1 "" 1 18 0 0 0 0 0 1 1 0 0 0 0 0 0 }3 0 0 -1 12 12 0 0 0 0 0 0 19 0 }{PSTYLE "" 0 256 1 {CSTYLE "" -1 -1 "" 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 }0 0 0 -1 -1 -1 0 0 0 0 0 0 -1 0 }} {SECT 0 {PARA 18 "" 0 "" {TEXT -1 31 "Filtering and signal processing " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 1 "(" } {TEXT 256 65 "c) Copyright 1994-1997 by Evans M. Harrell II and James \+ V. Herod." }}{PARA 256 "" 0 "" {TEXT -1 24 " All rights reserved" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 136 "An int uitive way to understand the projections of functions is to consider t he application in signal processing for filtering. The word " }{TEXT 257 9 "filtering" }{TEXT -1 189 " refers to an attempt to extract the \+ important part of some data, while eliminating random contributions re ferred to as noise, or to remove other unwanted features which obscure the signal." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 91 "To illustrate the procedure, we choose a simple selection of fe atures that are regarded as " }{TEXT 258 4 "good" }{TEXT -1 5 " and " }{TEXT 259 3 "bad" }{TEXT -1 287 ", to create low-pass and high-pass f ilters. Suppose that we have a signal f(t) which contains some pure fr equencies in which we are interested. That is, we suppose the signal c onsists of some interesting part corresponding to pure vibratory funct ions represented as multiples and sums of" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 100 " sin(2 ¹ x), sin(4 ¹ x ), ... , sin(20 ¹ x), 1, cos(2 ¹ x), cos(4 ¹ x), ... , cos(20 ¹ x)," } }{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 46 "and some noise. A concise way to write this is" }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}{PARA 0 "" 0 "" {TEXT -1 20 "(*) f(t) = " }{XPPEDIT 18 0 "a[0]" "&%\"aG6#\"\"!" }{TEXT -1 3 " + " }{XPPEDIT 18 0 "sum(a[p]*cos( 2*p*Pi*t),p=1..10)" "-%$sumG6$*&&%\"aG6#%\"pG\"\"\"-%$cosG6#**\"\"#F*F )F*%#PiGF*%\"tGF*F*/F);F*\"#5" }{TEXT -1 3 " + " }{XPPEDIT 18 0 "sum(b [p]*sin(2*p*Pi*t),p=1..10)" "-%$sumG6$*&&%\"bG6#%\"pG\"\"\"-%$sinG6#** \"\"#F*F)F*%#PiGF*%\"tGF*F*/F);F*\"#5" }{TEXT -1 3 " + " }{XPPEDIT 18 0 "f[noise](t)" "-&%\"fG6#%&noiseG6#%\"tG" }{TEXT -1 1 "." }}{PARA 0 " " 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 41 "We take the twenty terms as defining " }{XPPEDIT 18 0 "f[filtered](t)" "-&%\"fG6#%)f ilteredG6#%\"tG" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 39 "Note that we might be able to omit the " }{XPPEDIT 18 0 "a[0]" "&%\"aG6#\"\"!" }{TEXT -1 120 " term if the sign al oscillates around the average zero. More than anything else, such a condition might be a convention." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }} {PARA 0 "" 0 "" {TEXT -1 163 " As we explained in Chapter 2, the p rojection formula tells us the best choice for these coefficients, in \+ the sense that the root mean square error is minimum:" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 36 " \+ | f(t) - " }{XPPEDIT 18 0 "a[0]" "&%\"aG6#\"\"!" }{TEXT -1 3 " - \+ " }{XPPEDIT 18 0 "sum(a[p]*cos(2*p*Pi*t),p=1..10)" "-%$sumG6$*&&%\"aG6 #%\"pG\"\"\"-%$cosG6#**\"\"#F*F)F*%#PiGF*%\"tGF*F*/F);F*\"#5" }{TEXT -1 3 " - " }{XPPEDIT 18 0 "sum(b[p]*sin(2*p*Pi*t),p=1..10)" "-%$sumG6$ *&&%\"bG6#%\"pG\"\"\"-%$sinG6#**\"\"#F*F)F*%#PiGF*%\"tGF*F*/F);F*\"#5 " }{TEXT -1 2 " |" }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 275 "This is analogus to the projection of a vector into a pl ane being the planar vector whose distance from the original vector is as small as possible. From the perspective of freshman, multidimensio nal calculus, the above formula is a projection into a space with dime nsion 21." }}{PARA 0 "" 0 "" {TEXT -1 107 " The projection formula for the orthogonal set (*) above on the interval [0, 1] provides a fo rmula for " }{XPPEDIT 18 0 "a[k]" "&%\"aG6#%\"kG" }{TEXT -1 5 " and " }{XPPEDIT 18 0 "b[k]" "&%\"bG6#%\"kG" }{TEXT -1 134 ". Notice that if \+ we put these terms together, we see that the filtering is accomplished by an integral operator of the separable type:" }}{PARA 0 "" 0 "" {TEXT -1 16 " " }{XPPEDIT 18 0 "f[filtered]" "&%\"fG6#% )filteredG" }{TEXT -1 3 " = " }{XPPEDIT 18 0 "int(k(x,t)*f(t),t=0..1) " "-%$intG6$*&-%\"kG6$%\"xG%\"tG\"\"\"-%\"fG6#F*F+/F*;\"\"!F+" }} {PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 6 "where " }} {PARA 0 "" 0 "" {TEXT -1 29 " k(x, t) = 2 " }{XPPEDIT 18 0 "sum(cos(2*Pi*m*x)*cos(2*Pi*m*t)" "-%$sumG6#*&-%$cosG6#**\"\"#\" \"\"%#PiGF+%\"mGF+%\"xGF+F+-F'6#**F*F+F,F+F-F+%\"tGF+F+" }{TEXT -1 5 " + 2 " }{XPPEDIT 18 0 "sum(sin(2*Pi*m*x)*sin(2*Pi*m*t)" "-%$sumG6#*&-% $sinG6#**\"\"#\"\"\"%#PiGF+%\"mGF+%\"xGF+F+-F'6#**F*F+F,F+F-F+%\"tGF+F +" }{TEXT -1 1 "." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 1 {PARA 3 " " 0 "" {TEXT -1 12 "Example F.1." }{TEXT 260 1 " " }{TEXT -1 42 "Chang ing a noisy signal to a clear signal." }}{PARA 0 "" 0 "" {TEXT -1 69 " In this example, we pick out a clear signal from a noisy signal. " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 142 "Noisy:=x->piecewise(x<1 /4,4*x,\n x>1/4 and x < 1/2,-4*x+2,\n x>1/2 and x < \+ 3/4, 4*x-2,\n -4*x+4)+sin(30*Pi*x)/10-1/2;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "plot(Noisy(x),x=0..1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 124 "k:=(x,t)->2*sum(cos(2*Pi*m*x)*cos(2*Pi*m *t),m=1..10) + \n 2*sum(sin(2*Pi*m*x)*sin(2*Pi *m*t),m=1..10);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "int(k(x, t)*Noisy(t),t=0..1):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "sig nal:=unapply(\",x):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 23 "plot (signal(x),x=0..1);" }}}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 1 {PARA 3 "" 0 "" {TEXT -1 54 "Example 2. Separating out the first three frequencies." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 95 " In this second example, we filter out frequencies gr eater than 3. First we draw the signal" }}{PARA 0 "" 0 "" {TEXT -1 0 " " }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 26 "Noisy:=x->sin(1/(x+1/20) );" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "plot(Noisy(x),x=0..1) ;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 302 "a0:=evalf(Int(Noisy(t ),t=0..1));\na1:=evalf(Int(cos(2*Pi*t)*Noisy(t),t=0..1));\na2:=evalf(I nt(cos(4*Pi*t)*Noisy(t),t=0..1));\na3:=evalf(Int(cos(6*Pi*t)*Noisy(t), t=0..1));\nb1:=evalf(Int(sin(2*Pi*t)*Noisy(t),t=0..1));\nb2:=evalf(Int (sin(4*Pi*t)*Noisy(t),t=0..1));\nb3:=evalf(Int(sin(6*Pi*t)*Noisy(t),t= 0..1));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 123 "signal:=x->a0 + \n 2*(a1*cos(2*Pi*x)+a2*cos(4*Pi*x)+a3*cos(6*Pi*x))\n + 2*(b1*sin (2*Pi*x)+b2*sin(4*Pi*x)+b3*sin(6*Pi*x));" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 34 "plot([Noisy(x),signal(x)],x=0..1);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 44 "plot(Noisy(x)-signal(x),x=0..1,y=-1/2..1/ 2);" }}}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{SECT 1 {PARA 3 "" 0 "" {TEXT 261 10 "Example 3:" }{TEXT -1 39 " Enhancing the low frequency p art of f." }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{PARA 0 "" 0 "" {TEXT -1 104 " In this final example we illustrate the effect of enhancing \+ some of the frequencies of a signal. " }}{PARA 0 "" 0 "" {TEXT -1 0 "" }}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 31 "Noisy:=x->2*Heaviside(x -1/2)-1;" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 122 "k:=(x,t)->2*su m(cos(2*Pi*m*x)*cos(2*Pi*m*t),m=1..4) + \n 2*s um(sin(2*Pi*m*x)*sin(2*Pi*m*t),m=1..4);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 28 "int(k(x,t)*Noisy(t),t=0..1):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 21 "signal:=unapply(\",x):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 127 "k2:=(x,t)->4*sum(cos(2*Pi*m*x)*cos(2*Pi*m*t)/m, m=1..4) + \n 4*sum(sin(2*Pi*m*x)*sin(2*Pi*m*t) /m,m=1..4);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 29 "int(k2(x,t)* Noisy(t),t=0..1):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 22 "enhanc e:=unapply(\",x):" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 57 "plot( \{Noisy(x),signal(x),enhance(x)\},x=0..1,color=BLACK);" }}}{EXCHG {PARA 0 "> " 0 "" {MPLTEXT 1 0 0 "" }}}}{PARA 0 "" 0 "" {TEXT -1 0 "" }}}{MARK "2 1" 65 }{VIEWOPTS 1 1 0 1 1 1803 }