No BSD License  

Highlights from
peakdetect.m

4.3

4.3 | 10 ratings Rate this file 24 Downloads (last 30 days) File Size: 5.96 KB File ID: #72

peakdetect.m

by Tom McMurray

 

01 Jun 2001

Generates and graphically displays the positive and negative polarity peak index vectors of input.

| Watch this File

File Information
Description

peakdetect.m generates and graphically displays the positive and negative polarity (concave down and up) peak index vectors of an input signal vector. Positive and negative polarity peaks occur at points of positive to negative and negative to positive slope adjacency, respectively. The typically rare contingencies of peaks occurring at the lagging edges of constant intervals are supported.

Example:

[p,n]=peakdetect([-1 -1 0 1 0 1 0 -1 -1])

p =

     4 6

n =

     1 5 8

MATLAB release MATLAB 6.0 (R12)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (10)
13 Sep 2001 Eric Shain

Seems to work nicely. The function plots automatically which can get in the way. Easy to disable but it requires a bit of editing.

06 Jan 2003 Ingo Wenningmann  
28 Aug 2003 Maurice Masequesmay

Great! However, this function does not find the midpoint when consecutive peaks are
exactly equal. For example it does not handle [0 0 0 0 1 1 1 1 0 0 0 0] well.
Add-on suggestion:
Given a continous plot of x & y, it would be nice if the function could interpolate a
corresponding x value for a particular peak.

18 Sep 2003 Andre Frotta Muller

Very good!!!!
Fast!!!
Thanks, Tom McMurray

04 Oct 2003 zhe wu  
09 Jul 2004 Zoltan German  
11 Jan 2005 Dániel Hillier

As Maurice Masequesmay already suggested, the function does not find the midpoint when consecutive peaks are exactly equal. It would also be better to have a separate function for min and max - both could give back the actual signal value at extrema.

18 Nov 2005 Claudia Lerma  
03 May 2006 J W

Overall this program was very similar to peaks and worked well. I would be like to be able to measure the absolute vertical distance between peaks and corresponding troughs? Is this possible?

15 Sep 2006 Bernard Simons

Daniel and JW, go and download extreme.m

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
dsp Tom McMurray 22 Oct 2008 06:31:35
peak detection Tom McMurray 22 Oct 2008 06:31:35
detect Tom McMurray 22 Oct 2008 06:31:36
signal processing Tom McMurray 22 Oct 2008 06:31:36
concavity Tom McMurray 22 Oct 2008 06:31:36
polarity Tom McMurray 22 Oct 2008 06:31:36
peak detection Weike 01 May 2009 16:51:56

Contact us at files@mathworks.com