To construct the trigonometric polynomial of order M of the form
based on the N equally spaced values
The construction is possible provided that
. The following http://siber.cankaya.edu.tr/ozdogan/NumericalComputations/mfiles/chapter4/tpcoeff.m program constructs vectors A and B that contain the coefficients and , respectively, of the equation above of order M.
You are given the function for the interval
.
Use the MATLAB program given above to calculate s and s.
(Hint: You should first calculate all the values for a given , say 100.)
The following program will evaluate the of order at a particular value of . and values are taken from the previous item.