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