tomwalters@0: % method of class @signal tomwalters@0: % function sig=buildfrompoints(sig,xx,yy) tomwalters@0: % calculates a @signal from the points in x and y 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 bleeck@3: tomwalters@0: tomwalters@0: function sig=buildfrompoints(sig,xx,yy) tomwalters@0: tomwalters@0: tomwalters@0: x1=1; tomwalters@0: y1=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: x2=round(time2bin(sig,xx(i))); tomwalters@0: y2=yy(i); tomwalters@0: tomwalters@0: line=linspace(y1,y2,x2-x1+1); tomwalters@0: sig=setvalues(sig,line,x1); tomwalters@0: tomwalters@0: x1=x2+1; tomwalters@0: y1=y2; tomwalters@0: tomwalters@0: end tomwalters@0: tomwalters@0: