GMMB_CMVNPDF - Compute the value of Gaussian PDF (real or complex range) Y = GMMB_CMVNPDF(X, MU, SIGMA) Computes the D-dimensional (complex) Gaussian PDF with parameters MU and SIGMA in points X(i,:) -> Y(i), i=1..N. X: N x D matrix of row vectors MU: 1 x D vector SIGMA: D x D matrix SIGMA is assumed complex conjugate symmetric and semi-positive definite. (You can use CHOL to test it, or gmmb_covfixer.) This is a dual function with different formulas whether MU is complex variable or not. NOTE: This code is not based on the Matlab(r) mvnpdf.m and so does not include the same sanity checks. Author(s): Pekka Paalanen <pekka.paalanen@lut.fi> Joni Kamarainen <Joni.Kamarainen@lut.fi> References: [1] Albertazzi, G., Cioni, S., Corazza, G.E., Vanelli-Coralli, A., Turbo Code Performance over Fading Channels in S-UMTS, Research Center on Advanced Electronic Systems for Information and Communication Technologies, University of Bologna Copyright: Bayesian Classifier with Gaussian Mixture Model Pdf is Copyright (C) 2003, 2004 by Pekka Paalanen and Joni-Kristian Kamarainen. $Name: $ $Revision: 1.2 $ $Date: 2004/11/02 09:00:18 $
0001 %GMMB_CMVNPDF - Compute the value of Gaussian PDF (real or complex range) 0002 % 0003 % Y = GMMB_CMVNPDF(X, MU, SIGMA) 0004 % Computes the D-dimensional (complex) Gaussian PDF with parameters 0005 % MU and SIGMA in points X(i,:) -> Y(i), i=1..N. 0006 % X: N x D matrix of row vectors 0007 % MU: 1 x D vector 0008 % SIGMA: D x D matrix 0009 % SIGMA is assumed complex conjugate symmetric and semi-positive definite. 0010 % (You can use CHOL to test it, or gmmb_covfixer.) 0011 % 0012 % This is a dual function with different formulas whether MU is 0013 % complex variable or not. 0014 % 0015 % NOTE: This code is not based on the Matlab(r) mvnpdf.m and so 0016 % does not include the same sanity checks. 0017 % 0018 % Author(s): 0019 % Pekka Paalanen <pekka.paalanen@lut.fi> 0020 % Joni Kamarainen <Joni.Kamarainen@lut.fi> 0021 % 0022 % References: 0023 % [1] Albertazzi, G., Cioni, S., Corazza, G.E., Vanelli-Coralli, A., 0024 % Turbo Code Performance over Fading Channels in S-UMTS, 0025 % Research Center on Advanced Electronic Systems for Information 0026 % and Communication Technologies, University of Bologna 0027 % 0028 % Copyright: 0029 % 0030 % Bayesian Classifier with Gaussian Mixture Model Pdf is 0031 % Copyright (C) 2003, 2004 by Pekka Paalanen and Joni-Kristian 0032 % Kamarainen. 0033 % 0034 % $Name: $ $Revision: 1.2 $ $Date: 2004/11/02 09:00:18 $ 0035 % 0036 0037 function y = gmmb_cmvnpdf(X, Mu, Sigma) 0038 0039 % Get size of data. 0040 [n,d] = size(X); 0041 0042 invSigma = inv(Sigma); 0043 0044 invSigmaMu = invSigma*Mu'; 0045 0046 sumvec = sum((X*invSigma).*conj(X),2); 0047 0048 sqrdist = sumvec ... 0049 - X*invSigmaMu ... 0050 - ((Mu*invSigma)*X').' ... 0051 + Mu*invSigmaMu; 0052 0053 invDetSigma = 1/real(det(Sigma)); 0054 0055 if isreal(Mu) 0056 y = sqrt( (2*pi)^(-d) * invDetSigma ) .* exp(-0.5*real(sqrdist)); 0057 else 0058 y = ( pi^(-d) * invDetSigma ) .* exp(-real(sqrdist)); 0059 end