20.01.2015 Views

njit-etd2003-081 - New Jersey Institute of Technology

njit-etd2003-081 - New Jersey Institute of Technology

njit-etd2003-081 - New Jersey Institute of Technology

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

300<br />

B.2.8 Cross-correlation Program<br />

The program below calculates the correlation indices for selecting the best timefrequency<br />

representation.<br />

function xy = corrcoef(x,y)<br />

%CORRCOEF Correlation coefficients.<br />

% CORRCOEF(X) is a matrix <strong>of</strong> correlation coefficients formed<br />

% from array X whose each row is an observation, and each<br />

% column is a variable.<br />

% CORRCOEF(X,Y), where X and Y are column vectors is the same as<br />

% CORRCOEF([X YD.<br />

% If C is the covariance matrix, C = COV(X), then CORRCOEF(X) is<br />

% the matrix whose (i,j)'th element is<br />

C(i,j)/SQRT(C(i,i)*C(j,j)).<br />

% See also COV, STD.<br />

% J. Little 5-5-86<br />

% Revised 6-9-88 LS 2-13-95 BJ<br />

% Copyright 1984-2001 The MathWorks, Inc.<br />

% $Revision: 5.8 $ $Date: 2001/04/15 12:01:28 $<br />

switch nargin<br />

case 1<br />

c = cov(x);<br />

case 2<br />

c = cov(x,y);<br />

otherwise<br />

error('Not enough input arguments.');<br />

end<br />

d = diag(c);<br />

xy = c./sqrt(d*d');

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!