-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcomp_transf_Cx.m
More file actions
68 lines (63 loc) · 2.91 KB
/
Copy pathcomp_transf_Cx.m
File metadata and controls
68 lines (63 loc) · 2.91 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
function Cx = comp_transf_Cx(x, transf, win_len, fs, qerb_nbin)
%
% Cx = comp_transf_Cx(x, transf, win_len, fs, qerb_nbin);
%
% compute spatial covariance matrices for the corresponding transform
%
%
% input
% -----
%
% x : [I x nsampl] matrix containing I time-domain mixture signals
% with nsampl samples
% transf : transform
% 'stft'
% 'qerb'
% win_len : window length
% fs : (opt) sampling frequency (Hz)
% qerb_nbin : (opt) number of bins for qerb transform
%
% output
% ------
%
% Cx : [F x N x I x I] matrix containing the spatial covariance
% matrices of the input signal in all time-frequency bins
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Flexible Audio Source Separation Toolbox (FASST), Version 1.0
%
% Copyright 2011 Alexey Ozerov, Emmanuel Vincent and Frederic Bimbot
% (alexey.ozerov -at- inria.fr, emmanuel.vincent -at- inria.fr, frederic.bimbot -at- irisa.fr)
%
% This software is distributed under the terms of the GNU Public License
% version 3 (http://www.gnu.org/licenses/gpl.txt)
%
% If you use this code please cite this research report
%
% A. Ozerov, E. Vincent and F. Bimbot
% "A General Flexible Framework for the Handling of Prior Information in Audio Source Separation,"
% IEEE Transactions on Audio, Speech and Signal Processing 20(4), pp. 1118-1133 (2012).
% Available: http://hal.inria.fr/hal-00626962/
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if ~strcmp(transf, 'stft') && ~strcmp(transf, 'qerb')
error('Unknown transf');
end;
if strcmp(transf, 'stft')
X=stft_multi(x, win_len);
[F, N, I] = size(X);
Cx = zeros(F, N, I, I);
for m1=1:I
for m2=1:I
if m1 <= m2
Cx(:, :, m1, m2) = X(:, :, m1) .* conj(X(:, :, m2));
else
Cx(:, :, m1, m2) = conj(Cx(:, :, m2, m1));
end;
end;
end;
elseif strcmp(transf, 'qerb')
Cx = qerbt(x.', fs, qerb_nbin, win_len);
Cx = permute(Cx, [3 4 1 2]);
else
error('Unknown transf');
end;