如何在Matlab中使用Fft函数来查找一组数据点的频率? [英] How Do I Use Fft Function In Matlab To Find The Frequency For A Set Of Data Points?

查看:765
本文介绍了如何在Matlab中使用Fft函数来查找一组数据点的频率?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经获得了一组大约20k的数据点。我设法将数据导入matlab并执行以下操作,



importdata;

fft(importdata);



并且它表示未定义的函数'fft'用于'cell'类型的输入参数。

现在我明白我需要更多才能让它工作,有人可以请告诉我fft需要的更多参数以及如何实现它?



编辑:这些数据点是在机器中检测到某些东西的时间戳,

我试图找出是否有一段时间的检测发生。



任何人都有想法如何改变它所以我可以使用matlab fft?

解决方案

我猜这个文件是二进制数据,所以 importdata 创建了一个 cell array。

尝试 cell2mat 功能 [ ^ ]转换为 fft 可以使用的矩阵。


< blockquote> fft() [ ^ ]矢量和/或数组的常规函数​​(最好是数据类型为double的矢量,因为我们'再谈谈时间矢量更有意义)。如果您的数据不是那种格式,那么您必须以该格式获取数据。


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?

解决方案

I'm guessing the file is binary data so the importdata has created a cell array.
Try the cell2mat function[^] to convert to a matrix that fft can use.


The fft()[^] routine functions on vectors and/or arrays (preferably on vectors of data type double, since we're talking about time a vector makes more sense). If your data is not in that format, then you have to get it in that format.


这篇关于如何在Matlab中使用Fft函数来查找一组数据点的频率?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆