Mercurial > hg > emotion-detection-top-level
view Code/Descriptors/Matlab/Common/removeSilentData.m @ 0:ea0c737c6323
first commit
author | Dawn Black <dawn.black@eecs.qmul.ac.uk> |
---|---|
date | Thu, 26 Jul 2012 14:46:25 +0100 |
parents | |
children |
line wrap: on
line source
function [ silentFrames ] = removeSilentData( silentSegments, noOfFrames ) %---------------- GET THE SILENT FRAME VALUES ------------------- % only wish to consider values from voiced frames. % silent frames will produce data values that % are random and therefore will bias our results % returns an array of values where '1' indicates a non-silent frame silentFrames = zeros(1,noOfFrames); [m n] = size(silentSegments); if( silentSegments(1,1) == 0 && silentSegments(1,2) == 0 ) % we have only one segment - the entire file silentSegments(1,1) = 1; silentSegments(1,2) = floor(length(x)/frameLength); [m n] = size(silentSegments); end % check for start at sample 0 if( silentSegments(1,1) == 0) silentSegments(1,1) = 1; end for i=1:m start = silentSegments(i,1); stop = silentSegments(i,2); if( stop > noOfFrames ) stop = noOfFrames; silentSegments(i,2) = noOfFrames; end if( start == 0 ) start = 1; end silentFrames( start : stop ) = 1; end end