bss_proj.m

来自「一种bss盲源信号分离的工具包 可以用于盲信号的提取」· M 代码 · 共 31 行

M
31
字号
function [PY_x coeff]=bss_proj(x,Y)

% compute the orthogonal projection of x on the subspace spanned by the row(s) of Y.
%
% Usage: PY_x         = proj(x,Y)
%        [PY_x coeff] = proj(x,Y)
%
% Input:
%   - x: row vector of length T,
%   - Y: vector or matrix of length T.
%
% Ouput:
%   - PY_x: row vector of length T containing the orthogonal projection of
%   x onto the range of the rows of Y.
%   - coeff : column vector with as many rows as Y containing the
%   coefficients such that PY_x = coeff.'*Y
%
% Developers:  - Cedric Fevotte (cf269@cam.ac.uk) - Emmanuel Vincent
% (vincent@ircam.fr) - Remi Gribonval (remi.gribonval@irisa.fr)

% Gram matrix of Y
G=Y*Y';

%same as coeff=inv(conj(G))*conj(Y*x');
coeff=conj(G)\conj(Y*x');
%if the Gram matrix G is not invertible then coeff=pinv(conj(G))*conj(Y*x')
%should work, but in general it is much slower than the default code

PY_x=  coeff.'*Y;

% Same as PY_x= x*pinv(Y)*Y;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?