{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

sft_get_coefficients

sft_get_coefficients - are periodic m the degree of the...

This preview shows page 1. Sign up to view the full content.

function b = sft_get_coefficients (y,m) % usage: b = sft_get_coefficients (y,m) % computes the Fourier coefficients % sft stands for Slow Fourier Transform % % approximate or interpolate n data points % use trigonometric polynomial of degree m, with % 2m+1 < n for approximation % 2m+1 = n or 2m = n for interpolation % input: % y the row vector of function values to be approximated % on the n evenly spaced points % j*2*pi/n where j=0:n-1 % Notice that the point 2*pi (j=n) is not included, % because it is automatically assumed that the data
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % are periodic. % m the degree of the trig polynomial % output: % b_1, . .., b_{m+1} the Fourier coefficients of the % trigonometric polynomial % the trig polynomial may be evaluated using the % function sft_evaluate % method: % since b_k is a polynomial in exp(-2*pi*i*(k-1)/n), use % Horner's rule % n=length(y); b = zeros(m+1,1)+y(n); c=b; const = exp(-2*pi*i/n); c(1) = 1; for k = 1:m c(k+1) = c(k)*const; end; for j=(n-1):-1:1 b=y(j) + b.*c; end; b = b*2/n; b(1)=0.5*b(1); if n == 2*m b(m+1)= 0.5*b(m+1); end;...
View Full Document

{[ snackBarMessage ]}

What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern