Variable frequency PWM signal

You do not say what stepper driver that you are using. The drivers that I am familiar with (A4988, DRV8825) step on the positive going edge. That means that the pulse only needs to remain HIGH for a us or so (consult data sheet). Then only the time that the pulse is LOW controls the speed. That will increase the speed range and, perhaps, make it easier to calculate the time between steps.

Reference Robin2's simple stepper program.

Can you put a number to that?