Noisy velocity measurement

Hello

I’ve been developing my own FOC drivers with custom firmware and have just gotten current control working. I’m attempting to move onto velocity control but there’s one problem.
My measured velocity is extremely noisy, I’ve gone through the effort of isolating every possible cause to the point disabling current control and running the motor in voltage control confirming that it wasn’t being caused by my current loop. Below is a graph illustrating the problem (please ignore Iq_setpointr and Iqr, they are not in use)

I have not been able to deduce what’s causing this, could I get some help please?

What encoder are you using? With a limited resolution the position won’t increment very often, resulting in jagged velocity measurements.

And are you applying any filtering on the velocity measurement?