Mercurial > hg > emotion-detection-top-level
annotate Code/Descriptors/Matlab/Common/getSilentDataArray.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 [ silentFrames ] = getSilentDataArray( silentSegments, noOfFrames ) |
Dawn@4 | 2 |
Dawn@4 | 3 %---------------- GET THE SILENT FRAME VALUES ------------------- |
Dawn@4 | 4 % only wish to consider values from voiced frames. |
Dawn@4 | 5 % silent frames will produce data values that |
Dawn@4 | 6 % are random and therefore will bias our results |
Dawn@4 | 7 % returns an array of values where '1' indicates a non-silent frame |
Dawn@4 | 8 |
Dawn@4 | 9 silentFrames = zeros(1,noOfFrames); |
Dawn@4 | 10 [m n] = size(silentSegments); |
Dawn@4 | 11 if( silentSegments(1,1) == 0 && silentSegments(1,2) == 0 ) |
Dawn@4 | 12 % we have only one segment - the entire file |
Dawn@4 | 13 silentSegments(1,1) = 1; |
Dawn@4 | 14 silentSegments(1,2) = floor(length(x)/frameLength); |
Dawn@4 | 15 [m n] = size(silentSegments); |
Dawn@4 | 16 end |
Dawn@4 | 17 |
Dawn@4 | 18 % check for start at sample 0 |
Dawn@4 | 19 if( silentSegments(1,1) == 0) |
Dawn@4 | 20 silentSegments(1,1) = 1; |
Dawn@4 | 21 end |
Dawn@4 | 22 |
Dawn@4 | 23 for i=1:m |
Dawn@4 | 24 start = silentSegments(i,1); |
Dawn@4 | 25 stop = silentSegments(i,2); |
Dawn@4 | 26 if( stop > noOfFrames ) |
Dawn@4 | 27 stop = noOfFrames; |
Dawn@4 | 28 silentSegments(i,2) = noOfFrames; |
Dawn@4 | 29 end |
Dawn@4 | 30 |
Dawn@4 | 31 if( start == 0 ) |
Dawn@4 | 32 start = 1; |
Dawn@4 | 33 end |
Dawn@4 | 34 |
Dawn@4 | 35 |
Dawn@4 | 36 silentFrames( start : stop ) = 1; |
Dawn@4 | 37 end |
Dawn@4 | 38 |
Dawn@4 | 39 end |
Dawn@4 | 40 |