Excel中的FFT-如何获得最真实的频谱 [英] FFT in Excel -- How to Obtain the Most Realistic Spectrum

查看:905
本文介绍了Excel中的FFT-如何获得最真实的频谱的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试获取以下数据的FFT谱:gggttt.host.sk/sample.xls使用Excel. @Paul R在另一个问题中为我提供了很多帮助,以了解垃圾箱的含义,但仍有一些我想理解的问题.

I’m trying to obtain the FFT spectrum of these data: gggttt.host.sk/sample.xls using Excel. @Paul R helped me a lot in another question to figure out the meaning of bins but there are still questions which I’d like to understand.

首先,即使以对数刻度表示模量,Excel也不会以dB表示它们.如何将这些幅度转换为dB?

First, Excel, even when the moduli are represented in log scale, does not show them in dB. What do you do to have these magnitudes converted to dB?

此外,还有一个关于窗口函数,别名等的问题.由于我只处理一个周期的数据,因此似乎不需要应用窗口函数.另外,由于我只需要基波,二次谐波和三次谐波,而在更高的频率仓中则没有其他峰值,因此似乎也不需要混叠.但是,最令人担忧的是非n ^ 2的点数–1253.我尝试将零填充到2048,或者仅对前1024个点进行FFT,而忽略了剩余的229点,最后每6个点删除一次点,然后删除第52个点,最后一个点加倍,以获得必要的1024.最终,用零填充是最糟糕的方法–在整个频谱中重复出现几对高低杠.截断数据(仅处理前1024个点)似乎效果最好.我真的很想知道在信号处理方面有经验的人会推荐什么样的方法来产生最真实的频谱.

Further, there’s a concern about the window function, aliasing etc. Since I’m crunching data from exactly one period, it seems that applying a window function is not necessary. Also, because I need only the fundamental, second and third harmonic and no other peaks in the higher bins, taking care of aliasing also does not seem necessary. Of great concern, however, is the non-n^2 number of points – 1253. I tried padding them with zeros up to 2048 or doing the FFT on just the first 1024, ignoring the 229 remaining points and, finally, deleting every 6th point and then deleting every 52nd point and doubling the last point to get the necessary 1024. Ultimately, padding with zeros turned out to be the worst approach – couples of high and low bars repeat throughout the whole spectrum. Truncating the data (processing only the first 1024 points) appears to work the best. I would really like to know what someone with experience in signal processing would recommend as the best approach in producing the most realistic spectrum.

以下是我对这些数据应用FFT的两种不同方式的示例:

Here are examples of two different ways I applied the FFT on these data:

gggttt.host.sk/fig_truncated.jpg

gggttt.host.sk/fig_truncated.jpg

gggttt.host.sk/fig_padded.jpg

gggttt.host.sk/fig_padded.jpg

gggttt.host.sk/fig_every_6th_and_52nd_point_deleted.jpg

gggttt.host.sk/fig_every_6th_and_52nd_point_deleted.jpg

推荐答案

这是由Octave(MATLAB克隆)使用所有1253个数据点生成的PSD图:

Here is a PSD plot as generated by Octave (MATLAB clone) using all 1253 of your data points:

> t = load('sample.txt');
> m = mean(t)
m = -13.679
> periodogram(t,[],'onesided',1253,1e9)

如您所见,直流分量很大,非直流分量看起来就像是典型的本底噪声,没有明显的峰值.我的猜测是,如果您怀疑噪声中确实埋有峰值,则需要收集更多数据-然后,您可以使用时间平均或整体平均来提取这些峰值.

As you can see, there is a large DC component and the non-DC components just look like a typical noise floor with no obvious peaks. My guess is that you'll need to collect more data if you suspect that there really are peaks buried in the noise - you may then be able to extract these using time averaging or ensemble averaging.

这只是PSD的前十点:

Here are just the first ten points of the PSD:

> Pxx = periodogram(t,[],'onesided',1253,1e9);
> plot(10*log10(Pxx(1:10)))

这篇关于Excel中的FFT-如何获得最真实的频谱的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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