function ret = maxima(dh2,limit=0) ret = find(dh2> limit & dh2 > circshift(dh2,1) & dh2 > circshift(dh2,-1) ) endfunction