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

조회 수: 5 (최근 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 CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by