PHYCS 3730/6720 Lab Exercise

Reading and references:
Answer file lab18.

Exercise 1. Maple Discrete Fourier Transforms

Here is an example Maple session for doing the Fourier transform of a cosine and producing a vector containing the power spectrum. You will need Maple version 9 or higher to do this exercise. In our labs you may need to run the command xmapleV9 & in a terminal window to get it.
with(DiscreteTransforms);
N := 128;
f := Vector(N,j->evalf[6](cos(40*Pi*(j-1)/N)),datatype=complex[8]);
F := FourierTransform(f,inplace=true);
P := Vector(128,i->Re(F[i]*conjugate(F[i])),datatype=float[8]);
The Vector command sets up a vector f of length N with components that sample the function f(t) = cos(w*t). The sampling is at discrete times t = (j-1) * Dt for t ranging from 0 to 127*Dt. The angular frequency is w = 40*Pi/(N*Dt). (Note that Dt is the time interval between sample points. Since we specify the angular frequency w in terms of Dt, it cancels out in f(t), so we don't need to give it a numeric value at this point. If it helps, you can think of it as one second.)

The FourierTransform command generates the Fourier transform and puts it in the vector F. The next line computes a real vector containing the squared norm of the Fourier components. Note that with Maple indexing the Fourier component for zero frequency appears in F[1] and its power appears in P[1]. More generally, in this notation we must use i = m+1 to translate from the indexing in the notes to Maple indexing.

To plot the power spectrum we can use

with(plots);
pointplot({seq([i,P[i]],i=1..128)});
In this first exercise, run the Maple commands to see the result. Then answer these questions.

Exercise 2. Damped oscillation

Use Maple to construct the power spectrum for the signal f(t) = exp(-0.2*t/Dt)*cos(0.8*t/Dt) using the same discretization as above. That is, sample at t/Dt = j = 0,1,...,127. The line shape you get in power vs frequency is called a Lorentzian.

In your answer file give the Maple commands you used. Then answer these questions: