Read rate of change of signal

ye,s i am getting good response from the sensors duration value.

The duration is the value from Ultrasonic sensor. I want to reverse the motor when an object is approaching in high speed towards my robot. so i will take the time of 500 milliseconds as reference time and i ll find the change in pulse value (max duration - min duration), this means an object is approaching to attack) of ultrasonic sensor for that 500 millisec, if the difference value is significantly higher i ll reverse the motor