I'm guessing you mean sawtooth wave instead of sine wave, and you're using a magnetic absolute position sensor. Perhaps something like the
MA3 from US Digital. Its output is very similar to a continuous-rotation potentiometer, but with no "dead spot".
We used one for sensing our arm position last year, so all we needed was the raw analog value. For motor speeds, we've used quadrature encoders. While I don't have any working example code to help, I think I can suggest some ways to get what you want.
Sample the analog voltage often, looking for a large transition. If it went from high to low, it's spinning one way. If it went from low to high, it's spinning the other way. Record the time when the transition occurred, and subtract it at the next transition; that will give you the period. Add to or subtract from a running counter each transition; that will give you the number of rotations.