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 tomwalters@0: tomwalters@0: function sig=scaletomaxvalue(si,maxv) tomwalters@0: %usage: sig=scaleToMaxValue(si,maxv) tomwalters@0: % scales signal so, that the maximum value is maxv (usefull for saving as wav) tomwalters@0: tomwalters@0: sig=si; tomwalters@0: dat=sig.werte; tomwalters@0: ma=max(dat); tomwalters@0: mi=min(dat); tomwalters@0: if -mi > ma tomwalters@0: ma=-mi; tomwalters@0: end tomwalters@0: tomwalters@0: sig.werte(:)=sig.werte(:)*maxv/ma; tomwalters@0: