\def\L{64} % window length
\begin{tikzpicture}
\begin{axis}[
	name=plot1,
	axis x line=bottom, axis y line=middle,
	enlargelimits = upper, clip=true,
	scale only axis,
	width=\textwidth, height=0.2\textwidth,
	ymin=0,	ymax=\L,
	xmin=-3.14, xmax=3.14,
	axis line style={->,>=stealth},
	xlabel={\small $\omega$},
	ylabel={\small $|W(e^{j\omega})|$},
	every axis x label/.style={
		at={(ticklabel* cs:1)},
		%xshift=0.2cm,
		anchor=north,
	},
	every axis y label/.style={
		at={(ticklabel* cs:0.9)},
		anchor=south,
		xshift=0.7cm,
	},
	ytick={64},
	yticklabels={\small $64$},
	xtick={-3.14, -1.57, 0, 1.57, 3.14},
	xticklabels={\small $-\pi$, \small $-\frac{\pi}{2}$, \small $0$, \small $\frac{\pi}{2}$, \small $\pi$}, 
	every outer y axis line/.append style={white!15!black},
	every y tick label/.append style={font=\color{white!15!black}},
	legend style={draw=white!15!black,fill=white,legend cell align=left}]
	\addplot[smooth, solid, line width=1pt, domain=-pi:pi, samples=300] {abs(dsinc(x, \L))};
	\node[align=center, text width=5cm, anchor=south west] at (axis cs: pi/5, 30) {$W(e^{j\omega}) = \frac{\sin(\omega L/2)}{\sin(\omega/2)}e^{-j\omega\frac{L-1}{2}}$};
\end{axis}

\begin{axis}[
	name=plot2,
	at=(plot1.below south east), anchor=above north east,
	axis x line=bottom, axis y line=middle,
	enlargelimits = upper, clip=true,
	scale only axis,
	width=\textwidth, height=0.2\textwidth,
	ymin=0,	ymax=32,
	xmin=-1, xmax=1,
	axis line style={->,>=stealth},
	xlabel={\small $\omega$},
	ylabel={\small $|V(e^{j\omega})|$},
	every axis x label/.style={
		at={(ticklabel* cs:1)},
		anchor=north,
	},
	every axis y label/.style={
		at={(ticklabel* cs:0.9)},
		anchor=south,
		xshift=0.7cm,
	},
	ytick={16, 32},
	yticklabels={\small $16$, \small $32$},
	xtick={-1, -0.5, -0.3333, 0, 0.3333, 0.5, 1},
	xticklabels={\small $-\pi$, \small $-\frac{\pi}{2}$, \small $-\frac{\pi}{3}$, \small $0$, $\frac{\pi}{3}$, \small $\frac{\pi}{2}$, \small $\pi$}, 
	every outer y axis line/.append style={white!15!black},
	every y tick label/.append style={font=\color{white!15!black}},
	legend style={draw=white!15!black,fill=white,legend cell align=left}]
	
	\only<1|handout:1>{
	\addplot [smooth, color=black, solid, line width=1pt] table[x index=0,y index=3] {figs/data/sinusoid_windowing.dat};
	\node[fill=black!20, align=center, anchor=south west, text width=1.75cm] at (axis cs: 3/4-0.15, 20) {\small $\omega_0 = \frac{\pi}{3}$ \\ $\omega_1 = 1.5\omega_0$};
	}
	
	\only<2|handout:2>{
	\addplot [smooth, color=black, solid, line width=1pt] table[x index=0,y index=2] {figs/data/sinusoid_windowing.dat};
	\node[fill=black!20, align=center, anchor=south west, text width=1.75cm] at (axis cs: 3/4-0.15, 20) {\small $\omega_0 = \frac{\pi}{3}$ \\ $\omega_1 = 1.1\omega_0$};
	}

	\only<3|handout:3>{
		\addplot [smooth, color=black, solid, line width=1pt] table[x index=0,y index=1] {figs/data/sinusoid_windowing.dat};
		\node[fill=black!20, align=center, anchor=south west, text width=1.75cm] at (axis cs: 3/4-0.15, 20) {\small $\omega_0 = \frac{\pi}{3}$ \\ $\omega_1 = 1.05\omega_0$};
	}
\end{axis}
\end{tikzpicture}
