tomwalters@0: % method of class @signal tomwalters@0: % function delay(sig) tomwalters@0: % delays the signal by so many seconds. Fills the start with zeros and cuts tomwalters@0: % the end tomwalters@0: % tomwalters@0: % INPUT VALUES: tomwalters@0: % sig: original @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=delay(sig,del) tomwalters@0: tomwalters@0: sr=getsr(sig); tomwalters@0: % nr_del=del*sr; tomwalters@0: nr_del=round(del*sr); tomwalters@0: vals=getvalues(sig); tomwalters@0: nvals1=zeros(1,nr_del); tomwalters@0: nvals2=vals(1:end-nr_del); tomwalters@0: tomwalters@0: new_vals=[nvals1 nvals2']; tomwalters@0: sig=setvalues(sig,new_vals); tomwalters@0: sig=setname(sig,sprintf('%s delayed by %f sec',getname(sig),del)); tomwalters@0: tomwalters@0: