LOGNMPDF calculate pdf of a multivariate lognormal distribution P=(X,M,V) Inputs: X(N,D) are the points at which to calculate the pdf (one point per row) M(D) is the mean vector of the distribution [default M = ones] V(D,D) is the covariance matrix of the distribution. If V is diagonal it may be given as a vector [default V = identity matrix] Outputs: P(N,1) is the pdf at each row of X Example: lognmpdf(linspace(0,10,1000)',2);

- pow2cep CEP2POW convert cepstral means and variances to the power domain

0001 function p=lognmpdf(x,m,v) 0002 %LOGNMPDF calculate pdf of a multivariate lognormal distribution P=(X,M,V) 0003 % 0004 % Inputs: X(N,D) are the points at which to calculate the pdf (one point per row) 0005 % M(D) is the mean vector of the distribution [default M = ones] 0006 % V(D,D) is the covariance matrix of the distribution. If V is diagonal 0007 % it may be given as a vector [default V = identity matrix] 0008 % 0009 % Outputs: P(N,1) is the pdf at each row of X 0010 % 0011 % Example: lognmpdf(linspace(0,10,1000)',2); 0012 0013 % Copyright (C) Mike Brookes 1995 0014 % Version: $Id: lognmpdf.m 713 2011-10-16 14:45:43Z dmb $ 0015 % 0016 % VOICEBOX is a MATLAB toolbox for speech processing. 0017 % Home page: http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 0018 % 0019 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0020 % This program is free software; you can redistribute it and/or modify 0021 % it under the terms of the GNU General Public License as published by 0022 % the Free Software Foundation; either version 2 of the License, or 0023 % (at your option) any later version. 0024 % 0025 % This program is distributed in the hope that it will be useful, 0026 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0027 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0028 % GNU General Public License for more details. 0029 % 0030 % You can obtain a copy of the GNU General Public License from 0031 % http://www.gnu.org/copyleft/gpl.html or by writing to 0032 % Free Software Foundation, Inc.,675 Mass Ave, Cambridge, MA 02139, USA. 0033 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 0034 0035 if nargin<3 0036 if nargin<2 0037 m=ones(1,size(x,2)); 0038 end 0039 v=eye(length(m)); 0040 end 0041 if(size(x,2)~=length(m)) | (size(x,2)~=length(v)) 0042 error('Number of columns must match mean and variance dimensions'); 0043 end 0044 [u,k]=pow2cep(m,v,'i'); % convert to log domain 0045 p=zeros(size(x,1),1); 0046 c=prod(x,2); 0047 q=c>0; 0048 p(q)=mvnpdf(log(x(q,:)),u,k)./c(q); 0049 0050 if ~nargout & (length(u)==1) 0051 plot(x,p); 0052 end

Generated on Tue 10-Oct-2017 08:30:10 by