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