拙网论坛

 找回密码
 立即注册
搜索
热搜: 活动 交友 discuz
查看: 167|回复: 1

What is the relation between FFT length and frequency resolution?

[复制链接]

949

主题

1001

帖子

3736

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
3736
发表于 2018-8-2 15:27:48 | 显示全部楼层 |阅读模式

https://electronics.stackexchange.com/questions/12407/what-is-the-relation-between-fft-length-and-frequency-resolution

The frequency resolution is dependent on the relationship between the FFT length and the sampling rate of the input signal.
If we collect 8192 samples for the FFT then we will have:

8192 samples2=4096 FFT bins8192 samples2=4096 FFT bins


If our sampling rate is 10 kHz, then the Nyquist-Shannon sampling theorem says that our signal can contain frequency content up to 5 kHz. Then, our frequency bin resolution is:

5 kHz4096 FFT bins≃1.22 Hzbin5 kHz4096 FFT bins≃1.22 Hzbin


This is may be the easier way to explain it conceptually but simplified:  your bin resolution is just <span class="MathJax" id="MathJax-Element-3-Frame" tabindex="0" data-mathml="fsampN" role="presentation" style="border: 0px; font-variant: inherit; font-stretch: inherit; line-height: normal; font-family: inherit; vertical-align: baseline; box-sizing: inherit; display: inline; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; position: relative;">fsampNfsampN, where <span class="MathJax" id="MathJax-Element-4-Frame" tabindex="0" data-mathml="fsamp" role="presentation" style="border: 0px; font-variant: inherit; font-stretch: inherit; line-height: normal; font-family: inherit; vertical-align: baseline; box-sizing: inherit; display: inline; word-spacing: normal; word-wrap: normal; white-space: nowrap; float: none; direction: ltr; max-width: none; max-height: none; min-width: 0px; min-height: 0px; position: relative;">fsampfsamp is the input signal's sampling rate and N is the number of FFT points used (sample length).
We can see from the above that to get smaller FFT bins we can either run a longer FFT (that is, take more samples at the same rate before running the FFT) or decrease our sampling rate.
The Catch:
There is always a trade-off between temporal resolution and frequency resolution.
In the example above, we need to collect 8192 samples before we can run the FFT, which when sampling at 10 kHz takes 0.82 seconds.
If we tried to get smaller FFT bins by running a longer FFT it would take even longer to collect the needed samples.
That may be OK, it may not be. The important point is that at a fixed sampling rate, increasing frequency resolution decreases temporal resolution. That is the more accurate your measurement in the frequency domain, the less accurate you can be in the time domain. You effectively lose all time information inside the FFT length.
In this example, if a 1999 Hz tone starts and stops in the first half of the 8192 sample FFT and a 2002 Hz tone plays in the second half of the window, we would see both, but they would appear to have occurred at the same time.
You also have to consider processing time. A 8192 point FFT takes some decent processing power. A way to reduce this need is to reduce the sampling rate, which is the second way to increase frequency resolution.
In your example, if you drop your sampling rate to something like 4096 Hz, then you only need a 4096 point FFT to achieve 1 Hz bins *4096 Hz, then you only need a 4096 point FFT to achieve 1hz bins and can still resolve a 2khz signal. This reduces the FFT bin size, but also reduces the bandwidth of the signal.
Ultimately with an FFT there will always be a trade off between frequency resolution and time resolution. You have to perform a bit of a balancing act to reach all goals.

回复

使用道具 举报

949

主题

1001

帖子

3736

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
3736
 楼主| 发表于 2018-8-2 15:28:04 | 显示全部楼层
with header tags and some formatting this post could go from good to great. You touched on everything I wanted to note, and very well, but the way the post is formatted fewer people will read it as its length is prohibitive, if you give headers with each section of what you are discussing people will jump to the juicy bit that suites them and your number of +1s will increase a lot. Not from me of course, as you already earned it. – Kortuk♦ Apr 1 '11 at 18:53
@kurtuk I spit this one out in a rush, I'll clean up the formatting when i have some spare time (or feel free to edit it if you wish). – Mark Apr 1 '11 at 19:19
1
@kortuk, name starts with an 'o'. I assumed you had, I was just sharing my view, both for you if you did not already know, but more for the community on the whole. – Kortuk♦ Apr 2 '11 at 15:45
1
Note that you don't have to calculate the FFT. If you only want to know a few bins, it's cheaper to calculate the DFT of just those bins, than to run an optimized FFT which calculates all the bins at once by sharing many of the operations. – Chris Stratton Jan 26 '13 at 0:10
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|抱朴守拙BBS

GMT+8, 2025-5-26 05:52 , Processed in 0.189372 second(s), 18 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表