Synchronism and direction detection in high-resolution/high-density electromagnetic encoders