comparison toolboxes/MIRtoolbox1.3.2/MIRToolbox/@mirtemporal/mirtemporal.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
comparison
equal deleted inserted replaced
-1:000000000000 0:cc4b1211e677
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