\documentclass{standalone}

\usepackage{tikz,pgfplots}
\usepackage{siunitx}
\usepackage[siunitx,european]{circuitikz}
\usepackage{mathrsfs}
\usetikzlibrary{arrows}
\usepackage{amsbsy}
\usetikzlibrary{fadings}
\usetikzlibrary{patterns}
\usetikzlibrary{automata,positioning}
\usepackage{mwe,subcaption,tikz}
\tikzset{boximg/.style={remember picture,red,thick,draw,inner sep=0pt,outer sep=0pt}}
\pgfplotsset{compat=1.11}
\begin{document}
\definecolor{mygreen}{rgb}{0,0.78,0}
\begin{tikzpicture}

\draw[<->, thick] (0,3) node[above]{$i\left(t\right)$} -- (0,-1.25) |- (5.5,0) node[right]{$t$};
\fill[pattern=north east lines, pattern color=orange!50] (0,0) rectangle(0.98,1.48);
\fill[pattern=north west lines, pattern color=orange!50] (0.98,0) -- (0.98,-1.25) -- (2.48,-0.75) -- (2.48,0);
\draw[blue, thick, dashed] (0,1.5) -- (5,1.5) node[right]{$I_{out}$};
\draw[mygreen, thick] (0,0.02) -- (1.02,0.02) -- (1.02,2.75) -- (2.52,2.25) -- (2.52,0.02) -- (3.52,0.02) -- (3.52,2.75) -- (5.02,2.25) node[right]{$i_D$};
\draw[orange, thick] (0,1.48) -- (0.98,1.48) -- (0.98,-1.25) -- (2.48,-0.75) -- (2.48,1.48) -- (3.48,1.48) -- (3.48,-1.25) -- (4.98,-0.75) node[right]{$i_{Cout}$};
\draw (1,0.1) -- (1,-0.1) node[below]{$\frac{D}{f_{sw}}$}
(2.5,0.1) -- (2.5,-0.1) node[below]{$\frac{1}{f_{sw}}$};

\end{tikzpicture}
\end{document}