For your interest, here's the LTspice simulation of a PWM circuit using a transistor sawtooth generator with about a 250kHz frequency, along with a fast LT1720 comparator:
The Demod output is from a low-pass filter to show the demodulated PWM signal.