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 ret=getmaximacharacteristics(where,maxpos,minpos,maxs,mins) tomwalters@0: % gibt die wesentlichen Eigenschaften der Maxima zurück: tomwalters@0: % absoulte_height tomwalters@0: % position = position of the maximum tomwalters@0: % distance = mean distance to neighbour mins tomwalters@0: % contrast = peak to trough ration of max to neighbour mins tomwalters@0: % supheight = height above the neighbour peaks tomwalters@0: tomwalters@0: nr=length(where); tomwalters@0: for i=1:nr tomwalters@0: [minleft,minleftwo]=getminimumleftof(where(i),maxpos,minpos,maxs,mins); tomwalters@0: [minright,minrightwo]=getminimumrightof(where(i),maxpos,minpos,maxs,mins); tomwalters@0: [maxleft,maxleftwo]=getmaximumleftof(where(i),maxpos,minpos,maxs,mins); tomwalters@0: [maxright,maxrightwo]=getmaximumrightof(where(i),maxpos,minpos,maxs,mins); tomwalters@0: tomwalters@0: current_val=maxs(find(maxpos==where(i))); tomwalters@0: ret{i}.absheight=current_val; tomwalters@0: tomwalters@0: ret{i}.position=where(i); tomwalters@0: tomwalters@0: ret{i}.contrast=getmaxcontrast(where(i),maxpos,minpos,maxs,mins); tomwalters@0: ret{i}.width=getmaxwidth(where(i),maxpos,minpos,maxs,mins); tomwalters@0: tomwalters@0: if ~isempty(minleft) & ~isempty(minright) tomwalters@0: ret{i}.distance=(abs(minrightwo) - abs(minleftwo))/2; % Mittelwert der Abstände zu den nächsten beiden peaks tomwalters@0: end tomwalters@0: if isempty(minleft) tomwalters@0: ret{i}.distance=abs(minrightwo); tomwalters@0: end tomwalters@0: if isempty(minright) tomwalters@0: ret{i}.distance=abs(minleftwo); tomwalters@0: end tomwalters@0: tomwalters@0: if ~isempty(maxleft) & ~isempty(maxright) tomwalters@0: ret{i}.supheight=current_val/(maxleft+maxright)/2; tomwalters@0: end tomwalters@0: tomwalters@0: if isempty(maxleft) tomwalters@0: if isempty(maxright) tomwalters@0: ret{i}.supheight=0; tomwalters@0: else tomwalters@0: ret{i}.supheight=current_val/maxright; tomwalters@0: end tomwalters@0: end tomwalters@0: tomwalters@0: if isempty(maxleft) tomwalters@0: if isempty(maxright) tomwalters@0: ret{i}.supheight=0; tomwalters@0: else tomwalters@0: ret{i}.supheight=current_val/maxright; tomwalters@0: end tomwalters@0: end tomwalters@0: end