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 [lsig,scaleinfo]=logsigx(sig,tmin,tmax,nr_points) tomwalters@0: % usage: [lsig,scaler]=logsigx(sig,tmin,tmax,nr_points) tomwalters@0: % transferes the signal to a signal that is in logarithmic scale tomwalters@0: % so plotting the original signal logarithmic is identical to tomwalters@0: % plot the transfered signal linear tomwalters@0: % uses only the part of the signal between tmin and tmax tomwalters@0: % tomwalters@0: % reverse operation: linsigx(sig,tmin,tmax,nr_points) tomwalters@0: tomwalters@0: tomwalters@0: if nargin < 4 tomwalters@0: nr_points=getnrpoints(sig); tomwalters@0: end tomwalters@0: if nargin<3 tomwalters@0: tmax=getmaximumtime(sig); tomwalters@0: end tomwalters@0: if nargin<2 tomwalters@0: tmin=getminimumtime(sig); tomwalters@0: end tomwalters@0: if tmin==0 tomwalters@0: tmin=1/getsr(sig); tomwalters@0: end tomwalters@0: tomwalters@0: tomwalters@0: oldvals=getvalues(sig); tomwalters@0: newvals=zeros(nr_points,1); tomwalters@0: tomwalters@0: tomwalters@0: [ntimes,scaleinfo]=distributelogarithmic(tmin,tmax,nr_points); tomwalters@0: newvals=gettimevalue(sig,ntimes); tomwalters@0: if isnan(newvals(1)) tomwalters@0: newvals(1)=0; tomwalters@0: end tomwalters@0: tomwalters@0: lsig=sig; % copy all values tomwalters@0: lsig=setvalues(lsig,newvals,1); tomwalters@0: tomwalters@0: lsig=setnrxticks(lsig,6); tomwalters@0: l=distributelogarithmic(tmin,tmax,6); tomwalters@0: tomwalters@0: l=round(l*10000)/10; tomwalters@0: tomwalters@0: lsig=setxlabels(lsig,l); tomwalters@0: