Filter löschen
Filter löschen

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

1 Ansicht (letzte 30 Tage)
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

Akzeptierte Antwort

Iain
Iain am 24 Jan. 2014
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 Kommentare
Fam
Fam am 24 Jan. 2014
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 am 29 Jan. 2014
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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Fourier Analysis and Filtering finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by