Assignment 5: Continuous Time Fourier Transform

This assignment is specially designed for those who want/need to enhance their final grades. The grading is not even. The deadline of this assignment is 1/20/2009 mignight.

Problems

In this assignment, we are going to use Matlab/Octave to compute the continous time Fourier transform,
where f(x) is given by a data set (0,f(0)), (1,f(1)),...,(L-1, f(L-1)), and (L,f(0)).
Notice that we make the last element equal to the first one so the function is periodic.
  1. The step size of data set is too large (&Delta x=1). We can resolve this problem by interpolate those L+1 data points by natural cubic spline. (see lecture note 7, page 15). (20%)

    The interface of your subroutine would be like

    function [coeff] = ncp(L, x)

    where L is a scalar indicating the number of data set, x is an array of length L. The return argument coeff is an L× 4 matrix, in which the ith row is the coefficients of the cubic polynomial, from degree 0 to degree 3, in the ith iterval.

  2. Compare your result in 1 with the spline function in Matlab/Octave. (20%)

  3. Write a function to evaluate queried function points of the cubic spline computed in 1. (20%)

    The interface is

    function [y] = queryncp(coeff, x)

    where coeff is the matrix computed in 1, and x is the data points to be queried, which is a sorted arry of arbitrary length (all elements are in [0,L]).
    The return argument y is an array of the same length as x, whose elements is the corresponding function values of x.

  4. Compare your results in 3 with the function ppval. (20%)

  5. Now we can use functions defined in 1 and 3, and the composite Simpson's rule to compute the integration,
    .
    (20%)

    The interface is like

    function intval = ctft(L, fx, m, t)

    where

Submission

Please put your codes and comparison results into a text file and email it to me before the dealine 1/20/2009.

Updated Jan 13, 2009