custom quadrature encoder implemented in software