Plot IN and ENV. The detector charges near positive peaks and discharges through RDET between peaks. Here tau=RDET*CDET=22 ms, much longer than the 100 us signal period, so ripple is small but response to level changes is slow. The diode forward drop means ENV is not an exact peak measurement; precision or active detectors are used when this error matters.
