function [ overlap_seg, active_channel ] = find_overlap( seg_list, small_time )
  
  if nargin < 1
    error( 'find_overlap needs one input argument !' );
  end
  
  if nargout < 1
    error( 'find_overlap needs one output argument !' );
  end

  if ~exist( 'small_time', 'var' )
    small_time = 1e-10;
  end
  
  if ~iscell( seg_list )
    error( 'find_overlap needs one CELL ARRAY of 2xN matrices as input argument !' );
  end
  
  nchannel = length( seg_list );
  
  all_empty = 1;
  
  for a = 1:nchannel
    if ~isempty( seg_list{ a } )
      all_empty = 0;
      siz = size( seg_list{ a } );
      if siz( 1 ) ~= 2
	error( 'find_overlap needs one cell array of 2xN MATRICES as input argument !' );
      end
    end
  end

  %%% Start
  
  overlap_seg = [];

  if all_empty
    qq = warning;
    if strcmp( qq( 1 ).state, 'on' )
      disp( 'find_overlap: WARNING! each "seg_list{:}" is empty -> returning empty "overlap_seg".' );
    end
    return;
  end

  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % ( 1 ) Define all candidate segments
  
  t = [];
  for a = 1:nchannel
    t = [ t seg_list{ a }(:).' ];
  end
  
  t = sort( unique( t ) );

  % "unique" is not enough to suppress duplicates
  % minor errors may appear (e.g. 1e-14)
  t = t( find( diff( [ -Inf t ] ) > small_time ) );
  
  % Sanity check
  if length( t ) < 2
    error( 'find_overlap: insanity #1 !' );
  end

  % Define segments
  seg = [ t( 1:end-1 ); t( 2:end ) ];
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % ( 2 ) Select segments with overlapped speech
  
  seg_middle = mean( seg, 1 );
  nseg = length( seg_middle );
  
  % For each segment count the number of active speakers
  
  is_active = zeros( 1, nseg );
  
  for a = 1:nseg
    
    t = seg_middle( a );
    
    for b = 1:nchannel
      
      ind = find( ( seg_list{ b }(1,:) <= t ) & ( t <= seg_list{ b }(2,:) ) );
      
      % Sanity check
      if length( ind ) > 1
	error( 'find_overlap: insanity #2!' );
      end
      
      is_active( b, a ) = ~isempty( ind );
      
    end
    
  end
  
  % overlapped speech = more than one active speakre
  
  tmp = find( sum( is_active, 1 ) > 1 );
  
  %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  % ( 3 ) Return results
  
  overlap_seg    = seg( :, tmp );
  active_channel = is_active( :, tmp );
  