Magnetic incremental and absolute encoders