How does FFT work with limited data?
5 次查看(过去 30 天)
显示 更早的评论
I've collected 2000 pairs of data at the frequency of 200Hz. I hope to figure out the noise at about 50kH, since my motor works above 41kHz. So I set my sampling frequency at 100kHz ( FFT is only effective in the first half of the sampling frequency, that is 0-50kHz.) which is much greater than my experimental sampling frequency 200Hz. Does this make sense, or will Matlab do something to my data? Otherwise, can I set the simultaneous sampling frequency as large as I need?
Thanks a lot!
0 个评论
回答(1 个)
Walter Roberson
2016-6-24
You never tell fft() what the sampling frequency is. fft() is just given the data, together with the assumption that the points are equally spaced. You never tell fft() what the spacing is, because it doesn't need to know. The result of fft has its bins spaced apart according to a mathematical relationship between the original spacing, and the number of points of data. For plotting purposes or further calculation purposes you might have reason to figure out what that bin spacing is, given the original spacing. But you can't just lie to MATLAB and say the bins are a certain distance apart because that's what you want them to be.
There is one thing that you can do to end up with a particular frequency resolution: you can pad the input with zeros (or, equivalently, tell fft to use more points than are actually present, which has the same mathematical effect as padding with zeros.) But remember that if you do so you are declaring that the data went silent for a time -- whereas without padding the implicit declaration is that what you feed in is periodic. Actually, padding it with zeros (or given a larger N than there is data) is equivalent to declaring that [given signal followed by that much silence] is periodic). If you cannot justify the idea that your signal was followed by 499 times as much silence, then you cannot resolve down to the 100 kHz that you desire.
Sometimes what you need to do is just go back and collect data at a higher rate.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!