c@0
|
1 %% Example
|
c@0
|
2 %
|
c@9
|
3 %% First steps
|
c@0
|
4
|
c@0
|
5 MASSEF.install; % you only need to do this once!
|
c@0
|
6 MASSEF.start; % start MASSEF
|
c@0
|
7
|
c@9
|
8 %% Make mixtures
|
c@0
|
9 % Specify the source files:
|
c@0
|
10
|
c@0
|
11 target_fns = {'s1.wav','s2.wav'}; % target filenames
|
c@0
|
12 interferer_fns = {'s11.wav','s12.wav'}; % interferer filenames
|
c@0
|
13
|
c@0
|
14 %%
|
c@0
|
15 % Create some |iosr.bss.source| objects for targets and interferers:
|
c@0
|
16
|
c@0
|
17 t(length(target_fns),1) = iosr.bss.source;
|
c@0
|
18 i(length(interferer_fns),1) = iosr.bss.source;
|
c@0
|
19
|
c@0
|
20 %%
|
c@0
|
21 % Make sources from filenames:
|
c@0
|
22
|
c@0
|
23 for n = 1:length(target_fns)
|
c@0
|
24 t(n,1) = iosr.bss.source(target_fns{n});
|
c@0
|
25 end
|
c@0
|
26 for n = 1:length(interferer_fns)
|
c@0
|
27 i(n,1) = iosr.bss.source(interferer_fns{n});
|
c@0
|
28 end
|
c@0
|
29
|
c@0
|
30 % Specify source spatial parameters:
|
c@0
|
31
|
c@0
|
32 azimuths = [-5 5]; % target and interferer azimuths
|
c@0
|
33 tirs = [-10 0]; % target-to-interferer ratios
|
c@0
|
34 rooms = {'UniS_Room_A_BRIR_16k.sofa'}; % SOFA file for spatialisation
|
c@0
|
35
|
c@0
|
36 %%
|
c@0
|
37 % Generate the mixtures, in all combinations of the various mixture
|
c@0
|
38 % parameters, and render the mixtures to disk.
|
c@0
|
39
|
c@0
|
40 fs = 16000;
|
c@0
|
41
|
c@0
|
42 mixtures = iosr.bss.generateMixtures(t,i,...
|
c@0
|
43 'sofa_paths',rooms,...
|
c@0
|
44 'azimuths',azimuths,...
|
c@0
|
45 'tirs',tirs,...
|
c@0
|
46 'fs',fs,...
|
c@0
|
47 'cache',true,...
|
c@0
|
48 'folder','mixture_temp',...
|
c@0
|
49 'combine','all',...
|
c@0
|
50 'decomposition','gammatone',...
|
c@0
|
51 'gammatone',struct(...
|
c@0
|
52 'cfs',iosr.auditory.makeErbCFs(20,7500,32),...
|
c@0
|
53 'frame',round(0.02*fs)...
|
c@0
|
54 )...
|
c@0
|
55 );
|
c@0
|
56
|
c@9
|
57 %% Instantiate the separation algorithm
|
c@0
|
58
|
c@0
|
59 p = messl_massef(fs);
|
c@0
|
60
|
c@11
|
61 %%
|
c@11
|
62 % |messl_massef| is a wrapper class for the <https://github.com/mim/messl
|
c@11
|
63 % messl> algorithm. The class implementation is shown below.
|
c@11
|
64
|
c@0
|
65 %% Choose MASSEF options
|
c@0
|
66 % Specify the parameters of the MASSEF object:
|
c@0
|
67
|
c@0
|
68 options = struct( ...
|
c@0
|
69 'evalPEASS',false,... % don't run PEASS
|
c@0
|
70 'evalSTOI',false); % don't run STOI
|
c@0
|
71
|
c@0
|
72 %% Run MASSEF
|
c@0
|
73
|
c@0
|
74 massef = MASSEF(options);
|
c@0
|
75 massef.execute(mixtures,p);
|
c@0
|
76
|
c@0
|
77 %%
|
c@0
|
78 % Once |execute| is complete, |massef| will be saved to
|
c@0
|
79 % |Results/results.mat|. The performance data are stored in
|
c@0
|
80 % |massef.results|. The full dataset can be recalled as a |Table| object in
|
c@0
|
81 % the following way:
|
c@0
|
82
|
c@0
|
83 resultsTable = massef.results.data;
|
c@0
|
84
|
c@11
|
85 %% MESSL wrapper implementation
|
c@13
|
86 % <matlab:edit(fullfile(MASSEF.dir,'help_html','source','messl_massef.m'))
|
c@13
|
87 % Open in the MATLAB editor>.
|
c@13
|
88 %
|
c@11
|
89 % <include>messl_massef.m</include>
|
c@11
|
90 %
|
c@11
|
91 % See <help_Separators.html Separation Algorithms> for more information.
|
c@11
|
92
|
c@0
|
93 %% See also
|
c@0
|
94 % <help_MASSEF.html MASSEF>, <help_MASSEFresults.html MASSEFresults>.
|
c@0
|
95 %
|
c@0
|
96 % <html>
|
c@0
|
97 % <hr>
|
c@37
|
98 % <p>Copyright © 2017 <a href="http://www.surrey.ac.uk">University of Surrey</a><br>
|
c@0
|
99 % <a href="http://iosr.uk">Institute of Sound Recording, University of Surrey, UK</a></p>
|
c@0
|
100 % </html>
|