This circuit detects peak (maximum positive) values of an arbitrary input signal (green) and keep it as output (blue) for a relatively long time (far exceeding the typical period of oscillations of the input signal). For clarity output value is reset after specified period of time (20ms)