tomwalters@0: % method of class @signal tomwalters@0: % function sig=convolute(sig1,sig2) tomwalters@0: % tomwalters@0: % calculates the convolution between the signals sig1 and sig2. The tomwalters@0: % return value is a signal tomwalters@0: % tomwalters@0: % INPUT VALUES: tomwalters@0: % sig1: original @signal tomwalters@0: % sig2: @signal to correlate with tomwalters@0: % tomwalters@0: % RETURN VALUE: tomwalters@0: % @sig: the convolution values at each delay 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=convolute(sig1,sig2) tomwalters@0: tomwalters@0: tomwalters@0: values1=getvalues(sig1); tomwalters@0: values2=getvalues(sig2); tomwalters@0: tomwalters@0: % do the convolution tomwalters@0: sr1=getsr(sig1); tomwalters@0: sr2=getsr(sig2); tomwalters@0: tomwalters@0: if sr1~=sr2 tomwalters@0: error('sample rates of both signals must be the same!'); tomwalters@0: return tomwalters@0: end tomwalters@0: tomwalters@0: corrcovs=conv(values1,values2); tomwalters@0: tomwalters@0: % return a signal: tomwalters@0: sig=signal(corrcovs,sr1); tomwalters@0: sig=setname(sig,'Convolution'); tomwalters@0: tomwalters@0: tomwalters@0: tomwalters@0: tomwalters@0: tomwalters@0: