view Code/Descriptors/Matlab/MPEG7/calculate_audioPower.m @ 4:92ca03a8fa99 tip

Update to ICASSP 2013 benchmark
author Dawn Black
date Wed, 13 Feb 2013 11:02:39 +0000
parents
children
line wrap: on
line source
function AP = audioPower(s,fs,framelength,noOfFrame)
totalTime = size(s) / fs;
frameTime = totalTime/noOfFrame;
y=buffer(s,framelength);  %the frame length is 10ms
        
for i = 1:noOfFrame

    totalPower(i) = 0;
    ap(i) = 0;
    for j = 1: (framelength)
        totalPower(i) = totalPower(i) + s(j + framelength*(i-1)) * s(j + framelength*(i-1));
    end;     
end;

ap= totalPower / framelength;
b = 0:frameTime:(totalTime-frameTime);
AP = [ap' b'];