get_dataset.m 893 Bytes
Newer Older
Marina Kreme's avatar
Marina Kreme committed
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
function dataset = get_dataset()

% This function is used to get the data of the experiments.
%The data is stored in a structure array. 
% 
% Author: Marina KREME

wide_dir = './data/data_8000Hz_16384samples/wide_band_sources/';
loc_dir = './data/data_8000Hz_16384samples/localized_sources/';

n_wide_dir = dir([wide_dir, '*.wav']);
n_loc_dir = dir([loc_dir, '*.wav']);
dataset = struct('wideband',struct(),'localized',struct());


for x =1: length(n_wide_dir)
    
    wideband_file = [n_wide_dir(x).folder, filesep,n_wide_dir(x).name];
    wideband_name = n_wide_dir(x).name(1:end-4);
    
    dataset.wideband.(wideband_name)=wideband_file;
    
end


for x =1: length(n_loc_dir)
    
    localized_file = [n_loc_dir(x).folder, filesep,n_loc_dir(x).name];
    localized_file_name = n_loc_dir(x).name(1:end-4);
    
    dataset.localized.(localized_file_name)=localized_file; 
    
end