Unformatted text preview:

>restart;Fourier Polynomials and Series0.1 Fourier PolynomialsFourier polynomials provide a way of approximating general periodic func-tions by sums of very simple periodic functions, namely the familiar sine andcosine functions, shifted and scaled. We will consider functions, f(x), thatare 2π -periodic, so that f(x +2 π ) = f(x). For example, any function ofthe formf (x) = bksin (kx) org (x) = akcos (kx) , where k is a positive integerwhileakandbkare constants, is 2π -periodic, although it may have a smallerperiod.Thatis, the period of , say,sin (kx) is2πk, so that it repeats after every interval oflength2πk, but then of course it repeats after every interval of length 2π . Theinteger k gives thefrequencyof the sine or cosine function, so large values of kcorrespond to very wiggly graphs. The numbersakandbkgive theamplitudes.Recall also that the graph of cos(x) is obtained from the graph of sin(x) by ahorizontal shift ofπ /2, and the graph of Acos(kx) is likewise obtained from thegraph of Asin(kx) by a horizontal shift of lengthπ /(2k). What do you get ifyou shift the graph of Asin(kx) horizontally by some other distance? It turnsout that any such horizontal shift of Asin(kx) can be represented in the form(1)akcos (kx) + bksin (kx)where the amplitude A is equal toqak2+ bk2. Functions of the form (1)are convenient to work with. Sums of such functions, with possibly an addedconstant which we denote by , are calledFourier polynomials.Thus a Fourierpolynomial ofdegree nis a function of the form F(x) =a0+nXk=1akcos (kx) + bksin (kx) = a0+nXk=1akcos (kx) +nXk=1bksin (kx).A Fourier polynomial can be specified by giving theFourier coefficients ,... . For example, supposea0= 1, a1= 1/2, a8= 1/8, b8= 1/8 , with all othercoefficients being 0. The corresponding Fourier polynomials is thenF(x) =1 + 1/2 cos (x) + 1/8 cos (8 x) + 1/8 sin (8 x) . Let’s graph the threefunctions1 + 1/2 cos (x) ,1/8 cos (8 x) + 1/8 sin (8 x) , and F(x) on the sameaxes:>plot([1+cos(x)/2,cos(8*x)/8+sin(8*x)/8,1+cos(x)/2+cos(8*x)/8+sin(8*x)/8],x=-Pi..Pi, color=[blue, green,black]);Note that we only graphed between−π andπ , a practice we will continuethroughout the worksheet. Observe that the high frequency term is a shifted sinewith amplitudep1/32 ˜ 0.177 and that the graph of F(x) is the superpositionof this high frequency graph with that of the vertically shifted cos(x)/2.It will be convenient to specify the Fourier coefficients by giving the con-stant term , and then twolistsfor the coefficentsa1. . . an, andb1. . . bn. TheprocedureFPolydefined below, takes the constant term , the two lists and thedegree and returns the Fourier polynomial as an expression. For our example,the coefficient list for the a’s is [1/2,0,0,0,0,0,0,0,0,1/8] while the coefficient listfor the b’s is [0,0,0,0,0,0,0,0,0,1/8].Be sure to execute the next command line.>FPoly:=proc(a0,a,b,n) local k;a0+sum(’a[k]*cos(k*x)+b[k]*sin(k*x)’,’k’=1..n); end;FPoly := proc(a0abn)local k; a0 + sum(0a[k] ∗ cos (k ∗ x) + b[k] ∗ sin(k ∗ x)0,0k0= 1..n)end proc;As an example let’s plot the degree 9 Fourier polynomial F(x) =0.25 + 0.5 cos (3 x) + 0.25 cos (5 x) + 0.125 cos (9 x).>plot(FPoly(.25, [0,0,.5,0,.25,0,0,0,.125],[0,0,0,0,0,0,0,0,0],9),x=-Pi..Pi);Note that this is the graph of anevenfunction of x, and that all the sine coef-ficients were 0. This is an example of the following general fact you will finduseful.Odd and Even:A Fourier polynomial is an even function when all its sine coefficients are0. A Fourier polynomial with its constant term removed is an odd functionwhen all the cosine coefficients are 0.Problem 1.By trial and error, estimate the Fourier coefficients of the degree 4Fourier polynomials whose graphs are shown below. All plots are from−π toπand (hint) each has no more than 3 nonzero coefficients.a)b)c)0.2 The Fourier Polynomials of a FunctionIf f(x) is a 2π periodic function, we define theFourier coefficients of f to bea0= 1/2Rπ−πf (x) dxπ, ak=Rπ−πf (x) cos (kx) dxπ, bk=Rπ−πf (x) sin (kx) dxπ, for k = 1,2,...n.The degree n Fourier polynomial with these coefficients is called thedegree nFourier polynomial of f .The infinite series whose partial sums are the Fourierpolynomials of f is called theFourier series of f .The degree n Fourier polynomialof f is the Fourier polynomial of degree n that best approximates the functionf over the whole interval [-π ,π ] in a certain technical sense we won’t go intohere.The calculation of the integrals that give the Fourier coefficients is usuallyvery tedious. We provide Maple procedures to do these calculations. The pro-ceduresacoefsandbcoefstake the functionf and the degreenand return lists of thecoefficientsak, resp.bkfork = 1..n.A separate procedure calledazeroreturns toconstant coefficient . We also provide similar procedures calledNacoefs, Nbcoefs,Nazerothat do the same things with all integrals computed numerically. Youmay find it useful to try both kinds on the problems. Be sure to execute thefollowing commands.Let’s try this out on the simple function below, whose graph is shown.>f:=x->piecewise(x>0,1,0);f := x 7→n1 0 < x0 otherwise>plot(f(x),x=-3..3);The part of the graph of f between -3 and 0 does not show as the function iszero there. We compute the Fourier coefficients up to degree 20. We will callthe coefficient lists a and b. We print out the Fourier polynomial of degree 9and we plot the graph off together with the graphs of the Fourier polynomialsof degrees 5,10,15 and 20. Note thatak= 0 fork’s exceptk = 0. This illustratesan extension of the odd/even principle we discussed above.If a function is even, all its sine coefficients will be 0. If a function can bemade into an odd function by some vertical shift, then all its cosine coefficientswill be 0.For our present functionf, shifting vertically down by 1/2 produces an oddfunction. It is often very useful to observe even or odd symmetry of the functionyou are dealing with and to simply set the appropriate coefficient list equal toa list of zeros without doing any calculation.>a:=acoefs(f,20): b:=bcoefs(f,20): a0:=azero(f):>FPoly(a0,a,b,9);1/2 + 2sin (x)π+ 2/3sin (3 x)π+ 2/5sin (5 x)π+ 2/7sin (7 x)π+ 2/9sin (9 x)π>plot([f(x),seq(FPoly(a0,a,b,5*n),n=1..4)],x=-Pi..Pi);Problem 2Consider the function g(x) =1/4 x2for x between−π andπ repeatedperiodically.a) Compute and have Maple print the Fourier polynomials of degrees 5,10,and 15.b) Plot them together with the graph of


View Full Document

URI MTH 142 - Fourier Polynomials

Download Fourier Polynomials
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Fourier Polynomials and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Fourier Polynomials 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?