Mercurial > hg > emotion-detection-top-level
comparison Code/Descriptors/Matlab/Common/ShortTimeEnergy.m @ 0:ea0c737c6323
first commit
author | Dawn Black <dawn.black@eecs.qmul.ac.uk> |
---|---|
date | Thu, 26 Jul 2012 14:46:25 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:ea0c737c6323 |
---|---|
1 function E = ShortTimeEnergy(signal, windowLength, step); | |
2 signal = signal / max(max(signal)); | |
3 curPos = 1; | |
4 L = length(signal); | |
5 numOfFrames = floor((L-windowLength)/step) + 1; | |
6 %H = hamming(windowLength); | |
7 E = zeros(numOfFrames,1); | |
8 for (i=1:numOfFrames) | |
9 window = (signal(curPos:curPos+windowLength-1)); | |
10 E(i) = (1/(windowLength)) * sum(abs(window.^2)); | |
11 curPos = curPos + step; | |
12 end |