tomwalters@0: % method of class @signal tomwalters@0: % function sig=buildspikesfrompoints(sig,xx,yy) tomwalters@0: % calculates a @signal from the points in x and y tomwalters@0: % the new signal is zero everywhere except from the points in xx tomwalters@0: % tomwalters@0: % INPUT VALUES: tomwalters@0: % sig: original @signal tomwalters@0: % xx: x-values of points tomwalters@0: % yy: y-values of points tomwalters@0: % tomwalters@0: % RETURN VALUE: tomwalters@0: % sig: new @signal 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 tomwalters@0: tomwalters@0: function sig=buildspikesfrompoints(sig,xx,yy) tomwalters@0: % uage: sig=buildspikesfrompoints(sig,xx,yy) tomwalters@0: % makes a dot of the hight given in yy at each point given in xx tomwalters@0: % all other values =0 tomwalters@0: tomwalters@0: tomwalters@0: sig=mute(sig); tomwalters@0: tomwalters@0: nr_points=length(xx); tomwalters@0: for i=1:nr_points tomwalters@0: oldval=gettimevalue(sig,xx(i)); tomwalters@0: newval=oldval+yy(i); tomwalters@0: sig=addtimevalue(sig,xx(i),newval); tomwalters@0: end tomwalters@0: tomwalters@0: