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