Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

FourieranalysisofSunspotData

Hereweperformaquickanalysisofhistoricalsunspotdata(thisisdatathatcomeswithMatlab,butispubliclyavailable
ontheinternetaswell).Ourmainquestion:Howoftendowehaveyearsinwhichtherearealargenumberofsunspots?

Contents
First,loadandcleanupthedataabit:
Now,taketheFFTandanalyzethefrequencycontent:
Findwhichdatapointhasthemaximum:

First,loadandcleanupthedataabit:

load sunspot.dat
year=sunspot(:,1);
sun=sunspot(:,2);

figure(1)
plot(year, sun);
title('Original data');

Now,taketheFFTandanalyzethefrequencycontent:

Y=fft(sun);
Y(1)=[]; %Remove the mean

figure(2)
plot(abs(Y(1:143))); %We'll only plot the relevant half.

Findwhichdatapointhasthemaximum:

[a,b]=max(abs(Y(1:143)))

a=

4.2727e+03

b=

26

PublishedwithMATLAB7.14

You might also like