tomwalters@0: % method of class @signal tomwalters@0: % usage: sigresult=tilt(sig,tilttime) tomwalters@0: % puts the signal upright! tomwalters@0: % in the auditory image model, all activities become tomwalters@0: % smaller with the distance tomwalters@0: % usually with a decrease of 100% in 40 ms tomwalters@0: % if you call tilt with tilt(sig,0.04), this tilt is reversed tomwalters@0: % tomwalters@0: % INPUT VALUES: tomwalters@0: % sig: original @signal tomwalters@0: % tilttime: time in seconds that the old signal is assumed to go from 100% to 0 tomwalters@0: % [default: 0.04] tomwalters@0: % tomwalters@0: % RETURN VALUE: tomwalters@0: % sigresult: @signal 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=antitilt(sig,tilttime) tomwalters@0: tomwalters@0: if nargin<2 tomwalters@0: tilttime=0.04; tomwalters@0: end tomwalters@0: tomwalters@0: vals=sig.werte; tomwalters@0: tomwalters@0: if getminimumtime(sig)>0 tomwalters@0: return tomwalters@0: end tomwalters@0: durationtotilt=abs(getminimumtime(sig)); tomwalters@0: tiltnr=time2bin(sig,0); % so viele Punkte werden getiltet tomwalters@0: dt=tilttime-durationtotilt; % übrige Zeit, die links aus dem Bild rausgeht tomwalters@0: dnull=dt/tilttime; tomwalters@0: ti=linspace(dnull,1,tiltnr)'; tomwalters@0: vals(1:tiltnr)=vals(1:tiltnr)./ti; tomwalters@0: % figure tomwalters@0: % subplot(2,1,1) tomwalters@0: % plot(sig); tomwalters@0: sig.werte=vals; tomwalters@0: % subplot(2,1,2) tomwalters@0: % plot(sig); tomwalters@0: tomwalters@0: tomwalters@0: