2

I'm designing a real time Audio Analyser to be embedded on a FPGA chip. The finished system will read in a live audio stream and output frequency and amplitude pairs for the X most prevalent frequencies.

I've managed to implement the FFT so far, but it's current output is just the real and imaginary parts for each window, and what I want to know is, how do I convert this into the frequency and amplitude pairs?

I've been doing some reading on the FFT, and I see how they can be turned into a magnitude and phase relationship but I need a format that someone without a knowledge of complex mathematics could read!

Thanks


Thanks for these quick responses!

The output from the FFT I'm getting at the moment is a continuous stream of real and imaginary pairs. I'm not sure whether to break these up into packets of the same size as my input packets (64 values), and treat them as an array, or deal with them individually.

The sample rate, I have no problem with. As I configured the FFT myself, I know that it's running off the global clock of 50MHz. As for the Array Index (if the output is an array of course...), I have no idea.

If we say that the output is a series of One-Dimensional arrays of 64 complex values:

1) How do I find the array index [i]?

2) Will each array return a single frequency part, or a number of them?

Thankyou so much for all your help! I'd be lost without it.

4

2 回答 2

5

好吧,坏消息是,没有办法理解复数。好消息是,仅仅因为它们被称为复数并不意味着它们是复杂的。 所以首先,查看维基百科页面,对于音频应用程序,我会说,阅读到第 3.2 节,可能会跳过关于平方根的部分: http ://en.wikipedia.org/wiki/Complex_number

这告诉你的是,如果你有一个复数a + bi,你可以把它想象成生活在位置 (a,b) 的 x,y 平面上。要获得幅度和相位,您所要做的就是找到两个量:

  • 到平面原点的距离,即幅度,和
  • 与 x 轴的角度,即相位

幅度很简单:sqrt(a^2 + b^2)。

该阶段同样简单:atan2(b,a)。

于 2012-02-26T16:39:41.967 回答
3

FFT 结果将为您提供一个复数值数组。每个阵列元素的幅度的两倍(复分量平方和的平方根)是幅度。或者,如果您想要一个 dB 刻度,请执行对数幅度。数组索引将为您提供具有该幅度的频率仓的中心。您需要知道采样率和长度才能获得每个数组元素或 bin 的频率。

f[i] = i * sampleRate / fftLength

对于数组的前半部分(另一半只是用于真实音频输入的复共轭形式的重复信息)。

由于加窗或所谓的频谱泄漏,每个 FFT 结果箱的频率可能与音频信号中存在的任何实际频谱频率不同。查找频率估计方法以获取详细信息。

于 2012-02-27T02:13:24.330 回答