function s = symbols(x)
    x = reshape(x, 1, prod(size(x)));
    N=length(x);
    
    x_min = min(x);
    x_max = max(x);
    
    s = zeros(1+x_max-x_min, 2);
    
    for n=1:N
        u = x(n);
        k = u-x_min;
        s(1+k, 1) = u;
        s(1+k, 2) = s(1+k, 2) + 1;
    end
    
    idx = find(s(:,2)~=0);
    s = s(idx,:);
    
    if(nargin==0)
        figure; grid;
        stem(s(:,1), s(:,2)/sum(s(:,2)))
    end
return


% function tab = symbols(x)
%     x = reshape(x, 1, prod(size(x)));
%     N=length(x);
%     tab = [x(1), 1];
%     for n=2:N
%         p = find(tab(:,1) == x(n));
%         if(p) 
%             tab(p,2) = tab(p,2) + 1;
%         else
%             tab = [tab; [x(n), 1]];
%         end
%     end
% return