How Do I Use Fft Function In Matlab To Find The Frequency For A Set Of Data Points?

1 次查看(过去 30 天)
hi ive been given a set of about 20k data points. i managed to import the data into matlab and did the following,
importdata; fft(importdata);
and it says Undefined function 'fft' for input arguments of type 'cell'. now i understand i need more than this to get it working, can someone please tell me any more parameters i need for the fft and how to implement it?
edit: these datapoints are timestamps of when something is detected in a machine, im trying to find if there is a period of the detection occuring.
anyone have ideas how to trasnform it so i can use matlab fft? Imp

采纳的回答

Iain
Iain 2014-1-24
If what you have is the times of occurrences, then a fft is inappropriate. - FFTs require regularly sampled data.
I don't know what your "importdata" looks like. You'll need to provide a description.
If what your data looks like is something like a table of
timestamp: event
timestamp: event
Then you can simply calculate the difference between each time stamp. If you then plot the difference in timestamp, you'll probably see several clusters of values. Each cluster is likely to be the period of a regular event - or a multiple of it.
  4 个评论
Fam
Fam 2014-1-24
hi Iain,
i entered that code but nothing happened,pardon me for asking, what does the function diff(importdata{1}) do and what does 'x' refer to?
Thanks alot
Iain
Iain 2014-1-29
importdata{1}, is where I've assumed that a vector of those time stamps is. - I can't see your data so I don't know if it's right.
diff( vector ) simply subtracts the 2nd element from the 1st, the 3rd from the 2nd, etc. and returns a vector of those differences.
plot( vector, 'x') plots each value in the vector, with crosses instead of as a line.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by