annotate 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
rev   line source
Dawn@4 1 function AP = audioPower(s,fs,framelength,noOfFrame)
Dawn@4 2 totalTime = size(s) / fs;
Dawn@4 3 frameTime = totalTime/noOfFrame;
Dawn@4 4 y=buffer(s,framelength); %the frame length is 10ms
Dawn@4 5
Dawn@4 6 for i = 1:noOfFrame
Dawn@4 7
Dawn@4 8 totalPower(i) = 0;
Dawn@4 9 ap(i) = 0;
Dawn@4 10 for j = 1: (framelength)
Dawn@4 11 totalPower(i) = totalPower(i) + s(j + framelength*(i-1)) * s(j + framelength*(i-1));
Dawn@4 12 end;
Dawn@4 13 end;
Dawn@4 14
Dawn@4 15 ap= totalPower / framelength;
Dawn@4 16 b = 0:frameTime:(totalTime-frameTime);
Dawn@4 17 AP = [ap' b'];