How can I find cross axis from set of signal data

조회 수: 3 (최근 30일)
Tipnirin Vajanarat
Tipnirin Vajanarat 2019년 11월 3일
편집: Tipnirin Vajanarat 2019년 11월 5일
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.
Tipnirin Vajanarat
Tipnirin Vajanarat 2019년 11월 5일
편집: Tipnirin Vajanarat 2019년 11월 5일
Thank you so much! It worked!

댓글을 달려면 로그인하십시오.

채택된 답변

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
Tipnirin Vajanarat
Tipnirin Vajanarat 2019년 11월 3일
this might work. thank you so much
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개)

카테고리

Help CenterFile Exchange에서 Descriptive Statistics에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by