wolffd@0: function t = mirtemporal(orig,varargin) wolffd@0: % t = mirtemporal(x) creates a temporal object from signal x. wolffd@0: % Optional arguments: wolffd@0: % mirtemporal(...,'Center') centers the signal x. wolffd@0: wolffd@0: if nargin > 0 && isa(orig,'mirtemporal') wolffd@0: t.centered = orig.centered; wolffd@0: t.nbits = orig.nbits; wolffd@0: else wolffd@0: t.centered = 0; wolffd@0: t.nbits = {}; wolffd@0: end wolffd@0: t = class(t,'mirtemporal',mirdata(orig)); wolffd@0: if nargin == 0 || not(isa(orig,'mirtemporal')) wolffd@0: t = set(t,'Title','Temporal signal','Abs','time (s)','Ord','amplitude'); wolffd@0: end wolffd@0: if nargin>1 wolffd@0: for i = 1:nargin-1 wolffd@0: if strcmp(varargin{i},'Center') wolffd@0: d = get(t,'Data'); wolffd@0: for h = 1:length(d) wolffd@0: for k = 1:length(d{h}) wolffd@0: d{h}{k} = center(d{k}); wolffd@0: end wolffd@0: end wolffd@0: t = set(t,'Data',d); wolffd@0: end wolffd@0: end wolffd@0: t = set(t,varargin{:}); wolffd@0: end