Arquivos
Significant-Preprocessing-M…/Data Processing/Preprocessing/pca_ica/myWhiten.m
T
Muhammad Nadzeri Munawar f7b93d844e Version 1.0
2016-02-15 03:35:56 +07:00

33 linhas
1.0 KiB
Matlab

function [Zw T] = myWhiten(Z)
%--------------------------------------------------------------------------
% Syntax: Zw = myWhiten(Z);
% [Zw T] = myWhiten(Z);
%
% Inputs: Z is an (d x n) matrix containing n samples of a
% d-dimensional random vector
%
% Outputs: Zw is the whitened version of Z
%
% T is the (d x d) whitening transformation of Z
%
% Description: This function returns the whitened (identity covariance)
% version of the input samples
%
% NOTE: Must have n >= d to fully whiten Z
%
% NOTE: Z = T \ Zcw;
%
% Author: Brian Moore
% brimoor@umich.edu
%
% Date: April 26, 2015
%--------------------------------------------------------------------------
% Compute sample covariance
R = cov(Z');
% Whiten data
[U,S,~] = svd(R,'econ');
T = U * diag(1 ./ sqrt(diag(S))) * U';
Zw = T * Z;