annotate toolboxes/MIRtoolbox1.3.2/MIRToolbox/@mirdesign/mirdesign.m @ 0:cc4b1211e677 tip

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