Just to expand on that, usually the etched scale pitch is 20 microns, but digital quadrature detection gives you 4x the resolution of the scale pitch, resulting in a 5 um distance between successive rising / falling edges of the quadrature signal. Analog measurement can be used to interpolate to much finer resolution, even 1 nm for good quality optical scales with good electronics.