forked from patrickanaylor/BSIE_toolbox
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathinit_rnmcflms.m
More file actions
48 lines (44 loc) · 1.27 KB
/
init_rnmcflms.m
File metadata and controls
48 lines (44 loc) · 1.27 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
47
48
function [h_hat, P_k] = init_rnmcflms(L, F, M, xm0, h_hat0)
% This function initializes RMCFLMS algorithm
%
% [h_hat, P_k] = init_rmcflms(L, F, M, xm0, h_hat0)
%
% Input Parameters [size]:
% L : filter length
% F : frame length
% M : number of channels
% xm0 : initial input block used to calculate P_k [F x M]
% h_hat0 : initial filter coef. matrix (unit-norm constrained) [L x M]
%
% Output parameters [size]:
% h_hat : initialized filter coef. matrix [L x M]
% P_k : initialized PSDs [F x M]
%
% Authors: E.A.P. Habets
%
% History: 2009-07-10 Initial version by E.A.P. Habets
% 2010-03-27 Fixed initialization of P_k
%
% Copyright (C) Imperial College London 2009-2010
narginchk(3,5);
if nargin > 3 && ~isempty(xm0)
if size(xm0,1) == F && size(xm0,2) == M
Xm = fft(xm0,F);
P_x = conj(Xm).*Xm;
P_k = sum(P_x,2)*ones(1,M)-P_x;
else
error('xin0 must be of size F times M.');
end
else
P_k = zeros(F,M);
end;
if nargin > 4 && ~isempty(h_hat0)
if size(h_hat0,1) == L && size(h_hat0,2) == M
h_hat = h_hat0;
else
error('h_hat0 must be of size L times M.');
end
else
% Unit-norm initialization
h_hat = [ones(1,M) ; zeros(L-1,M)]/sqrt(M);
end;