tomwalters@0: % method of class @signal tomwalters@0: % tomwalters@0: % INPUT VALUES: tomwalters@0: % tomwalters@0: % RETURN VALUE: tomwalters@0: % 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=rampamplitude(sig,rt,type) tomwalters@0: tomwalters@0: if nargin < 3 tomwalters@0: type='linear'; tomwalters@0: end tomwalters@0: if nargin < 2 tomwalters@0: rt=0.01; tomwalters@0: end tomwalters@1: if rt==0 tomwalters@1: return tomwalters@1: end tomwalters@0: tomwalters@0: if strcmp(type,'linear') tomwalters@0: first_bin=1; bleeck@3: nr_point=time2bin(sig,rt); tomwalters@0: last_bin=nr_point; tomwalters@0: ramp=linspace(0,1,(last_bin-first_bin)); tomwalters@0: sig=sig*ramp; tomwalters@0: tomwalters@0: first_bin=getnrpoints(sig)-nr_point; tomwalters@0: start_time_hintere_rampe=bin2time(sig,first_bin); tomwalters@0: last_bin=time2bin(sig,getlength(sig)); tomwalters@0: damp=linspace(1,0,(last_bin-first_bin)); tomwalters@0: try tomwalters@0: sig=mult(sig,damp,start_time_hintere_rampe,rt); tomwalters@0: end tomwalters@0: p=1; tomwalters@0: end