forked from patrickanaylor/BSIE_toolbox
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathinit_mcn.m
More file actions
46 lines (42 loc) · 1.23 KB
/
Copy pathinit_mcn.m
File metadata and controls
46 lines (42 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
function [xin, h_hat, Rhat] = init_mcn(L, M, xin0, h_hat0)
% This function initializes MCLMS algorithm
%
% [xin, h_hat, Rhat] = init_mcn(L, M, xin0, h_hat0)
%
% Input Parameters [size]:
% L : filter length
% M : number of channels
% xin0 : initial input matrix [L x M]
% h_hat0 : initial filter coef. matrix (unit-norm constrained) [L x M]
%
% Output parameters [size]:
% xin : initialized input matrix [L x M]
% h_hat : initialized filter coef. matrix [L x M]
% Rhat : covariance matrix [M L x M L]
%
% Authors: E.A.P. Habets
%
% History: 2009-07-10 Initial version by E.A.P. Habets
%
% Copyright (C) Imperial College London 2009-2010
narginchk(2,4);
if nargin > 2 && ~isempty(xin0)
if size(xin0,1) == L && size(xin0,2) == M
xin = [xin0(1,:); zeros(L-1,M)];
Rhat = trace(xin0'*xin0)/L * eye(M*L);
else
error('xin0 must be of size L times M.');
end
else
xin = zeros(L,M);
Rhat = eye(M*L);
end;
if nargin > 3 && ~isempty(h_hat0)
if size(h_hat0,1) ~= L || size(h_hat0,2) ~= M
error('h_hat0 must be of size L times M.');
end
h_hat = h_hat0;
else
% Unit-norm initialization
h_hat = [ones(1,M) ; zeros(L-1,M)]/sqrt(M);
end;