function [sig_sep, sig_aux]=clust(type, data, clustn)


    sig_aux = [];
    sig_sep=[ones(128,1)];
    while (size(sig_sep,1) < size(data,1))
        sig_sep=[sig_sep;sig_sep];
    end;
    
    % K-means
    if strcmp(type,'kmeans')
        [sig_sep, sig_aux] = kmeans(data, clustn, 'distance', 'city', 'replicates', 30);
    end;
    
    % Gauss mixtures
    if strcmp(type,'gauss')
        options = [];
        %options = statset('Display','final');
        try sig_aux = gmdistribution.fit(data,clustn,'Options',options,'Replicates',60,'Regularize',.00);
        catch disp('GM EM fit error.');
        end;
        try sig_sep = cluster(sig_aux,data(:,1:2));
        catch disp('GM EM cluster error.');
        end;
    end;
    
    % Hierarchical
    if strcmp(type,'hierarch')
        sig_sep = clusterdata(data,clustn);
    end;

    % Original
    if strcmp(type,'orig')
        sig_sep = [ones(8,1);2*ones(24,1)];
        while (size(sig_sep,1) < size(data,1))
            sig_sep=[sig_sep;sig_sep];
        end;
    end;
end