Calculating Time Between Binary Ticks

1 次查看(过去 30 天)
Hello,
I am trying to calculate the time between a set of binary ticks to determine the onset of an activity from data provided by a sensor.
The sensor is an optical encoder that fluctuates (or ticks) between 1's and 0's whenever the encoder rotates. My objective is to determine the time between these ticks. The binary value provided by the encoder is of no interest, but rather the rate at which it is revolving.
Here are a couple of examples that may help with my explanation.
encoderArray_Example1 = [1 0 1 0 1 1 1 0 0 0 0 1 0 0 1 1]; %These are binary states timeBetweenTicks_Example1 = [1 1 1 1 3 4 1 2 2]; %The result here is in units of time
encoderArray_Example2 = [1 1 1 0 0 0 0 1 1 0 1 0]; %These are binary states timeBetweenTicks_Example2 = [3 4 2 1 1 1]; %The result here is in units of time
Thanks!

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Grid Lines, Tick Values, and Labels 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by