File Exchange

image thumbnail

PeakSeek

version 1.2.0.0 (1.54 KB) by Peter O'Connor
Find peaks in vector

28 Downloads

Updated 17 Jan 2011

View License

Specify a vecter, a minimum peak separation, and a minimum peak height, and this function will find the peaks.. about 250 times faster than findpeaks would!
try:

t=linspace(0,1,10001);
x=sin(2*pi*20*t)+0.2*sin(2*pi*113*t)+.2*randn(size(t));
p=peakseek(x,10000,1);

Comments and Ratings (18)

Thank you for your file, Indeed it gives the same results as findpeaks (in my case) and it is much faster ! Great !

RU LI

peakseek is faster than findpeaks 3 times! Nice!!!

Myrtle42

Peakseek takes 0.45 s v. 11.27 s for findpeaks, using the same dataset (20716944 x 1 single). 5 stars!

Jey

mlmasmoudi

zxl333

why the number of input parameters is insufficient in my matlab?

Zhaolin Liu

Great job!Doing exactly what I expected!

Excellent job.
Very efficient and reducing the calculating time by order of magnitude compared to findpeaks function.

Mathieu

Nice job! So much faster than findpeaks. Findpeaks = 1000 lines of code, you 30 for the same results (in my case).

has same problem as findpeaks...It can't detect peaks that exist at edges of vectors. Such a vector for example is [10 9 8 7 6 5] and the only peak it has is it's first value 10,but neither peakseek nor findpeaks can't detect it

Nice work!

TideMan

Works well locating peaks in a Fourier spectrum, providing you have smoothed it enough. My only criticism is that the routine only accepts a row vector.

Updates

1.2.0.0

works for row or column vector now

MATLAB Release Compatibility
Created with R2009b
Compatible with any release
Platform Compatibility
Windows macOS Linux