tomwalters@0: % method of class @ tomwalters@0: %function s=sum(sig,t_start,t_stop) tomwalters@0: % INPUT VALUES: tomwalters@0: % sig: @signal tomwalters@0: % t_start: start time (default: 0) tomwalters@0: % t_stop: sum until here (default: signal-length) tomwalters@0: % tomwalters@0: % RETURN VALUE: tomwalters@0: % s: sum of the signal in that region tomwalters@0: % bleeck@3: % This external file is included as part of the 'aim-mat' distribution package bleeck@3: % (c) 2011, University of Southampton bleeck@3: % Maintained by Stefan Bleeck (bleeck@gmail.com) bleeck@3: % download of current version is on the soundsoftware site: bleeck@3: % http://code.soundsoftware.ac.uk/projects/aimmat bleeck@3: % documentation and everything is on http://www.acousticscale.org bleeck@3: tomwalters@0: tomwalters@0: function s=sum(sig,t_start,t_stop) tomwalters@0: tomwalters@0: if nargin < 2 tomwalters@0: t_start=getminimumtime(sig); tomwalters@0: end tomwalters@0: if nargin < 3 tomwalters@0: t_stop=getmaximumtime(sig); tomwalters@0: end tomwalters@0: tomwalters@0: intstart=time2bin(sig,t_start)+1; tomwalters@0: intstop=time2bin(sig,t_stop); tomwalters@0: tomwalters@0: tomwalters@0: if intstart<1 tomwalters@0: intstart=1; tomwalters@0: disp('signal::sum: starttime too small'); tomwalters@0: end tomwalters@0: if intstop>getnrpoints(sig) tomwalters@0: intstop=getnrpoints(sig); tomwalters@0: disp('signal::sum: intstop too big!'); tomwalters@0: end tomwalters@0: tomwalters@0: % if intstart>intstop tomwalters@0: % error('signal::sum: stoptime < starttime'); tomwalters@0: % end tomwalters@0: tomwalters@0: tomwalters@0: s=sum(sig.werte(intstart:intstop));