# How the envelope detector works?

Suppose we have an ideal diode cascaded with an RC filter , what is exactly the analytical expression of the voltage across the resistance R in terms of our initial (ac) voltage , that is : how to do a circuit analysis in the presence of the ideal diode ?

$V_{out}=V_xe^{\frac{-t}{RC}}$
$V_x$ is the voltage when the input voltage became less than the output voltage