-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathretrieve_subsrc_params.m
More file actions
80 lines (67 loc) · 2.9 KB
/
retrieve_subsrc_params.m
File metadata and controls
80 lines (67 loc) · 2.9 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
69
70
71
72
73
74
75
76
77
78
79
80
function [Vs, As, rank_part_ind] = retrieve_subsrc_params(mix_str)
%
% [Vs, As, rank_part_ind] = retrieve_subsrc_params(mix_str);
%
% retrieve sub-sources parameters (in matrix form)
%
%
% input
% -----
%
% mix_str : input mix structure
%
%
% output
% ------
%
% Vs : [F, N, R] spectral power of sub-sources
% As : [M, F, R] mixing coefficients of sub-source vectors
% rank_part_ind : K-length array of spatial components indices rank partition
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% 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/
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[F, N, M, M] = size(mix_str.Cx);
K = length(mix_str.spat_comps);
R = 0;
rank_part_ind = cell(1, K);
% compute sum pf ranks and rank partition
for j = 1:K
spat_comp = mix_str.spat_comps{j};
rank = size(spat_comp.params, 2);
R = R + rank;
if j == 1
rank_part_ind{j} = (1:rank);
else
rank_part_ind{j} = rank_part_ind{j-1}(end) + (1:rank);
end;
end;
Vs = zeros(F, N, R);
As = zeros(M, F, R);
% fill in matrices
for j = 1:length(mix_str.spat_comps)
spat_comp = mix_str.spat_comps{j};
for r = rank_part_ind{j}
Vs(:,:,r) = comp_spat_comp_power(mix_str, j);
end
if strcmp(spat_comp.mix_type, 'inst')
for f = 1:F
As(:,f,rank_part_ind{j}) = spat_comp.params;
end;
else
As(:,:,rank_part_ind{j}) = permute(spat_comp.params, [1 3 2]);
end;
end;