Java中使用FFT算法进行音频频谱分析
我想用 Java (ME) 分析音频文件的频谱。我想像一些媒体播放器那样绘制频谱。但我不明白一些要点:
- FFT 算法的输入,我必须从音频文件中获取。我现在不知道它叫什么,它是什么,更重要的是,我不知道如何得到它。
- 输出:如果输入是一个数组(范围?)我获得其他数组,并且它的范围:0-1,对(或不是)?那么我与它有什么关系呢?
I want to analyze the spectrum of an audio file in Java (ME). I want to draw spectrum as some media players do. But I don't understand some points:
- Input for FFT algorithm, which I have to get from the audio file. I don't now what it is called, what it is and more important, I don't know how to get it.
- Output: if input is an array (range?) I obtain other array, and it have range: 0-1, right (or not)? So what I have to do with it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
除了 FFT 之外,您还需要一些额外的步骤。这在之前的类似问题中已经被多次提及,您可以通过搜索“dsp”、“fft”、“spectrum”、“spectrogram”等找到其他材料,但本质上您需要执行以下操作:
N / 2
FFT输出箱的平方幅度(re * re + im * im
)10 * log10(squared_magnitude)
)You need a few additional steps in addition to the FFT. This has been covered many times already in previous similar questions here on SO, and you can find additional material by searching for "dsp", "fft", "spectrum", "spectrogram", etc, but essentially you need to do the following:
N / 2
FFT output bins (re * re + im * im
)10 * log10(squared_magnitude)
)