Obtain the envelop of a signal using MATLAB

偶尔善良 提交于 2019-12-01 05:27:00

You can use a Hilbert transform to get the envelope. Technically, this returns the analytic signal. You get the envelope with the following line:

envelope = abs(hilbert(Song));

What the Hilbert transform does is to take the fft of the input, zeroes out the negative frequencies, and then does an ifft. The real part of the transform is the original signal, the imaginary part is the transformed signal. The absolute value of the real and imaginary part is the envelope, and the argument (angle(hilbert(Song))) is the instantaneous phase.

I assume you want to obtain the envelope of the signal (not of its spectrum as you say). If that is the case, for envelope detection I would use a lowpass filter applied to abs(song) (you can substituye abs by a similar non-linear function). The cutoff frequency of the filter should be (slightly) above the highest frequency of the envelope variations.

You are applying the filter directly to the waveform, and the filter does not seem to be a lowpass filter. Perhaps if you explain your approach we can provide more focused help.

By the way, if your song is much longer than your filter, the zero-padding followed by fft followed by ifft seems to be a slow way of doing the filtering. Why not just use conv?

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