Potentiometer Controlled Motor with Feedback

I like the idea. So only when the arduino is turned on does the motor calibrate, making everything simpler. In terms of the speed of the motor it would be good to have it slow as it approaches equilibrium. The output to the fwd. or rev. inputs of the H-Bridge would have to be PWM, so how would I go about coding the output signal such that as the difference between the two pots decreased the ratio of high to low time of the pulse decreased as well (effectively slowing the speed of the motor)?