tomwalters@0: % method of class @signal tomwalters@0: % tomwalters@0: % returns the height and lows in locations and time of all local maxima in the signal tomwalters@0: % in case of continuus maxima, the last value of the series is taken tomwalters@0: % tomwalters@0: % INPUT VALUES: tomwalters@0: % tomwalters@0: % RETURN VALUE: 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 [maxpos,minpos,maxs,mins]=getminmax(sig) tomwalters@0: % usage: [maxpos,minpos,maxs,mins]=getminmax(sig) tomwalters@0: tomwalters@0: tomwalters@0: werte=getdata(sig); tomwalters@0: werte=werte'; tomwalters@0: tomwalters@0: % find all maxima tomwalters@0: % mit NULL!! tomwalters@0: maxpos = find((werte >= [0 werte(1:end-1)]) & (werte > [werte(2:end) 0])); tomwalters@0: maxs=werte(maxpos); tomwalters@0: tomwalters@0: % find all minima tomwalters@0: minpos = find((werte < [inf werte(1:end-1)]) & (werte <= [werte(2:end) inf])); tomwalters@0: mins=werte(minpos); tomwalters@0: tomwalters@0: maxpos=bin2time(sig,maxpos); tomwalters@0: minpos=bin2time(sig,minpos);