Hello, I am a beginner in MATLAB. I want find FFT and power spectrum of a data series stored in excel. It consists of a single column of data with 1000 rows. How do I proceed? I tried it with following code.
1) xlsread("Book1.xlsx");
%book1 has single column of data with 1000 rows. This is returning a 1000×1 sized array as expected with name 'ans'
2) X=fft(ans);
%this is returning a 1000×1 sized array with complex numbers.
3) plot(abs(X));
%this is plotting a graph with x axis running from 0 to 1000 and y axis from 0 to 180

2 commentaires

Star Strider
Star Strider le 21 Mar 2020
Unless the corresponding sampling times or the sampling frequency (the sampling intervals must be constant) are also available, the results will be meaningless because without them it is impossible to correctly calculate the frequencies.
Tanmay Kulkarni
Tanmay Kulkarni le 23 Mar 2020
Actually it is a computationally calucated data. Over a 1000 iteration it is returning a value of variable. So I don't have a sampling time. What should I do in such case?

Connectez-vous pour commenter.

Réponses (0)

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by