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