annotate toolboxes/MIRtoolbox1.3.2/MIRToolbox/@mirtemporal/mirtemporal.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 t = mirtemporal(orig,varargin)
wolffd@0 2 % t = mirtemporal(x) creates a temporal object from signal x.
wolffd@0 3 % Optional arguments:
wolffd@0 4 % mirtemporal(...,'Center') centers the signal x.
wolffd@0 5
wolffd@0 6 if nargin > 0 && isa(orig,'mirtemporal')
wolffd@0 7 t.centered = orig.centered;
wolffd@0 8 t.nbits = orig.nbits;
wolffd@0 9 else
wolffd@0 10 t.centered = 0;
wolffd@0 11 t.nbits = {};
wolffd@0 12 end
wolffd@0 13 t = class(t,'mirtemporal',mirdata(orig));
wolffd@0 14 if nargin == 0 || not(isa(orig,'mirtemporal'))
wolffd@0 15 t = set(t,'Title','Temporal signal','Abs','time (s)','Ord','amplitude');
wolffd@0 16 end
wolffd@0 17 if nargin>1
wolffd@0 18 for i = 1:nargin-1
wolffd@0 19 if strcmp(varargin{i},'Center')
wolffd@0 20 d = get(t,'Data');
wolffd@0 21 for h = 1:length(d)
wolffd@0 22 for k = 1:length(d{h})
wolffd@0 23 d{h}{k} = center(d{k});
wolffd@0 24 end
wolffd@0 25 end
wolffd@0 26 t = set(t,'Data',d);
wolffd@0 27 end
wolffd@0 28 end
wolffd@0 29 t = set(t,varargin{:});
wolffd@0 30 end