Peak finder - finding major peaks instead of just the smaller ones
9 views (last 30 days)
Show older comments
Answers (2)
Greg Dionne
on 14 Apr 2015
You can do:
findpeaks(y,'NPeaks',5,'SortStr','descend')
This gets you the five with the largest amplitude. If you want the five with the largest prominence, you can do:
[pks,locs,~,prm] = findpeaks(y);
[~,i] = sort(prm,'descend');
plot(1:numel(y),y,'-',locs(i(1:5)),y(locs(i(1:5))),'o ')
1 Comment
Azzi Abdelmalek
on 16 Jan 2014
minimum_peak=10 % For example
[pks,locs]=findpeaks(your_signal,'MINPEAKHEIGHT',minimum_peak)
3 Comments
José-Luis
on 16 Jan 2014
You could also transform your data prior to detecting the peaks. Maybe a log transform would be enough?
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!