1

I am trying to test a set of data to see how close it is to a perfect sinusoid. I want to do this by using the fft command in Matlab. Essentially when I plot the magnitude of the fft I am suppose to get a spike around w=0.3. The data I am trying to analyze is essentially just about 200000 data points.

If you simply plot t VS data you will get a sinusoidal graph with some noise.

Basically, my question is how do I plot the magnitude of the fft of a set of data so that I can see the behavior of the spike?

What I have so far for my code:

t = data.time; %Putting the time measurements in t
data = data.values; %Just putting all the sinusoid data in data

freq = 0:0.1:2;

Y = fft(data);

magY = abs(Y);

plot(freq, magY);
Kira
  • 115
  • 9

0 Answers0