Rank: 4138 based on 5 downloads (last 30 days) and 2 files submitted
photo

George Zipfel

E-mail

Personal Profile:
Professional Interests:
signal processing, technical computing

 

Watch this Author's files

 

Files Posted by George View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
20 Jul 2009 Fast array peak finder Finds locations of all maxima and corresponding maximum values in a 1D array. Author: George Zipfel time series, maxima, peak finder, array, maximum values, linear array 1 1
  • 1.0
1.0 | 1 rating
20 Jul 2009 Fast peak locator Finds peaks in 1D array Author: George Zipfel array, peak, peak locator, fast peak finder 4 0
Comments and Ratings on George's Files
Updated File Comment by Comments Rating
22 Jul 2009 Fast array peak finder Finds locations of all maxima and corresponding maximum values in a 1D array. Author: George Zipfel Rowland, Darren

Here is the file. Definitely leaves room for improvement. No H1 line, bare-bones help and no example. The use of the return variable is poor. The syntax should follow max() i.e.
maxima = zipeaks(y);
[maxima,ind] = zipeaks(y);

function peak=zipeaks(y)
%Usage: peak=zipeaks(y);
%Returns 2x(number of maxima) array
%peak(1,:) = value at maximum
%peakloc(2,:) = index value for maximum

%Find locations of local maxima
%yD=1 at maxima, yD=0 otherwise, end point maxima excluded
    N=length(y)-2;
    yD=[0 (sign(sign(y(2:N+1)-y(3:N+2))-sign(y(1:N)-y(2:N+1))-.1)+1) 0];
%Indices of maxima and corresponding values of y
    Y=logical(yD);
    I=1:length(Y);
    peak(1,:)=I(Y);
    peak(2,:)=y(Y);

Top Tags Applied by George
array, fast peak finder, linear array, maxima, maximum values
Files Tagged by George View all
Updated   File Tags Downloads
(last 30 days)
Comments Rating
20 Jul 2009 Fast array peak finder Finds locations of all maxima and corresponding maximum values in a 1D array. Author: George Zipfel time series, maxima, peak finder, array, maximum values, linear array 1 1
  • 1.0
1.0 | 1 rating
20 Jul 2009 Fast peak locator Finds peaks in 1D array Author: George Zipfel array, peak, peak locator, fast peak finder 4 0

Contact us at files@mathworks.com