Zero crossings and separation of data
1 view (last 30 days)
Show older comments
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.
Accepted Answer
Star Strider
on 21 Oct 2020
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 Comments
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!