An example of the use of the Discrete Fourier Transform
Download
sunspot.m
which contains a record of sunspot observations from 1700 to 2006.
Let t be column 1 of the matrix (the year) and sunspots be column 2 (the sunspot count). Plot sunspots vs. t.
Let Fs be the Discrete Cosine Transform of sunspots. (This is the real part of the FFT, ignoring the imaginary part.) Plot Fs vs. t.
Let s_hat be the inverse Discrete Cosine transform (IDCT) of Fs. Verify that || s_hat - sunspots || is very small.
Notice that some components of Fs are large in magnitude, but most are small. Which components of Fs are large in magnitude? These components identify the most important periodic components in the sunspot data.
See how many components of Fs you can set to zero and still have the IDCT of this vector very close to sunspots.