begin code to separate encoder pulses into individual arrays