graphing amplitude

佐手、 提交于 2019-12-21 21:09:03

问题


I was wondering if someone could point me to a good tutorial or show me how to graph the amplitude from a byte array. The audio format I am using is: U LAW 8000.0 Hz, 8 bit, mono, 1 bytes/frame.


回答1:


It sounds like you are interested in a short term smoothed RMS amplitude measurement. Usually to do this you take a rectified version of the input signal, and then apply a low pass filter to this, e.g.

x1 = abs(x); // x2 = rectified input signal
x2 = k * x2 + (1 - k) * x1; // simple single pole low pass recursive filter

x2 is the amplitude of the signal x. k is a factor < 1.0 which determines the time constant of the smoothing filter.

You will then have some kind of threshold value which you use to decide whether you are in silence (x2 < threshold) or speech (x2 >= threshold).




回答2:


Read about Fourier transform. But it's only a part of all you need to do in order to achieve what you want.



来源:https://stackoverflow.com/questions/2448670/graphing-amplitude

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!