VB FFT - 结果频率卡住理解的关系 [英] VB FFT - stuck understanding relationship of results to frequency

查看:134
本文介绍了VB FFT - 结果频率卡住理解的关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

试图了解FFT(快速傅立叶变换)我使用程序(偷)(再利用)

Trying to understand an fft (Fast Fourier Transform) routine I'm using (stealing)(recycling)

输入是这是一个样本波形512的数据点阵列。
测试数据生成到这个数组。 FFT变换数组到频域。
试图了解在FFT阵列频率,周期,采样率和位置之间的关系。我会用例子说明:

Input is an array of 512 data points which are a sample waveform. Test data is generated into this array. fft transforms this array into frequency domain. Trying to understand relationship between freq, period, sample rate and position in fft array. I'll illustrate with examples:

========================================

========================================

采样率是1000个样本/秒。
产生10Hz时的一组样品。

Sample rate is 1000 samples/s. Generate a set of samples at 10Hz.

输入阵列具有ARR(28)峰值,编曲(128),编曲(228)...
周期= 100样本点

Input array has peak values at arr(28), arr(128), arr(228) ... period = 100 sample points

在FFT阵列峰值是在指数6(不含0一巨大的价值)

peak value in fft array is at index 6 (excluding a huge value at 0)

========================================

========================================

采样率为8000样本/秒
在生成设置440Hz的样本

Sample rate is 8000 samples/s Generate set of samples at 440Hz

输入数组峰值包括ARR(7),编曲(25),编曲(43),编曲(61)...
周期= 18样本点

Input array peak values include arr(7), arr(25), arr(43), arr(61) ... period = 18 sample points

在FFT阵列峰值是在29指数(不包括0一巨大的价值)

peak value in fft array is at index 29 (excluding a huge value at 0)

========================================

========================================

我如何关联的高峰期指数的FFT阵列频率?

How do I relate the index of the peak in the fft array to frequency ?

推荐答案

如果你忽略虚部,频率分布横跨箱线性的:

If you ignore the imaginary part, the frequency distribution is linear across bins:

频率@ I =(采样率/ 2)×(I / Nbins)。

Frequency@i = (Sampling rate/2)*(i/Nbins).

因此​​,对于第一个例子,assumming你有256箱,最大区段对应于1000/2 *256分之6= 11.7赫兹的频率。
由于您的输入是10Hz的,我猜斌5(9.7Hz)也有一个很大的组成部分。
为了获得更好的精确度,你需要采取更多的样本,变小箱。

So for your first example, assumming you had 256 bins, the largest bin corresponds to a frequency of 1000/2 * 6/256 = 11.7 Hz. Since your input was 10Hz, I'd guess that bin 5 (9.7Hz) also had a big component. To get better accuracy, you need to take more samples, to get smaller bins.

您第二个例子给二分之八千*256分之29= 453Hz。此外,接近,但你需要更多的垃圾箱。
在这里你的分辨率只有二百五十六分之四千= 15.6Hz。

Your second example gives 8000/2*29/256 = 453Hz. Again, close, but you need more bins. Your resolution here is only 4000/256 = 15.6Hz.

这篇关于VB FFT - 结果频率卡住理解的关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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