An algorithm for the compensation of short-period errors in optical encoders. (24th September 2015)