Zero crossings and separation of data

1 次查看(过去 30 天)
I am currently trying to write a code that will divide each iteration of a set data that only comprises of voltage values up into separate figures/entities after the last zero crossing of each iteration as well as record the first zero crossing of each. Within the provided figure (picture), one iteration is highlighted in red. Currently the data is only 10 iterations of an experiment, but I eventually want to record over 100 iterations and process the data through a MATLAB code. Any and all help is appreciated. Thank you.
  1 个评论
Rik
Rik 2020-10-21
What did you try already? Have a read here and here. It will greatly improve your chances of getting an answer.

请先登录,再进行评论。

采纳的回答

Star Strider
Star Strider 2020-10-21
Use the envelope function to define the ‘outline’ of the upper portion of the signal (and the lower portion if you want that), then use:
zci = @(v) find(diff(sign(v)));
with ‘v’ being the envelope vector to define the indices of the zero-crossings:
env = envelope(yourSignal);
zxidx = zci(env);
then take it from there.

更多回答(0 个)

Community Treasure Hunt

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

Start Hunting!

Translated by