Incidentally the Moiré effect is produced by the reading head carrying a small piece of scale in front of the detector, but slightly skewed by a few degrees.
This produces a wide shutter that 'rotates' at right angles to the direction of travel with a width of half the height of the scale but an incidence equal to the resolution of the scale lines.
The direction of the shutter will reverse with a change in head direction.
This way lines can be read which are only µm wide.
N.