Pātuhitia tēnei: An optimal algorithm for estimating angular speed using incremental encoders