We'll analyze the charge present in a capacitor under the influence of a square wave with symmetric semi-period and positive average value. The step function takes the values:
The charge function $q(t)$ during charging (when voltage = $E$) is:
$$q(t) = \text{E}\text{C} + (q_{in} - \text{E}\text{C}) \ e^{\frac{-t}{\tau}}$$
During discharge (when voltage = 0):
$$q(t) = q_{in} \ e^{\frac{-t}{\tau}}$$
where:
From $q_{2n}$ to $q_{2n+1}$, we can express:
$$q_{2n+1} = E C + (q_{2n} - E C) e^{\frac{-T}{2 \tau}} = E C (1 - e^{\frac{-T}{2 \tau}})+ q_{2n} e^{\frac{-T}{2 \tau}}$$
where:
For $q_{2n+2}$:
$$q_{2n+2} = q_{2n+1} e^{\frac{-T}{2\tau}} = \alpha q_{2n+1}$$
The geometric series converges to:
For odd-numbered steps:
$$\lim_{n\rightarrow \infty}q_{2n+1}=\frac{EC}{1+\alpha}$$
For even-numbered steps:
$$\lim_{n\rightarrow \infty}q_{2n}=\frac{EC\alpha}{1+\alpha}$$
The capacitor has sufficient time to fully charge and discharge.
The circuit acts as a low-pass filter, averaging the input voltage.