Home
> matlab code > locate_peaks matlab function
locate_peaks matlab function
function indices = locate_peaks(ip) %function to find peaks %a peak is any sample which is greater than its two nearest neighbours index = 1; num = 2; indices = []; for k = 1 + num : length(ip) - num seg = ip(k-num:k+num); [val, max_index] = max(seg); if max_index == num + 1 indices(index) = k; index = index + 1; end; end;
Categories: matlab code
Comments (0)
Trackbacks (0)
Leave a comment
Trackback