convert Step/Dir signal from mach3 AKZ250 board (z axis or A axis ) to PWM

edgemoron:
The step pulses sent to a stepper drive is not PWM, it' a string of pulses telling the driver how often to step the motor, there is no modulation. Only thing that changes is time between (usually very short) pulses, the longer the time lag the slower the motor steps.
Now, it's different with a DC motor, the Arduino does send PWM to the H-bridge drive telling it how much voltage to apply to the motor, the higher the PWM duty cycle, the faster (usually) the motor runs.
So, maybe if your CNC thought the Z axis had a DC motor drive, it could send PWM?

this is why i need to convert the pulses signals to PWM values to control the intensity of the laser.
the idea is to use arduino to read those pulses directly or by other means of translation (maybe encoder mounted on the motor) to change directly the PWM value that arduino would generate and thus controlling the laser.

now from previous replies from Robin and Paul, the issue would be the timing of the signals coming out of the board making it complicated to handle