Obtain the output signal from the circuits in the figure, explain why this signal is obtained in each half cycle of the alternating current.