The magnetic encoder uses a series of magnetic poles to represent the encoder position to a magnetic sensor (typically magneto-resistive or Hall Effect). The magnetic sensor reads the magnetic pole positions.
Principle of output signal versus magnetic field:
These output pulses can be read by a controlling device, such as a microprocessor or microcontroller to determine the relative position of the magnetic field and thus the direction, speed and position of the rotating part.