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