讲解:Math 104A、Python、algorithm、PythonC/C++|SPSS

Math 104A Final ProjectsGeneral Instructions: Please follow TA’s instructions (on Gauchoapace) to turn it in. Writeyour own code individually. Do not copy codes!The Discrete Fourier Transform (DFT) of a periodic array fj , for j = 0, 1, ..., N −1 (correspondingto data at equally spaced points, starting at the left end point of the interval of periodicity) isevaluated via the Fast Fourier Transform (FFT) algorithm (N power of 2). Use an FFT package,i.e. an already coded FFT (the functions fft and ifft in Matlab or numpy.fft in python).1. Letck =NX−1j=0fje−i2πkj/N .Prove that if the fj , for j = 0, 1, ..., N − 1 are real numbers then c0 is real and cN−k = ¯ck,where the bar denotes complex conjugate.2. Which fft package are you using? Read the manual of your fft package, and write down theformula it’s using to return the coefficients. (Note: different packages may use differentdefinitions of the DFT, so it is very important to figure out what your package is calculatingbefore using it.)3. Let PN (x) be the trigonometric polynomial of lowest order that interpolates the periodicarray fj at the equidistributed nodes xj = j(2π/N), for j = 0, 1, ..., N − 1, i.e.PN (x) = 12a0 +N/X2−1k=1(ak cos kx + bk sin kx) + 12aN/2 cos �N2x,for x ∈ [0, 2π], whereak =2NNX−1j=1fj cos kxj , for k = 0, 1, ..., N/2,bk =2NNX−1j=1fj sin kxj , for k = 0, 1, ..., N/2 − 1.∗All course materials (class lectures and discussions, handouts, homework assignments, examinations, web materials)and the intellectual content of the course itself are protected by United StatMath 104A作业代做、Python程序设计作业调试、代做algorithm课程作业、Python语言作业代写 帮做es Federal Copyright Law, theCalifornia Civil Code. The UC Policy 102.23 expressly prohibits students (and all other persons) from recordinglectures or discussions and from distributing or selling lectures notes and all other course materials without the priorwritten permission of class instructors.1Write a formula that relates the complex Fourier coefficients computed by your fft packageto the real Fourier coefficients, ak and bk, that define PN (x).4. Let fj = esin xj, xj = j2π/N for j = 0, 1, ..., N −1. Take N = 8. Using your fft package obtainP8(x) and find a spectral approximation of the derivative of esin x at xj for j = 0, 1, ..., N − 1by computing P08(xj ). Compute the actual error in the approximation.5. The solution Pn(x) to the Least Squares Approximation problem of f by a polynomial ofdegree at most n is given explicitly in terms of orthogonal polynomials ψ0(x), ψ1(x), ...,ψn(x), where ψj is a polynomial of degree j, byPn(x) = Xnj=0ajψj (x), aj =hf, ψj ihψj , ψj i.(a) Let Pn be the space of polynomials of degree at most n. Prove that the error f − Pn isorthogonal to this space, i.e. hf − Pn, qi = 0 for any q ∈ Pn.(b) Using the analogy of vectors interpret this result geometrically (recall the concept oforthogonal projection).6. (a) Obtain the first 4 Legendre polynomials in [−1, 1].(b) Find the least squares polynomial approximations of degrees 1, 2, and 3 for the functionf(x) = ex on [−1, 1].(c) What is the polynomial least squares approximation of degree 4 for f(x) = x3 on [−1, 1]?Explain.转自:http://www.3zuoye.com/contents/3/4828.html

你可能感兴趣的:(讲解:Math 104A、Python、algorithm、PythonC/C++|SPSS)