Wave Upward Zero Crossing Function
1 view (last 30 days)
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.
Ajay Pattassery on 5 Aug 2019
The variable len3 is defined in the following loop.
if xDetrended(1,1)==0 & xDetrended(2,1)>0
if (xDetrended(1,1)==0 & xDetrended(2,1)<0) | (xDetrended(1,1)~=0)
if xDetrended(i,1)<0 & xDetrended(i+1,1)>0
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.