High-speed rotary shaft encoders