tomwalters@0: % tool tomwalters@0: % tomwalters@0: % INPUT VALUES: tomwalters@0: % tomwalters@0: % RETURN VALUE: tomwalters@0: % tomwalters@0: % 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 logmeasure=lin2log(value,scaleinfo) tomwalters@0: % usage: function logmeasure=lin2log(value,scaleinfo) tomwalters@0: % wandelt einen Wert entsprechend den Angaben in scaleinfo tomwalters@0: % von einem linearen in einen logarithmischen Wert um tomwalters@0: % scaleinfo.from; tomwalters@0: % scaleinfo.to; tomwalters@0: % scaleinfo.steps; tomwalters@0: % tomwalters@0: tomwalters@0: tomwalters@0: from=scaleinfo.from; tomwalters@0: to=scaleinfo.to; tomwalters@0: steps=scaleinfo.steps; tomwalters@0: tomwalters@0: tomwalters@0: if steps==1 tomwalters@0: logmeasure=(from+to)/2; tomwalters@0: logmeasure=from; tomwalters@0: return tomwalters@0: end tomwalters@0: tomwalters@0: a1=log(from); tomwalters@0: a2=log(to); tomwalters@0: st=(a2-a1)/(steps-1); tomwalters@0: tomwalters@0: res=st*value; tomwalters@0: res=exp(res); tomwalters@0: tomwalters@0: logmeasure=res*from; tomwalters@0: