I was thinking of ways to demodulate PWM (note: Google doesn't demodulate PWM, so I haven't bothered to look for things that have done my work already).
One method that came to mind is to charge a capacitor while the input is high, and discharge it while the output is low. Before discharging, the voltage is forwarded to a sample & hold for output. Since I*dt = C*dV, this works.
But, what if frequency is changing? The above is only pulse length, not PWM, demodulation.
One option would be to demodulate the frequency as well, as an absolute value, and multiply the PLM output . I thought of dividing the input by two, to get a 50% duty cycle wave, then PLM demod it to obtain a value corresponding to duration (1/f). The value then controls the charging current for the integrator. Response, then, will be accurate every other cycle.
But geez that's complicated.
Does this difficulty have anything to do with the spectrum of a PWM signal? For sure, the key information -- DC bias -- is well below the carrier and harmonics, but purely the percent information is contained cycle-to-cycle, so long as the frequency isn't also changing very rapidly. The usual way of course is an LPF, but I want to think of ways avoiding that cumbersome time constant.
Tim