% z = gmm1d(x, weights, means, variances)
%
% generate values for a 1D gaussian mixture distribution
% copyright (c) 2008 by thilo stadelmann, stadelmann@informatik.uni-marburg.de

function z = gmm1d(x, dimensions, mixChecked, weights, means, variances, allvariances, ratio)
     
    T = length(x);
    M = length(means);   
    z = zeros(1, T);
       
    for m = 1:M
        if(mixChecked(m) == 1)
            c = 1 / sqrt((2*pi)^dimensions*prod(allvariances(m,:)));
            z = z + weights(m) .* c .* exp(-0.5 .* (x-repmat(means(m),1,T)).^2 ./ variances(m));
        end
    end 


