Mercurial > hg > emotion-detection-top-level
view Code/Descriptors/Matlab/Common/ShortTimeEnergy.m @ 2:5fd388fdd6ef
initial commit - this file allows the programmer to select which of the PRAAT generated metrics the user wishes to use for classification, and then applies the k-means classifier.
author | Dawn Black <dawn.black@eecs.qmul.ac.uk> |
---|---|
date | Mon, 10 Sep 2012 09:18:15 +0100 |
parents | ea0c737c6323 |
children |
line wrap: on
line source
function E = ShortTimeEnergy(signal, windowLength, step); signal = signal / max(max(signal)); curPos = 1; L = length(signal); numOfFrames = floor((L-windowLength)/step) + 1; %H = hamming(windowLength); E = zeros(numOfFrames,1); for (i=1:numOfFrames) window = (signal(curPos:curPos+windowLength-1)); E(i) = (1/(windowLength)) * sum(abs(window.^2)); curPos = curPos + step; end