comparison core/magnatagatune/MTTRandomFeature.m @ 0:e9a9cd732c1e tip

first hg version after svn
author wolffd
date Tue, 10 Feb 2015 15:05:51 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:e9a9cd732c1e
1 % --
2 % This class loads and hanles the aufdio features included with the MTT
3 % Library
4 % ---
5 classdef MTTRandomFeature < MTTAudioFeature & handle
6
7 properties(Constant = true)
8
9 my_revision = str2double(substr('$Rev: 167 $', 5, -1));
10 end
11
12 properties
13
14 % ---
15 % Set default parameters
16 % ---
17 my_params = struct(...
18 'nrandoms', 100 ...
19 );
20 end
21 % ---
22 % member functions
23 % ---
24 methods
25
26 % ---
27 % constructor: pointer to feature in database
28 % ---
29 function feature = MTTRandomFeature(varargin)
30
31 feature = feature@MTTAudioFeature(varargin{:});
32 end
33
34 % ---
35 % load feature data from xml file
36 % ---
37 function data = extract(feature, clip)
38 % load feature data by parsing xml
39
40 global globalvars;
41
42 % fprintf('parsing features for clip %d \n',clip.id());
43
44 % parse feature
45 data.random = rand(feature.my_params.nrandoms, 1);
46
47 % save info data
48 data.info.type = 'MTTRandomFeature';
49 data.info.owner_id = clip.id;
50 data.info.creatorrev = feature.my_revision;
51
52 % save param data
53 data.info.params = feature.my_params;
54
55 % prepare field for final features
56 data.final.vector = data.random;
57 data.final.dim = numel(data.final.vector);
58
59 info = {'random'};
60 info(2:data.final.dim) = num2cell(2:data.final.dim);
61 data.final.vector_info.labels = info;
62 end
63
64 function visualise(feature)
65 % ---
66 % plots the different data types collected in this feature
67 % ---
68
69 end
70 end
71 end