 In the positive cycle of the input AC signal, the diode is forward biased and conducts, charging the capacitor to the peak positive value of VIN.During the negative cycle, the diode is reverse biased and thus does not conduct.The output voltage is therefore equal to the voltage stored in the capacitor plus the input voltage again, so VOUT = VIN − VINpeak.