comparison toolboxes/MIRtoolbox1.3.2/MIRToolbox/@mirdesign/mirdesign.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 function d = mirdesign(orig,argin,option,postoption,specif,type); %,nout)
2
3 if isa(orig,'mirdesign')
4 d.method = orig.method;
5 d.argin = orig.argin;
6 d.option = orig.option;
7 d.postoption = orig.postoption;
8 d.specif = orig.specif;
9 d.type = orig.type;
10 d.frame = orig.frame;
11 d.segment = orig.segment;
12 d.chunkdecomposed = orig.chunkdecomposed;
13 d.size = orig.size;
14 d.file = orig.file;
15 d.channel = orig.channel;
16 d.sampling = orig.sampling;
17 d.resampling = orig.resampling;
18 d.nochunk = orig.nochunk;
19 d.ascending = orig.ascending;
20 d.overlap = orig.overlap;
21 d.separate = orig.separate;
22 d.chunk = orig.chunk;
23 d.eval = orig.eval;
24 d.interchunk = orig.interchunk;
25 d.acrosschunks = orig.acrosschunks;
26 d.ready = orig.ready;
27 d.struct = orig.struct;
28 d.stored = orig.stored;
29 d.index = orig.index;
30 d.tmpfile = orig.tmpfile;
31 d.tmpof = orig.tmpof;
32 else
33 d.method = orig;
34 d.argin = argin;
35 d.option = option;
36 d.postoption = postoption;
37 d.specif = specif;
38 d.type = type;
39 if ischar(argin)
40 d.frame = {};
41 d.segment = {};
42 d.chunkdecomposed = 0;
43 d.size = {};
44 d.file = '';
45 d.channel = [];
46 d.sampling = 0;
47 d.resampling = 0;
48 d.nochunk = 0;
49 if not(isempty(orig)) && ...
50 strcmp(func2str(orig),'mirenvelope') && d.option.zp == 2
51 d.ascending = 0;
52 else
53 d.ascending = 1;
54 end
55 d.overlap = 0;
56 d.separate = 0;
57 else
58 if iscell(argin)
59 argin = argin{1};
60 end
61 if (strcmp(func2str(orig),'mirspectrum') && d.option.alongbands) ...
62 || (isfield(specif,'nochunk') && specif.nochunk)
63 d.frame = [];
64 if isfield(d.specif,'eachchunk')
65 d.specif = rmfield(d.specif,'eachchunk');
66 d.specif = rmfield(d.specif,'combinechunk');
67 end
68 else
69 d.frame = argin.frame;
70 if not(isempty(d.frame))
71 if isfield(d.specif,'extensive')
72 d.frame.dontchunk = 1;
73 % Some frame-decomposed extractor should not be evaluated
74 % chunk after chunk because the whole result is needed for
75 % subsequent computations.
76 elseif isfield(d.specif,'chunkframebefore')
77 d.frame.chunkbefore = 1;
78 end
79 end
80 end
81 d.segment = argin.segment;
82 d.chunkdecomposed = argin.chunkdecomposed;
83 d.size = argin.size;
84 d.file = argin.file;
85 d.channel = argin.channel;
86 d.sampling = argin.sampling;
87 d.resampling = argin.resampling;
88 if (isfield(specif,'nochunk') && specif.nochunk)
89 d.nochunk = 1; % was previously 2
90 elseif not(isempty(argin.stored))
91 % a temporary variable will be already computed.
92 d.nochunk = 2; % Flag to indicate that no chunk should be
93 % performed. Temporary variables cannot for the
94 % moment be dispatched to dependent variables
95 % chunk by chunk, but only once the whole
96 % variable has been computed.
97 else
98 d.nochunk = argin.nochunk;
99 end
100 if strcmp(func2str(orig),'mirenvelope')
101 if d.option.zp == 2
102 d.ascending = not(isempty(d.segment));
103 else
104 d.ascending = 1;
105 end
106 else
107 d.ascending = argin.ascending;
108 end
109 d.overlap = argin.overlap;
110 d.separate = argin.separate;
111 end
112 d.chunk = [];
113 d.eval = 0;
114 d.interchunk = []; % Data that can be passed between successive chunks during the main process.
115 d.acrosschunks = []; % Data that can be accumulated among chunks during the beforechunk process.
116 d.ready = 0;
117 d.struct = [];
118 d.stored = [];
119 d.index = NaN;
120 if not(isempty(orig)) && strcmp(func2str(orig),'mirenvelope') && ...
121 d.option.zp == 2 && isempty(d.segment)
122 % Triggers the use of temporary file for the mirenvelope computation
123 d.tmpfile.fid = 0;
124 else
125 d.tmpfile = [];
126 end
127 d.tmpof = [];
128 end
129 d = class(d,'mirdesign');