# short time energy matlab code for audio feature extraction

Is there code in matlab for short time energy feature extraction in matlab??

I want to extract audio feature (Short time energy) using matlab code

• There is no function like that in MATLAB. In fact this not a solved problem i.e. not known clearly. – user15440 Apr 19 '15 at 8:29

Short time energy (STE) is simple feature and so is the code to compute it.

ste = sum(buffer(signal.^2, winLen));


where and winLen is duration of rectangular time window (in samples).

If you want to use diffrent shape of window, then you have to multiply each column returned by buffer by this window, before you sum the columns.

• Note that there are different definitions of short term energy. The definition used in this answer by @skywalker is also used by Rabiner and Schafer in the book Digital Speech Processing. This equation appears on page 249 (noting that rectangular window used as above): $$E(\hat{n}) = \sum\limits_{m = -\infty}^\infty (x[m]w[\hat{n}-m])^2 = \sum\limits_{m = -\infty}^\infty (x[m])^2 \tilde{w} [\hat{n}-m]$$ – Tom Anderson Sep 26 '15 at 17:40

There is code on the matlab file exchange which can do exactly what you are asking for.

http://www.mathworks.com/matlabcentral/fileexchange/23571-short-time-energy-and-zero-crossing-rate