将实数和虚数FFT输出转换为频率和幅度 [英] Converting Real and Imaginary FFT output to Frequency and Amplitude

查看:423
本文介绍了将实数和虚数FFT输出转换为频率和幅度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在设计一个实时音频分析器,将其嵌入FPGA芯片中.完成的系统将读取实时音频流,并输出X个最普遍的频率的频率和振幅对.

到目前为止,我已经成功实现了FFT,但是它的当前输出只是每个窗口的实部和虚部,我想知道的是,如何将其转换为频率和幅度对? /p>

我一直在阅读FFT,我看到了如何将它们转换成幅度和相位关系,但是我需要一种不了解复杂数学知识的人可以阅读的格式!

谢谢


感谢您的快速回复!

我现在从FFT获得的输出是实对和虚对的连续流.我不确定是将它们分解成与输入数据包大小相同的数据包(64个值),然后将它们视为数组,还是单独处理.

采样率,我没有问题.当我自己配置​​FFT时,我知道它正在以50MHz的全局时钟运行.至于数组索引(如果输出当然是数组...),我不知道.

如果我们说输出是一系列包含64个复数值的一维数组:

1)如何找到数组索引[i]?

2)每个阵列会返回单个频率部分还是多个频率部分?

非常感谢您的所有帮助!没有它我会迷路的.

解决方案

FFT结果将为您提供一系列复数值.每个数组元素的大小的两倍(复数成分之和的平方根的平方根)是一个振幅.如果需要dB刻度,也可以做对数幅度.阵列索引将为您提供具有该振幅的频率槽的中心.您需要知道采样率和长度才能获得每个数组元素或bin的频率.

f[i] = i * sampleRate / fftLength

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

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

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.

解决方案

The FFT result will give you an array of complex values. The twice the magnitude (square root of sum of the complex components squared) of each array element is an amplitude. Or do a log magnitude if you want a dB scale. The array index will give you the center of the frequency bin with that amplitude. You need to know the sample rate and length to get the frequency of each array element or bin.

f[i] = i * sampleRate / fftLength

for the first half of the array (the other half is just duplicate information in the form of complex conjugates for real audio input).

The frequency of each FFT result bin may be different from any actual spectral frequencies present in the audio signal, due to windowing or so-called spectral leakage. Look up frequency estimation methods for the details.

这篇关于将实数和虚数FFT输出转换为频率和幅度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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