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

5 visualizaciones (últimos 30 días)
Bran
Bran el 16 de En. de 2014
Editada: Russ el 27 de Dic. de 2021
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

Respuestas (2)

Greg Dionne
Greg Dionne el 14 de Abr. de 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 comentario
Russ
Russ el 27 de Dic. de 2021
Editada: Russ el 27 de Dic. de 2021
how would you do this to find the five minimum peaks?
i.e. within acceleration data, the most prominent negative peaks

Iniciar sesión para comentar.


Azzi Abdelmalek
Azzi Abdelmalek el 16 de En. de 2014
minimum_peak=10 % For example
[pks,locs]=findpeaks(your_signal,'MINPEAKHEIGHT',minimum_peak)
  3 comentarios
Azzi Abdelmalek
Azzi Abdelmalek el 16 de En. de 2014
You need some criterion to get rid of unwanted peaks
José-Luis
José-Luis el 16 de En. de 2014
You could also transform your data prior to detecting the peaks. Maybe a log transform would be enough?

Iniciar sesión para comentar.

Community Treasure Hunt

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

Start Hunting!

Translated by