function [ silentFrames ] = getSilentDataArray( 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

