Borrar filtros
Borrar filtros

How to identify the start and stop in a series of data

1 visualización (últimos 30 días)
Muhammad Nuradam Shah Bin Nurshahin
Comentada: Eva DI NOIA el 28 de Jun. de 2022
Hello, I am trying to determine the beginning and the end of a full movement. So I have as sensor, that I used to collect data for specific movement. If i were to plot it out, I can see 3 mountains/peaks, with a relatively stable segment in between each mountain. I would like to identify the start and stop of each mountain. How do I do so? Any algorithm to find the start and end of a movement?

Respuestas (1)

Manish Mahalwal
Manish Mahalwal el 18 de En. de 2021
Hi,
This solution may vary according to the type of data you have but by what you described this should work.
You can find the local maximas using findpeaks.
[pks,locs] = findpeaks(data)
'locs' contains the location of the local maximas that is the x-coordinate. Now you will have to use these peaks to find the local minimas which surround these peaks. For this, you can use islocalmin to find the points of local minima.
TF = islocalmin(A)
This returns a logical array whose elements are 1 (true) when a local minimum is detected in the corresponding element of an array, table, or timetable.
Now you iterate over 'locs' to find the value immediately smaller and greater using TF and A (the two local minimas surrounding the peak). The two values that you get would be the start and end of the corresponding peak.
Hope this helps.
  1 comentario
Eva DI NOIA
Eva DI NOIA el 28 de Jun. de 2022
Hello,
Can you explain your method to me? I don't know how to use "islocalmin" is for finding the minima that surround these peaks. What is "A"?
Thank you for your help

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