\documentclass[border=4pt]{standalone}
\usepackage{ga}
\input{../ee1.tikz}
\begin{document}
\begin{circuitikz}
\draw (0,0) to[american voltage source, l=$V_\mathrm{in}$, invert] (0,1.6) to[empty diode] (1.6,1.6) -- (2.6,1.6) node[ocirc]{};
\draw (1.6,1.6) node[circ]{} to[C, l=$C_1$] (1.6,0) node[circ]{};
\draw (0,0) -- (2.6,0) node[ocirc]{};
\draw (2.6,1.3) node[font=\small]{$+$} (2.6,0.3) node[font=\small]{$-$};
\node at (3.2,0.8) {$V_\mathrm{out}$};
% V_in = sin, V_D,on = 0.15: V_out tracks V_in - V_D,on to the peak, then holds
\begin{axis}[sketch, at={(4.4cm,-1.1cm)}, width=6cm, height=4.4cm, xmin=0, xmax=1.4, ymin=-1.2, ymax=1.3, xlabel={$t$}, ytick={1}, yticklabels={$V_0$}]
  \addplot[black, line width=0.8pt, domain=0:1.3, samples=200] {sin(deg(2*pi*x))};
  \addplot[line width=1.4pt, domain=0:1.3, samples=300] {x<0.024 ? 0 : (x<0.25 ? sin(deg(2*pi*x))-0.15 : 0.85)};
  \draw[<->, gaaccent] (axis cs:0.25,0.99) -- (axis cs:0.25,0.86) node[pos=0, above right, font=\small]{$V_\mathrm{D,on}$};
  \node[font=\small, anchor=west] at (axis cs:0.45,0.3) {$V_\mathrm{in}$};
  \node[font=\small, anchor=west] at (axis cs:0.12,0.3) {$V_\mathrm{out}$};
\end{axis}
\end{circuitikz}
\end{document}
