Find a peak within a pattern

4 次查看(过去 30 天)
Marc Elmeua
Marc Elmeua 2024-5-19
I have an acceleration signal that corresponds to a subject jumping repeatedly and I need to identify the landing instances. I also have a forceplate signal to validate the algorithm.
The problem I am facing is that sometimes the take-off is very similar to the landing profile. And the function gets confused:
Here's an example of what I am getting.
Does anywone know how i could identify a pattern here? or a way I could get rid of the second peak? An idea I had was to find the local minima and limit the peak prominence, because in the landing phase the signal goes form around 0 to negative values, while in the take-off deceleration phase the signal goes from positive to negative. But I don't know how to do this since matlab's default options only offer minimum (not max) peak prominence for the function islocalmin.
I hope I expressed myself in the right way...
Thanks in advance!

回答(1 个)

Star Strider
Star Strider 2024-5-19
It is not clear to me what you want to identify.
You can easily identify the starting and ending points of the force signal using the islocalmin function twice, using 'FlatSelection','first' with the first call to it, and 'FlatSelection','last' in the second call to it.
With respect to ‘the second peak’, both islocalmax and findpeaks would work similarly. Identify the peal with'MinProminence' or 'MinPeakProminence' (depending on the function you are using), and then use either 'MinSeparation' or 'MinPeakDistance' to only return the information for the first peak in a specific interval.
It would be easier to describe this (and possibly write specific code) if I know what you want and if I have your data to experiment with.
.

产品


版本

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by