How can I find cross axis from set of signal data

3 次查看(过去 30 天)
I have a set of signal(first graph) and I want to find the time of every peak of it, so I diff my data(second graph).
but I'm struggle to find each point of diff data crossing x-axis. since my signal can be pretty long and I cant set exact time boundaries between each y=0
appreciate every sugestions!
  4 个评论
Adam Danz
Adam Danz 2019-11-3
That's clearer.
You can find the peaks by Star Strider's suggestion. As he notes, it may take some time to find the right properties for that algorithm to work for you. The 2nd output of that function indicates the x values of the peaks. After you get that working you can list the x values of the peaks and then you can list all x values where the your line crosses from positive to negative. The indicies circled in your plot will be the first y-crossing after each peak.

请先登录,再进行评论。

采纳的回答

Star Strider
Star Strider 2019-11-3
If you want to find the peaks in your data (that looks like a photoplethysmogram signal), use the Signal Processing Toolbox findpeaks function, or the core MATLAB islocalmax (R2017b and later) function.
It is not necessary to take the numerical derivative (the best function for that is gradient, not diff).
  2 个评论
Star Strider
Star Strider 2019-11-3
My pleasure.
Both functions have name-value pair arguments that can help you distinguish the peaks you want to identify from the peaks you want to ignore. Please post back here if you have problems.

请先登录,再进行评论。

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by