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 width=getmaxwidth(wo,maxpos,minpos,maxs,mins) tomwalters@0: % usage: width=getmaxwidth(wo,frewomax,fremaxs,frewomin,fremins) tomwalters@0: % returns the width of the maximum tomwalters@0: % this is calculated by taking the left and the right minimum of the max tomwalters@0: tomwalters@0: [leftminwo,val]=getminimumleftof(wo,maxpos,minpos,maxs,mins); tomwalters@0: if isempty(leftminwo) tomwalters@0: % wenns keinen linkes minimum gibt, versuche, obs ein rechtes gibt tomwalters@0: [rightminwo,rightmin]=getminimumrightof(wo,maxpos,minpos,maxs,mins); tomwalters@0: if ~isempty(rightminwo) tomwalters@0: leftminwo=rightminwo; tomwalters@0: else tomwalters@0: leftminwo=0; tomwalters@0: end tomwalters@0: end tomwalters@0: tomwalters@0: [rightminwo,val]=getminimumrightof(wo,maxpos,minpos,maxs,mins); tomwalters@0: if isempty(rightminwo) tomwalters@0: rightminwo=leftminwo; tomwalters@0: end tomwalters@0: tomwalters@0: width=abs((leftminwo+rightminwo)/2); tomwalters@0: