Thge TI ap note is an excellent way of handling this. Basically you are
building a LPF, Integrator, and that will convert to pulse to avg DC,
with some ripple as discussed in ap note.
Note this is for a periodic waveform. If waveform aperiodic burst you
will need to allow for settling time in LPF design as another consideration.
Depending on waveform this could force you into an active design.
What is the range of pulse width you are getting and desired resolution
and accuracy you want for the DC out ?
Another ap note TI did attached.
Regards, Dana.