Peak finder - finding major peaks instead of just the smaller ones

9 ビュー (過去 30 日間)
Bran
Bran 2014 年 1 月 16 日
編集済み: Russ 2021 年 12 月 27 日
I want to use a peak finder to find the major peaks in my spectrum, however, when I use {pks, locs] = peakfinder()
I get all the small peaks as well. I just want the main five

回答 (2 件)

Greg Dionne
Greg Dionne 2015 年 4 月 14 日
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 件のコメント
Russ
Russ 2021 年 12 月 27 日
編集済み: Russ 2021 年 12 月 27 日
how would you do this to find the five minimum peaks?
i.e. within acceleration data, the most prominent negative peaks

サインインしてコメントする。


Azzi Abdelmalek
Azzi Abdelmalek 2014 年 1 月 16 日
minimum_peak=10 % For example
[pks,locs]=findpeaks(your_signal,'MINPEAKHEIGHT',minimum_peak)
  3 件のコメント
Azzi Abdelmalek
Azzi Abdelmalek 2014 年 1 月 16 日
You need some criterion to get rid of unwanted peaks
José-Luis
José-Luis 2014 年 1 月 16 日
You could also transform your data prior to detecting the peaks. Maybe a log transform would be enough?

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeDescriptive Statistics についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by