Wave Upward Zero Crossing Function

조회 수: 2 (최근 30일)
WeiHua Huang
WeiHua Huang 2019년 8월 1일
답변: Ajay Pattassery 2019년 8월 5일
Hello, I downloaded the ''Wave Upward Zero Crossing Function'' file provided by the official website. I want to use crosslevel='mean' for calculation, but there is always an error message, such as an attached file. I don't know how to adjust it. I hope you can reply to me. Thanks a lot.

답변 (1개)

Ajay Pattassery
Ajay Pattassery 2019년 8월 5일
The variable len3 is defined in the following loop.
if xDetrended(1,1)==0 & xDetrended(2,1)>0
len3=1;
end
if (xDetrended(1,1)==0 & xDetrended(2,1)<0) | (xDetrended(1,1)~=0)
for i=1:N-1
if xDetrended(i,1)<0 & xDetrended(i+1,1)>0
len3=i;
break
end
end
end
If you examine the logic of the loop, the author tries to find the location where the signal rises and crosses zero. That is the author checks xDetrended (which is your signal x minus it’s mean) and find the first location where the signal rises from 0 to a positive value or from a negative value to a positive value.
So, in your case the signal is either not rising from a negative value to a positive value(there by crossing zero)or does not start from zero and rises to a positive value. Verify whether your input signal after mean adjustment holds any of these conditions.

카테고리

Help CenterFile Exchange에서 Signal Generation and Preprocessing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by