📄 user_alg3.m
字号:
%function [W,He,Y] = evd( X, n, p, alpha );
function [W] = evd( X, n, p, alpha );
% EVD method for source separation
% written by Andrzej Cichocki and Pando Georgiev
% m - number of sensors
% n - number of sources
% p - number of time-delated covariance matrices
[m,N]=size(X);
if nargin == 1,
n = m; %
p = 200; % the number of time delays can be defined by user
alpha = ones(1, p);
elseif nargin == 2,
p = 5; % number of the covriance matrices
alpha = ones(1, p);
elseif nargin == 3,
alpha = ones(1, p);
end;
%X = X - mean(X')' * ones(1,N);
%%% Standard whitening
Rx0 = (X*X')/N;
% Rx0=(X(:,1:N-1)*X(:,2:N)')/(N-1); %Estimation of sample covariance matrix
%for the time delay p=1 in order to reduce influence of a white noise.
%
% Q=inv(sqrtm(Rx0));
[Ux,Dx,Vx]=svd(Rx0);
Dx=diag(Dx);
% n=11;
if n<m, % under assumption of additive white noise and
%when the number of sources are known or can a priori estimated
Dx=Dx-real((mean(Dx(n+1:m))));
Q= diag(real(sqrt(1./Dx(1:n))))*Ux(:,1:n)';
else % under assumption of no additive noise and when the
% number of sources is unknown
n=max(find(Dx>1e-14)); %Detection the number of sources
Q= diag(real(sqrt(1./Dx(1:n))))*Ux(:,1:n)';
end;
Xb=Q*X; % prewhitened data
%
%%%correlation matrices estimation
%alpha=rand(1,p)
%
Rxb=zeros(n);
% Set of paramters alpha is now random
% The user can define them, optional all should one
k=1;
for u=1:p,
k=k+1;
Rxb=Rxb+alpha(u)*Xb(:,k:N)*Xb(:,1:N-k+1)'/(N-k+1);
end;
[V,D] = eig(Rxb+Rxb');
[D1 perm]=sort(diag(D));
D1=flipud(D1);
V=V(:,flipud(perm));
%Y=V'*Xb;
%He=inv(Q)*V;
W=V'*Q;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -