Decoding ctre mag encoder over pwm

My team is using java and are trying to decode a ctre mag encoder over pwm plugged into the rio. I am curious how to decode the signal as when we use the counter getPeriod() it returns a value between 0-.00422… while the encoder does 4096 ticks per rotation. Any information will be helpful.

If you are using Talon SRX motor controllers, you can (and should) plug the encoder directly into the Talon. If not, and you need the absolute position given by the PWM output, you should check out the PWM output specifications in the user manual and the counter semi-period mode documentation at the bottom of this screensteps page. Otherwise, you’d be better off using the quadrature outputs.