java 音频 分析,在Java中使用FFT算法音频频谱分析

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?

解决方案

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:

apply a window function to the input data (e.g. Hann(ing))

apply FFT to windowed input data (for complex-to-complex FFT the imaginary inputs should all be zero)

calculate squared magnitude of first N / 2 FFT output bins (re * re + im * im)

convert squared magnitude to dB scale (10 * log10(squared_magnitude))

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值