Zero crossings and separation of data

조회 수: 2 (최근 30일)
Adam Bryant
Adam Bryant 2020년 10월 21일
답변: Star Strider 2020년 10월 21일
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개)

카테고리

Help CenterFile Exchange에서 Signal Operations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by