How to find the first local max in a discrete signal?

8 visualizaciones (últimos 30 días)
vahid torabi
vahid torabi el 18 de Ag. de 2014
Comentada: vahid torabi el 19 de Ag. de 2014
I have the .mat data in workspace.(time and magnitude) I wanted to find the first local max in signal and its related time . can anyone help me? thank you very much.

Respuesta aceptada

Adam
Adam el 18 de Ag. de 2014
If you have the signal processing toolbox you can use
findpeaks
If not then maybe something from the file exchange would work best. There are a huge number of different ones, but this seems to be the most popular and if you only want the first peak then you don't need anything too fancy:

Más respuestas (1)

vahid torabi
vahid torabi el 19 de Ag. de 2014
I've attached my.mat data. My first max value is 0.004636 but this order gives me the first figure 0.000000003904964 !!! could you plz check it on your matlab??? thank you so much sir.
  2 comentarios
Adam
Adam el 19 de Ag. de 2014
This is one of the difficulties with peak finding algorithms. If you take a look at your raw data then the first peak is in fact at an index of 3 and with the value given. The problem is that this is not what we as humans consider to be a "significant" peak, it is more an anomaly of the data that the point immediately after that one decreases slightly before increasing again significantly thereafter.
If you are using findpeaks, take a look at the Name-Value Pair Arguments from the help page. These give options that allow you to tweak the sensitivity of what counts as an actual peak.
The peakfinder from matlab exchange will have similar options (they may even be the defaults) but I haven't used that myself so I'm not sure what its parameterisations are.
vahid torabi
vahid torabi el 19 de Ag. de 2014
OK sir.Thank you very much.I admire you :)

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by