For the encoder on this motor (https://www.pololu.com/product/2282) which gives 12 counts per revolution if I just count the number of rising edges on one channel, the formula for computing the motor speed is N f (2 M_Pi)/12.0, where N is the number of counts and f is the sampling frequency. However, this seems to be off by a factor of 10. What am I doing wrong.

I know I am missing something because I am getting the max speed of the motor to be ~6000 rpm. It should be slightly under ~600 rpm.