Borrar filtros
Borrar filtros

How to get a specified number of local maxima?

5 visualizaciones (últimos 30 días)
I have a signal and I only want the top two or three local maxima, I don't want the 5000 maxima that the findpeaks() function gives me. Is there a way to get this? Thanks.
  2 comentarios
Paolo
Paolo el 14 de Jul. de 2018
Editada: Paolo el 14 de Jul. de 2018
Have you tried specifying NPeaks? Check the documentation
Chinwe Orie
Chinwe Orie el 14 de Jul. de 2018
No I haven't. Just did, it works. Thank you!

Iniciar sesión para comentar.

Respuesta aceptada

Mohammad Mahmudul Hasan Fahome
Mohammad Mahmudul Hasan Fahome el 29 de Sept. de 2018
Editada: Mohammad Mahmudul Hasan Fahome el 30 de Sept. de 2018
You can use this function. I used this for taking top 2 frequency spectra maxima. You can find the min with the same logic.
**Update:Replace max(j) with val(j) in the function

Más respuestas (0)

Productos


Versión

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by