- Wed Jun 02, 2021 10:11 pm
#50777
The principle of the code is it matches the pattern seen to a binary version of the pattern. Eg an 8-1 pattern is really 1111110 (1 is a tooth, 0 is a gap) so if I tell the system to move all the teeth it's previously seen to the left, then add the tooth just seen you build up the pattern. You then just do a pattern match. The idea got expanded from hard coding the pattern to look for to passing the value from tuner studio.
Eg in the above example of you start half way through the pattern the system would build up the number as follows.
1
11
1101 (you don't see a gap, you see the tooth after the gap but identify it arrived late so their must be a gap so you move 2 teeth not 1)
11011
110111
1101111
1101111 (next tooth seen will have to drop the oldest tooth to make space)
10111111 (moved all the bits left to make space for new bit)
0111111
1111101 (you'd have this value as the value you look for when looking for a rotation, remember when you have a gap you see the tooth after the gap not the actual gap, hence 2 teeth moved)
Eg in the above example of you start half way through the pattern the system would build up the number as follows.
1
11
1101 (you don't see a gap, you see the tooth after the gap but identify it arrived late so their must be a gap so you move 2 teeth not 1)
11011
110111
1101111
1101111 (next tooth seen will have to drop the oldest tooth to make space)
10111111 (moved all the bits left to make space for new bit)
0111111
1111101 (you'd have this value as the value you look for when looking for a rotation, remember when you have a gap you see the tooth after the gap not the actual gap, hence 2 teeth moved)