如何在 MATLAB 中从 FFT 数据查找频率
从问题:如何获取FFT?
我也有类似的问题。我理解上一个问题的答案,但我想进一步澄清频率。频率与指数相同吗?
让我们举个例子:假设 MATLAB 中有一个数据数组 (1X200)。当您对该数组应用“abs(fft)”时,它会给出与结果相同大小的数组 (1X200)。那么,这是否意味着该数组包含大小?这是否意味着这些幅度的指数就是频率?比如 1、2、3、4...200?或者,如果这个假设是错误的,请告诉我如何从幅度找到频率。
From the question: How do I obtain the frequencies of each value in an FFT?
I have a similar question. I understand the answers to the previous question, but I would like further clarification on frequency. Is frequency the same as the index?
Let's go for an example: let's assume we have an array (1X200) of data in MATLAB. When you apply 'abs(fft)' for that array it gives the same size array as the result (1X200). So, does this mean this array contains magnitude? Does this mean the indices of these magnitudes are the frequencies? Like 1, 2, 3, 4...200? Or, if this assumption is wrong, please tell me how to find the frequency from the magnitude.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用 MATLAB 的 周期图 函数,它会为您处理很多事务,并且如果您提供采样率,它将正确绘制 X(频率轴)。请参阅此答案。
但为了澄清起见,FFT 的索引对应于频率,每个频率(索引)处的复数值的幅度告诉您该频率下信号的幅度。
Instead of using the FFT directly you can use MATLAB's periodogram function, which takes care of a lot of the housekeeping for you, and which will plot the X (frequency axis) correctly if you supply the sample rate. See e.g. this answer.
For clarification though, the index of the FFT corresponds to frequency, and the magnitude of the complex value at each frequency (index) tells you the amplitude of the signal at that frequency.