function seg = remove_empty_in_seg( in_seg, small_time )
  
  if nargin < 1
    error( 'remove_empty_in_seg needs at least one input parameter!');
  end
  
  if isempty( in_seg )
    seg = in_seg;
    return;
  end
  
  if size( in_seg, 1 ) < 2
    error( 'remove_empty_in_seg needs size( in_seg, 1 ) >= 2' );
  end
  
  if ~exist( 'small_time', 'var' )
    small_time = 1e-10;
  end

  dur = diff( in_seg( 1:2, : ), [], 1 );
  
  ind = find( dur > small_time );
  
  seg = in_seg( :, ind );
  