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 个评论
回答(0 个)
另请参阅
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!