15.11.2014 Views

MATLAB Mathematics - SERC - Index of

MATLAB Mathematics - SERC - Index of

MATLAB Mathematics - SERC - Index of

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3 Fast Fourier Transform (FFT)<br />

200<br />

Sunspot Data<br />

180<br />

160<br />

140<br />

120<br />

100<br />

80<br />

60<br />

40<br />

20<br />

0<br />

1700 1750 1800 1850 1900 1950 2000<br />

Now take the FFT <strong>of</strong> the sunspot data:<br />

Y = fft(wolfer);<br />

The result <strong>of</strong> this transform is the complex vector, Y. The magnitude <strong>of</strong> Y<br />

squared is called the power and a plot <strong>of</strong> power versus frequency is a<br />

“periodogram.” Remove the first component <strong>of</strong> Y, which is simply the sum <strong>of</strong> the<br />

data, and plot the results:<br />

N = length(Y);<br />

Y(1) = [];<br />

power = abs(Y(1:N/2)).^2;<br />

nyquist = 1/2;<br />

freq = (1:N/2)/(N/2)*nyquist;<br />

plot(freq,power), grid on<br />

xlabel('cycles/year')<br />

title('Periodogram')<br />

3-4

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!