An optical encoder includes an encoder pattern having (i) an A/B pattern of first areas and second areas alternating in a first direction, wherein the first areas have a different optical transmissivity or reflectivity than the second areas, and (ii) an index pattern disposed adjacent the A/B pattern in the first direction.