什么是网络音频API的FFT数据对应? [英] What does the FFT data in the Web Audio API correspond to?

查看:283
本文介绍了什么是网络音频API的FFT数据对应?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用从分析仪节点使用 getByteFrequencyData 方法通过Web Audio API来创建频谱可视化FFT数据如下图所示:

I've used the FFT data from the Analyser node using the getByteFrequencyData method in the Web Audio API to create a spectrum visualizer as shown below:

在这种情况下我有数据的256箱。究竟是什么在这个对应的号码?是各频率分量的分贝水平。如果是的话我怎么知道每个仓的频率值对应?

In this instance I have 256 bins of data. What exactly do the numbers in this correspond to? Is it the decibel level of each frequency component. If so how do I know what the value of the frequency of each bin corresponds to?

我想知道这样我就可以建立一个图形均衡器试验等想知道在哪点来表示滤波器频段。理想情况下,我想从20Hz重新present频率相应的为20kHz之间和情节的时间间隔。

I would like to know so I can experiment in building a graphic eq and so would like to know at which points to indicate the filter bands. Ideally I'd like to represent frequencies from 20Hz to 20kHz and plot intervals between those accordingly.

感谢您的帮助。

推荐答案

getByteFrequencyData 的结果值在0和255之间的归一化数组。
(这将数据复制到它被传入的数组)。

yes,getByteFrequencyData results in a normalized array of values between 0 and 255. (it copies the data to the array it gets passed-in).

该频段平均分配,所以阵列中的每个元素N对应为:

the frequency bands are split equally, so each element N of your array corresponds to:

N * samplerate/fftSize

因此​​,第一仓为0结果
并且,假设一个44100采样率和< analyzerNode> .fftSize 512第二个是:86.13赫兹,等等...

so, the first bin is 0.
and, assuming a samplerate of 44100 and a <analyzerNode>.fftSize of 512 the second would be: 86.13 Hz, and so on...

你会发现这两个问题和有用的答案,在 DSP 和< A HREF =htt​​p://stackoverflow.com/questions/4364823/how-to-get-frequency-from-fft-result> SO :

you will find these two questions and answers useful, on dsp and on SO:

请注意您的sampleData的长度是成功的一半&LT; analyzerNode方式&gt; .fftSize ,有效地限制了频率范围的一半,采样率

Note that the length of your sampledata is half the <analyzerNode>.fftSize, effectively limiting the frequency-range to half the samplerate.

这篇关于什么是网络音频API的FFT数据对应?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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