Page MenuHomec4science

2_multirate.tex
No OneTemporary

File Metadata

Created
Thu, Mar 13, 02:19

2_multirate.tex

\documentclass[aspectratio=169]{beamer}
\def\stylepath{../styles}
\usepackage{\stylepath/com303}
\begin{document}
\begin{frame} \frametitle{Overview}
\begin{itemize}
\item why multirate?
\item upsampling
\item downsampling
\item applications
\end{itemize}
\end{frame}
\begin{frame} \frametitle{Changing the sampling rate of a digital signal}
\centering
\begin{dspBlocks}{1}{0.3}
$x[n]$~~ & \BDsinc[0.5em] & \BDlowpass[0.5em] & \BDsamplerFramed[0.5em] & ~~$x'[n]$ \\
& $F_s$ & & $F_r$ \\
\psset{linewidth=1.5pt}
\ncline{-}{1,1}{1,2}
\ncline{->}{1,2}{1,3}{\taput{$x_c(t)$}}
\ncline{1,3}{1,4}
\ncline{->}{1,4}{1,5}
\end{dspBlocks}
\begin{itemize}
\item $x[n]$ sampled at $F_s$ samples per second
\item $x'[n]$ sampled at $F_r$
\end{itemize}
\vspace{1em}
but: we don't want to go back to continuous time!
\end{frame}
\begin{frame} \frametitle{Upsampling}
\[
x_{NU}[n] = \left\{
\begin{array}{ll}
x[k] & \mbox{for $n = kN, \quad k \in \mathbb{Z}$} \\
0 & \mbox{otherwise.}
\end{array}
\right.
\]
\vspace{3em}
\center
\begin{figure}
\begin{dspBlocks}{1.3}{0.6}
$x[n]$ & \BDupsmp{N} & $x_{NU}[n]$
\psset{arrows=->,linewidth=1.5pt}
\ncline{1,1}{1,2} \ncline{1,2}{1,3}
\end{dspBlocks}
\end{figure}
\end{frame}
\def\dtSig{5 sub 0.3 mul RadtoDeg %
dup cos 0.3 mul exch %
0.5 mul sin 0.6 mul %
add 0.5 add }
\def\upFact{4 }
\begin{frame} \frametitle{Example: upsampling by \upFact}
\begin{figure}
\begin{dspPlot}[width=10cm,height=4cm,sidegap=1]{-8,8}{-0.5,1.1}
\smallStems \psset{linecolor=blue}
\dspSignal{x \dtSig}
\end{dspPlot}
\end{figure}
\end{frame}
\begin{frame}
\frametitle{Example: upsampling by \upFact}
\begin{figure}
\begin{dspPlot}[width=10cm,height=4cm,sidegap=4]{-32,32}{-0.5,1.1}
\smallStems \psset{linecolor=blue}
\dspSignal{x dup cvi \upFact mod 0 eq {\upFact div \dtSig} {pop 0} ifelse}
\end{dspPlot}
\end{figure}
\end{frame}
\begin{frame}
\frametitle{Spectral representation}
\begin{align*}
X_{NU}(z) &= \sum_{k = -\infty}^{\infty}x_{NU}[k] z^{-k} \\ \pause
&= \sum_{k = -\infty}^{\infty} x[k] z^{-Nk} \\ \pause
&= X(z^{N}) \\ \\ \pause
X_{NU}(e^{j\omega}) &= X(e^{j\omega N})
\end{align*}
\end{frame}
\begin{frame} \frametitle{Upsampling by 2}
\begin{center}
\begin{figure}
\begin{dspPlot}[height=1.4cm,xtype=freq,xticks=1,yticks=1,ylabel={$X(e^{j\omega})$}]{-1,1}{0,1.2}
\smallStems \psset{linecolor=blue}
\dspFunc{x \dspPeriodize \dspTri{0}{1}}
\end{dspPlot}
\begin{dspPlot}[height=1.4cm,xtype=freq,xticks=1,yticks=1,ylabel={$X(e^{j\omega})$}]{-5,5}{0,1.2}
\smallStems \psset{linecolor=blue}
\only<2->{
\dspFunc{x \dspPeriodize \dspTri{0}{1}}
\pnode(-2,0){leftA}\pnode( 2,0){rightA}}
\end{dspPlot}
\begin{dspPlot}[height=1.4cm,xtype=freq,xticks=1,yticks=1,ylabel={$X_{2U}(e^{j\omega})$}]{-1,1}{0,1.2}
\smallStems \psset{linecolor=blue}
\only<3->{
\dspFunc{x 2 mul \dspPeriodize \dspTri{0}{1}}
\pnode(-1,1.2){leftB}\pnode( 1,1.2){rightB}
\psset{linecolor=orange}
\ncline[linewidth=2pt]{leftA}{rightA}
\ncline[linewidth=1pt,linestyle=dashed]{->}{leftA}{leftB}
\ncline[linewidth=1pt,linestyle=dashed]{->}{rightA}{rightB}}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\begin{frame} \frametitle{Upsampling by 3}
\begin{center}
\begin{figure}
\begin{dspPlot}[height=1.4cm,xtype=freq,xticks=1,yticks=1,ylabel={$X(e^{j\omega})$}]{-1,1}{0,1.2}
\smallStems \psset{linecolor=blue}
\dspFunc{x \dspPeriodize \dspTri{0}{1}}
\end{dspPlot}
\begin{dspPlot}[height=1.4cm,xtype=freq,xticks=1,yticks=1,ylabel={$X(e^{j\omega})$}]{-5,5}{0,1.2}
\smallStems \psset{linecolor=blue}
\only<2->{
\dspFunc{x \dspPeriodize \dspTri{0}{1}}
\pnode(-3,0){leftA}\pnode( 3,0){rightA}}
\end{dspPlot}
\begin{dspPlot}[height=1.4cm,xtype=freq,xticks=1,yticks=1,ylabel={$X_{3U}(e^{j\omega})$}]{-1,1}{0,1.2}
\smallStems \psset{linecolor=blue}
\only<3->{
\dspFunc{x 3 mul \dspPeriodize \dspTri{0}{1}}
\pnode(-1,1.2){leftB}\pnode( 1,1.2){rightB}
\psset{linecolor=orange}
\ncline[linewidth=2pt]{leftA}{rightA}
\ncline[linewidth=1pt,linestyle=dashed]{->}{leftA}{leftB}
\ncline[linewidth=1pt,linestyle=dashed]{->}{rightA}{rightB}}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\begin{frame} \frametitle{Upsampling by 4}
\begin{center}
\begin{figure}
\begin{dspPlot}[height=1.4cm,xtype=freq,xticks=3,yticks=1,ylabel={$X(e^{j\omega})$}]{-1,1}{0,1.2}
\smallStems \psset{linecolor=blue}
\dspFunc{x \dspPeriodize \dspTri{0}{0.66666}}
\end{dspPlot}
\begin{dspPlot}[height=1.4cm,xtype=freq,xticks=1,yticks=1,ylabel={$X(e^{j\omega})$}]{-5,5}{0,1.2}
\smallStems \psset{linecolor=blue}
\only<2->{
\dspFunc{x \dspPeriodize \dspTri{0}{0.66666}}
\pnode(-4,0){leftA}\pnode( 4,0){rightA}}
\end{dspPlot}
\begin{dspPlot}[height=1.4cm,xtype=freq,xticks=1,yticks=1,ylabel={$X_{4U}(e^{j\omega})$}]{-1,1}{0,1.2}
\smallStems \psset{linecolor=blue}
\only<3->{
\dspFunc{x 4 mul \dspPeriodize \dspTri{0}{0.66666}}
\pnode(-1,1.2){leftB}\pnode( 1,1.2){rightB}
\psset{linecolor=orange}
\ncline[linewidth=2pt]{leftA}{rightA}
\ncline[linewidth=1pt,linestyle=dashed]{->}{leftA}{leftB}
\ncline[linewidth=1pt,linestyle=dashed]{->}{rightA}{rightB}}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\begin{frame} \frametitle{Upsampling: what we don't like}
\begin{itemize}
\item in the time domain: zeros between nonzero samples are not ``natural''
\item in the frequency domain: extra replicas of the spectrum; can we get rid of them?
\end{itemize}
\vspace{1em}
\centering
the two problems are the same!
\end{frame}
\begin{frame} \frametitle{Upsampling in the time domain, revisited}
\begin{figure}
\begin{dspPlot}[width=10cm,height=4cm]{-32,32}{-0.5,1.1}
\smallStems \psset{linecolor=blue}
\dspSignal{x \dtSig}
\only<2->{
\psset{linecolor=orange}
\psframe[linecolor=orange](-8.5,-0.5)(8.5,1.1)}
\end{dspPlot}
\end{figure}
\end{frame}
\def\upFact{4 }
\begin{frame} \frametitle{Upsampling in the time domain, revisited}
\begin{figure}
\begin{dspPlot}[width=10cm,height=4cm]{-32,32}{-0.5,1.1}
\smallStems \psset{linecolor=blue}
\only<1|handout:1>{
\dspSignal[xunit=4,xmax=8,xmin=-8]{x \dtSig }}
\only<2|handout:2>{
\dspSignal[linecolor=orange]{x dup cvi \upFact mod 0 eq {\upFact div \dtSig} {pop 0} ifelse}
\dspSignal[xunit=4,xmax=8,xmin=-8]{x \dtSig }}
\only<3|handout:3>{\dspSignal[linecolor=orange]{x \upFact div floor \dtSig}
\dspSignal[xunit=4,xmax=8,xmin=-8]{x \dtSig }}
\end{dspPlot}
\end{figure}
\end{frame}
\begin{frame} \frametitle{Zero-order interpolator}
\center
\begin{figure}
\begin{dspBlocks}{1.3}{0.6}
$x[n]$ & \BDupsmp{N} & \BDfilter{$I_0(z)$} & $y[n]$
\psset{arrows=->,linewidth=1.5pt}
\ncline{1,1}{1,2} \ncline{-}{1,2}{1,3}
\ncline{1,3}{1,4}
\end{dspBlocks}
\end{figure}
\end{frame}
\begin{frame} \frametitle{Zero-order interpolator for 4-upsampling}
\center
$i_0[n] = u[n] - u[n-4]$
\begin{figure}
\begin{dspPlot}{-6,6}{-.5,1.3}
\moocStyle
\dspSignal{x \dspRect{1.5}{4}}
\end{dspPlot}
\end{figure}
\end{frame}
\begin{frame} \frametitle{Upsampling in the time domain, revisited}
\begin{figure}
\begin{dspPlot}[width=10cm,height=4cm]{-32,32}{-0.5,1.1}
\smallStems \psset{linecolor=blue}
\only<1|handout:1>{
\dspSignal[linecolor=orange]{x dup cvi \upFact mod 0 eq {\upFact div \dtSig} {pop 0} ifelse}
\dspSignal[xunit=4,xmax=8,xmin=-8]{x \dtSig }}
\only<2|handout:2>{\dspSignal[linecolor=orange]%
{x \upFact div floor % last upsampling point n
dup \upFact mul x exch sub \upFact div % intra-interval factor p
2 copy % n p n p
1 exch sub exch \dtSig mul % n p (1-p)f(n)
3 1 roll exch % A p n
1 add \dtSig % A p f(n+1)
mul add}
\dspSignal[xunit=4,xmax=8,xmin=-8]{x \dtSig }}
\end{dspPlot}
\end{figure}
\end{frame}
\begin{frame} \frametitle{first-order interpolator}
\center
\begin{figure}
\begin{dspBlocks}{1.3}{0.6}
$x[n]$ & \BDupsmp{N} & \BDfilter{$I_1(z)$} & $y[n]$
\psset{arrows=->,linewidth=1.5pt}
\ncline{1,1}{1,2} \ncline{-}{1,2}{1,3}
\ncline{1,3}{1,4}
\end{dspBlocks}
\end{figure}
\end{frame}
\begin{frame} \frametitle{first-order interpolator for 4-upsampling}
\center
$i_1[n] = (i_0[n] \ast i_0[n])/N$
\begin{figure}
\begin{dspPlot}{-6,6}{-.5,1.3}
\moocStyle
\dspSignal{x \dspTri{0}{4}}
\end{dspPlot}
\end{figure}
\end{frame}
\begin{frame} \frametitle{in the frequency domain...}
\begin{center}
\begin{figure}
\begin{dspPlot}[height=1.4cm,xtype=freq,xticks=3,yticks=1,ylabel={$X(e^{j\omega})$}]{-1,1}{0,1.2}
\smallStems \psset{linecolor=blue}
\dspFunc{x \dspPeriodize \dspTri{0}{0.66666}}
\end{dspPlot}
\begin{dspPlot}[height=1.4cm,xtype=freq,xticks=1,yticks=1,ylabel={$X(e^{j\omega})$}]{-5,5}{0,1.2}
\smallStems \psset{linecolor=blue}
\dspFunc{x \dspPeriodize \dspTri{0}{0.66666}}
\pnode(-4,0){leftA}\pnode( 4,0){rightA}
\end{dspPlot}
\begin{dspPlot}[height=1.4cm,xtype=freq,xticks=4,yticks=1,ylabel={$X_{4U}(e^{j\omega})$}]{-1,1}{0,1.2}
\pnode(-1,1.2){leftB}\pnode( 1,1.2){rightB}
\psset{linecolor=orange}
\ncline[linewidth=2pt]{leftA}{rightA}
\ncline[linewidth=1pt,linestyle=dashed]{->}{leftA}{leftB}
\ncline[linewidth=1pt,linestyle=dashed]{->}{rightA}{rightB}
\smallStems \psset{linecolor=blue}
\dspFunc{x 4 mul \dspPeriodize \dspTri{0}{0.66666}}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\begin{frame} \frametitle{in the frequency domain...}
\begin{center}
\begin{figure}
\begin{dspPlot}[xtype=freq,xticks=4,yticks=none,ylabel={$X_{4U}(e^{j\omega})$}]{-1,1}{0,1.2}
\smallStems \psset{linecolor=blue}
\dspFunc{x 4 mul \dspPeriodize \dspTri{0}{0.66666}}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\begin{frame} \frametitle{Zero-order interpolator}
\center
\begin{figure}
\begin{dspBlocks}{1.3}{0.6}
$x[n]$ & \BDupsmp{N} & \BDfilter{$I_0(z)$} & $y[n]$
\psset{arrows=->,linewidth=1.5pt}
\ncline{1,1}{1,2} \ncline{-}{1,2}{1,3}
\ncline{1,3}{1,4}
\end{dspBlocks}
\end{figure}
\end{frame}
\def\sinInt#1{ 90 mul dup dup 0 eq {pop pop 1} {#1 mul sin exch sin div} ifelse }
\begin{frame} \frametitle{frequency response of zero-order interpolator for 4-upsampling}
\begin{center}
$|I_0(e^{j\omega})| = \left| \frac{\sin \left( \frac{\omega}{2}N \right)}{\sin \left( \frac{\omega}{2} \right)}\right| \qquad N=4$
\begin{figure}
\begin{dspPlot}[xtype=freq,ylabel={$|I_0(e^{j\omega})|$}]{-1,1}{0, 4.2}
\moocStyle
\dspFunc{x \sinInt{4} abs}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\begin{frame} \frametitle{zero-order interpolation in the frequency domain}
\begin{center}
\begin{figure}
\begin{dspPlot}[xtype=freq,xticks=4,yticks=none,ylabel={$X_{4U}(e^{j\omega})$}]{-1,1}{0,1.2}
\smallStems \psset{linecolor=blue}
\only<1-2|handout:1-2>{\dspFunc{x 4 mul \dspPeriodize \dspTri{0}{0.66666}}}
\only<2|handout:2>{\dspFunc[linecolor=green,linestyle=dashed]{x \sinInt{4} abs 4 div}}
\only<3|handout:3>{\dspFunc{x \sinInt{4} abs x 4 mul \dspPeriodize \dspTri{0}{0.66666} mul 4 div}}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\begin{frame} \frametitle{first-order interpolator}
\center
\begin{figure}
\begin{dspBlocks}{1.3}{0.6}
$x[n]$ & \BDupsmp{N} & \BDfilter{$I_1(z)$} & $y[n]$
\psset{arrows=->,linewidth=1.5pt}
\ncline{1,1}{1,2} \ncline{-}{1,2}{1,3}
\ncline{1,3}{1,4}
\end{dspBlocks}
\end{figure}
\end{frame}
\begin{frame} \frametitle{frequency response of first-order interpolator for 4-upsampling}
\begin{center}
$|I_1(e^{j\omega})| = |I_0(e^{j\omega})|^2/N \qquad N=4$
\begin{figure}
\begin{dspPlot}[xtype=freq,ylabel={$|I_1(e^{j\omega})|$}]{-1,1}{0, 4.2}
\moocStyle
\dspFunc{x \sinInt{4} dup mul 4 div}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\begin{frame} \frametitle{zero-order interpolation in the frequency domain}
\begin{center}
\begin{figure}
\begin{dspPlot}[xtype=freq,xticks=4,yticks=none,ylabel={$X_{4U}(e^{j\omega})$}]{-1,1}{0,1.2}
\smallStems \psset{linecolor=blue}
\only<1-2|handout:1-2>{\dspFunc{x 4 mul \dspPeriodize \dspTri{0}{0.66666}}}
\only<2|handout:2>{\dspFunc[linecolor=green,linestyle=dashed]{x \sinInt{4} dup mul 16 div}}
\only<3|handout:3>{\dspFunc{x \sinInt{4} dup mul x 4 mul \dspPeriodize \dspTri{0}{0.66666} mul 16 div}}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\begin{frame} \frametitle{in the limit...}
\begin{center}
\begin{figure}
\begin{dspPlot}[xtype=freq,xticks=4,yticks=none,ylabel={$X_{4U}(e^{j\omega})$}]{-1,1}{0,1.2}
\smallStems \psset{linecolor=blue}
\only<1-2|handout:1-2>{\dspFunc{x 4 mul \dspPeriodize \dspTri{0}{0.66666}}}
\only<2|handout:6>{\dspFunc[linecolor=green,linestyle=dashed]{x \dspRect{0}{0.5}}}
\only<3-|handout:7->{\dspFunc{x 4 mul \dspTri{0}{0.66666}}}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\begin{frame}
\frametitle{ideal digital interpolator}
\center
\begin{figure}
\begin{dspBlocks}{1.3}{0.6}
$x[n]$ & \BDupsmp{N} & \BDfilter{$H(z)$} & $y[n]$
\psset{arrows=->,linewidth=1.5pt}
\ncline{1,1}{1,2} \ncline{-}{1,2}{1,3}
\ncline{1,3}{1,4}
\end{dspBlocks}
\end{figure}
\vspace{2em}
\begin{align*}
H(e^{j\omega}) &= \rect(\omega N/2\pi) \\
h[n] &= (1/N)\sinc(n/N)
\end{align*}
\end{frame}
\begin{frame} \frametitle{ideal digital interpolation}
\center
\begin{figure}
\begin{dspBlocks}{1.3}{0.6}
$x[n]$ & \BDupsmp{N} & \BDfilter{LP$\{\pi/N\}$} & $y[n]$
\psset{arrows=->,linewidth=1.5pt}
\ncline{1,1}{1,2} \ncline{-}{1,2}{1,3}
\ncline{1,3}{1,4}
\end{dspBlocks}
\end{figure}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame} \frametitle{Downsampling}
\[
x_{ND}[n] = x[nN]
\]
\vspace{3em}
\center
\begin{figure}
\begin{dspBlocks}{1.3}{0.6}
$x[n]$ & \BDdwsmp{N} & $x_{ND}[n]$
\psset{arrows=->,linewidth=1.5pt}
\ncline{1,1}{1,2} \ncline{1,2}{1,3}
\end{dspBlocks}
\end{figure}
\end{frame}
\begin{frame} \frametitle{Example: downsampling by 4}
\begin{figure}
\begin{dspPlot}[sidegap=4]{-32,32}{-0.5,1.1}
\smallStems \psset{linecolor=blue}
\dspSignal{x \dtSig}
\only<2>{\dspSignal[linecolor=orange,plotpoints=17]{x \dtSig}}
\end{dspPlot}
\end{figure}
\end{frame}
\begin{frame} \frametitle{Example: downsampling by 4}
\begin{figure}
\begin{dspPlot}[sidegap=1]{-8,8}{-0.5,1.1}
\smallStems \psset{linecolor=blue}
\dspSignal{x 4 mul \dtSig}
\end{dspPlot}
\end{figure}
\end{frame}
\begin{frame} \frametitle{Spectral representation}
\centering
\[
X_{ND}(z) = \sum_{k = -\infty}^{\infty}x[kN]z^{-k} = \quad ?
\]
\vspace{2em}
\pause
if we can compute
\[
A(z) = \sum_{k = -\infty}^{\infty}x[kN]z^{-kN}
\]
then
\[
X_{ND}(z) = A(z^{1/N})
\]
\end{frame}
\begin{frame} \frametitle{Spectral representation}
\begin{align*}
A(z) &= \sum_{k = -\infty}^{\infty}x[kN]z^{-kN} \\ \pause
&= \sum_{k = -\infty}^{\infty}\xi[k]x[k]z^{-k} \\ \\ \pause
\xi[n] &= \begin{cases} 1 & \mbox{for $n = kN$} \\ 0 & \mbox{otherwise} \end{cases}
\end{align*}
\end{frame}
\begin{frame} \frametitle{$\xi[n]$ for $N=4$}
\begin{figure}
\begin{dspPlot}[ylabel={$\xi[n]$}]{-32,32}{-0.5,1.5}
\smallStems \psset{linecolor=blue}
\dspSignal{x cvi 4 mod 0 eq {1} {0} ifelse}
\end{dspPlot}
\end{figure}
\end{frame}
\begin{frame} \frametitle{Remember the DFT, DFS, roots of unity!}
\begin{itemize}
\item $\xi[n]$ is periodic with period $N$
\item over one period, $\xi[n] = \delta[n] \in \mathbb{C}^N$
\item DFT of $\delta[n]$ is the $X[k] = 1$
\item express $\xi[n]$ as inverse DFS of $X[k]$
\end{itemize}
\end{frame}
\begin{frame} \frametitle{DFT of $x[n] = \delta[n] \in \mathbb{C}^{N}$}
\[
X[k] = \sum_{n = 0}^{N-1} \delta[n]\, e^{-j\frac{2\pi}{N}nk} = 1
\]
\vspace{1em}
\begin{columns}
\begin{column}{.5\paperwidth}
\centering
$x[n]$
\begin{dspPlot}[width=5cm,height=2.7cm,xticks=15]{0,15}{0,1.1}
\moocStyle
\dspSignal{x 0 eq {1} {0} ifelse }
\end{dspPlot}
\end{column}
\begin{column}{.5\paperwidth}
\centering
$X[k]$
\begin{dspPlot}[width=5cm,height=2.7cm,xticks=15]{0,15}{0,1.1}
\moocStyle
\dspSignal{1}
\end{dspPlot}
\end{column}
\end{columns}
\end{frame}
\begin{frame} \frametitle{Inverse DFS}
\begin{align*}
\xi[n] &= \IDFS{1} \\
&= \frac{1}{N}\sum_{m=0}^{N-1}e^{j\frac{2\pi}{N}mn} \\
&= \begin{cases} 1 & \mbox{for $n \mod N = 0$} \\ 0 & \mbox{otherwise} \end{cases}
\end{align*}
% \setbeamercovered{invisible}
% \[
% \only<1-2>{\IDFT{1} =} \frac{1}{N}\sum_{m=0}^{N-1}e^{j\frac{2\pi}{N}mn} =
% \only<1|handout:0>{\delta[n]}
% \only<2|handout:0>{\begin{cases} 1 & \mbox{for $n = 0$} \\ 0 & \mbox{otherwise} \end{cases} \qquad n = 0, \ldots, N-1}
% \only<3>{\begin{cases} 1 & \mbox{for $n \mod N = 0$} \\ 0 & \mbox{otherwise} \end{cases}}
% \]
% \vspace{1em}
%
% \begin{columns}
% \begin{column}{.5\paperwidth}
% $\only<3>{\tilde}X[k]$
% \centering
% \begin{dspPlot}[width=5cm,height=2.7cm,xticks=15]{0,15}{0,1.1}
% \moocStyle
% \dspSignal{1}
% \end{dspPlot}
% \end{column}
%
% \begin{column}{.5\paperwidth}
% \centering
% $\only<3>{\tilde}x[n]$
% \begin{dspPlot}[width=5cm,height=2.7cm,xticks=15]{0,15}{0,1.1}
% \moocStyle
% \dspSignal{x 0 eq {1} {0} ifelse }
% \end{dspPlot}
% \end{column}
% \end{columns}
\end{frame}
\begin{comment}
\begin{frame} \frametitle{Remember the IDFT of unity!}
in $\mathbb{C}^N$:
\begin{align*}
\IDFT{1} &= \frac{1}{N}\sum_{m=0}^{N-1}e^{j\frac{2\pi}{N}mn} = \delta[n] \\
&= \begin{cases} 1 & \mbox{for $n = 0$} \\ 0 & \mbox{otherwise} \end{cases} \qquad n = 0, \ldots, N-1
\end{align*}
\vspace{2em}
for $n \in \mathbb{Z}$:
\begin{align*}
\frac{1}{N}\sum_{m=0}^{N-1}e^{j\frac{2\pi}{N}mn} &= \begin{cases} 1 & \mbox{for $n \mod N = 0$} \\ 0 & \mbox{otherwise} \end{cases} \\
&= \xi[n]
\end{align*}
\end{frame}
\end{comment}
\begin{frame} \frametitle{Spectral representation}
\begin{align*}
\xi[n] &= \frac{1}{N}\sum_{m=0}^{N-1}e^{j\frac{2\pi}{N}mn} \\ \\ \pause
A(z) &= \sum_{k = -\infty}^{\infty}\xi[k]x[k]z^{-k} \\ \pause
&= \frac{1}{N}\sum_{m=0}^{N-1}\sum_{k = -\infty}^{\infty}x[k]e^{j\frac{2\pi}{N}mk} z^{-k} \\ \pause
&= \frac{1}{N}\sum_{m=0}^{N-1} X(e^{-j\frac{2\pi}{N}m}\, z)
\end{align*}
\end{frame}
\begin{frame} \frametitle{Spectral representation}
\begin{align*}
A(e^{j\omega}) &= \frac{1}{N}\sum_{m=0}^{N-1} X(e^{j(\omega - \frac{2\pi}{N}m)})
\end{align*}
\end{frame}
\begin{frame} \frametitle{Spectral representation}
\begin{align*}
X_{ND}(z) &= A(z^{1/N}) = \frac{1}{N}\sum_{m=0}^{N-1} X(e^{-j\frac{2\pi}{N}m}\, z^{\frac{1}{N}})\\ \\ \pause
X_{ND}(e^{j\omega}) &= \frac{1}{N}\sum_{m=0}^{N-1} X(e^{j(\frac{\omega - 2\pi m}{N})})
\end{align*}
\end{frame}
\begin{frame} \frametitle{Downsampling by 2}
\begin{center}
\begin{figure}
\begin{dspPlot}[height=1.4cm,xtype=freq,xticks=2,yticks=1,ylabel={$X(e^{j\omega})$}]{-1,1}{0,1.2}
\smallStems \psset{linecolor=blue}
\dspFunc{x \dspPeriodize \dspTri{0}{0.5}}
\end{dspPlot}
\begin{dspPlot}[height=1.4cm,xtype=freq,xticks=2,yticks=custom,ylabel={$A(e^{j\omega})$}]{-3,3}{0,1.2}
\smallStems \psset{linecolor=blue}
\only<2->{\dspFunc{x \dspPeriodize \dspTri{0}{0.5}}}
\only<3->{\dspFunc[linecolor=cyan]{x 1 sub \dspPeriodize \dspTri{0}{0.5}}}
\pnode(-0.5,0){leftA}\pnode(0.5,0){rightA}
\dspCustomTicks[axis=y]{1 $1/2$}
\end{dspPlot}
\begin{dspPlot}[height=1.4cm,xtype=freq,xticks=2,yticks=custom,ylabel={$X_{2D}(e^{j\omega})$}]{-1,1}{0,1.2}
\only<4->{
\pnode(-1,1.2){leftB}\pnode( 1,1.2){rightB}
\psset{linecolor=orange}
\ncline[linewidth=2pt]{leftA}{rightA}
\ncline[linewidth=1pt,linestyle=dashed]{->}{leftA}{leftB}
\ncline[linewidth=1pt,linestyle=dashed]{->}{rightA}{rightB}
\smallStems \psset{linecolor=blue}
\dspFunc{x \dspPeriodize \dspTri{0}{1}}}
\dspCustomTicks[axis=y]{1 $1/2$}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\begin{frame} \frametitle{Downsampling by 2 with aliasing}
\begin{center}
\begin{figure}
\begin{dspPlot}[height=1.4cm,xtype=freq,xticks=2,yticks=1,ylabel={$X(e^{j\omega})$}]{-1,1}{0,1.2}
\smallStems \psset{linecolor=blue}
\dspFunc{x \dspPeriodize \dspTri{0}{0.75}}
\end{dspPlot}
\begin{dspPlot}[height=1.4cm,xtype=freq,xticks=1,yticks=custom,ylabel={$A(e^{j\omega})$}]{-3,3}{0,1.2}
\smallStems \psset{linecolor=blue}
\only<2->{\dspFunc{x \dspPeriodize \dspTri{0}{0.75}}}
\only<3->{\dspFunc[linecolor=cyan]{x 1 sub \dspPeriodize \dspTri{0}{0.75}}}
\only<4->{\dspFunc[linecolor=red]{x \dspPeriodize \dspTri{0}{0.75} x 1 sub \dspPeriodize \dspTri{0}{0.75} add}}
\pnode(-0.5,0){leftA}\pnode(0.5,0){rightA}
\dspCustomTicks[axis=y]{1 $1/2$}
\end{dspPlot}
\begin{dspPlot}[height=1.4cm,xtype=freq,xticks=4,yticks=custom,ylabel={$X_{2D}(e^{j\omega})$}]{-1,1}{0,1.2}
\only<5->{
\pnode(-1,1.2){leftB}\pnode( 1,1.2){rightB}
\psset{linecolor=orange}
\ncline[linewidth=2pt]{leftA}{rightA}
\ncline[linewidth=1pt,linestyle=dashed]{->}{leftA}{leftB}
\ncline[linewidth=1pt,linestyle=dashed]{->}{rightA}{rightB}
\smallStems \psset{linecolor=blue}
\dspFunc{x \dspTri{0}{1.5} x 2 sub \dspTri{0}{1.5} x 2 add \dspTri{0}{1.5} add add}}
\dspCustomTicks[axis=y]{1 $1/2$}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\definecolor{aquamarine}{rgb}{0.5, 1.0, 0.83}
\begin{frame} \frametitle{Downsampling by 3}
\begin{center}
\begin{figure}
\begin{dspPlot}[height=1.4cm,xtype=freq,xticks=3,yticks=1,ylabel={$X(e^{j\omega})$}]{-1,1}{0,1.2}
\smallStems \psset{linecolor=blue}
\dspFunc{x \dspPeriodize \dspTri{0}{0.3333}}
\end{dspPlot}
\begin{dspPlot}[height=1.4cm,xtype=freq,xticks=1,yticks=custom,ylabel={$A(e^{j\omega})$}]{-3,3}{0,1.2}
\smallStems \psset{linecolor=blue}
\only<2->{\dspFunc{x \dspPeriodize \dspTri{0}{0.3333}}}
\only<2>{\dspCustomTicks[axis=x]{0.3333 $\pi/3$}}
\only<3->{\dspFunc[linecolor=cyan]{x 0.6666 sub \dspPeriodize \dspTri{0}{0.3333}}}
\only<3>{\dspCustomTicks[axis=x]{0.66666 $2\pi/3$}}
\only<4->{\dspFunc[linecolor=aquamarine]{x 1.3333 sub \dspPeriodize \dspTri{0}{0.3333}}}
\only<4>{\dspCustomTicks[axis=x]{1.33333 $4\pi/3$}}
\pnode(-0.33333,0){leftA}\pnode(0.33333,0){rightA}
\only<5->{\dspCustomTicks[axis=x]{0.3333 $\pi/3$}}
\dspCustomTicks[axis=y]{1 $1/3$}
\end{dspPlot}
\begin{dspPlot}[height=1.4cm,xtype=freq,xticks=2,yticks=custom,ylabel={$X_{3D}(e^{j\omega})$}]{-1,1}{0,1.2}
\only<5->{
\pnode(-1,1.2){leftB}\pnode( 1,1.2){rightB}
\psset{linecolor=orange}
\ncline[linewidth=2pt]{leftA}{rightA}
\ncline[linewidth=1pt,linestyle=dashed]{->}{leftA}{leftB}
\ncline[linewidth=1pt,linestyle=dashed]{->}{rightA}{rightB}
\smallStems \psset{linecolor=blue}
\dspFunc{x \dspPeriodize \dspTri{0}{1}}}
\dspCustomTicks[axis=y]{1 $1/3$}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\begin{frame} \frametitle{Downsampling by 3, with aliasing}
\begin{center}
\begin{figure}
\begin{dspPlot}[height=1.4cm,xtype=freq,xticks=2,yticks=1,ylabel={$X(e^{j\omega})$}]{-1,1}{0,1.2}
\smallStems \psset{linecolor=blue}
\dspFunc{x \dspPeriodize \dspTri{0}{0.5}}
\end{dspPlot}
\begin{dspPlot}[height=1.4cm,xtype=freq,xticks=1,yticks=custom,ylabel={$A(e^{j\omega})$}]{-3,3}{0,1.2}
\smallStems \psset{linecolor=blue}
\only<2->{\dspFunc{x \dspPeriodize \dspTri{0}{0.5}}}
\only<2>{\dspCustomTicks[axis=x]{0.3333 $\pi/3$}}
\only<3->{\dspFunc[linecolor=cyan]{x 0.6666 sub \dspPeriodize \dspTri{0}{0.5}}}
\only<3>{\dspCustomTicks[axis=x]{0.66666 $2\pi/3$}}
\only<4->{\dspFunc[linecolor=aquamarine]{x 1.3333 sub \dspPeriodize \dspTri{0}{0.5}}}
\only<4>{\dspCustomTicks[axis=x]{1.33333 $4\pi/3$}}
\pnode(-0.33333,0){leftA}\pnode(0.33333,0){rightA}
\only<5->{
\dspFunc[linecolor=red]{x \dspPeriodize \dspTri{0}{0.5} x 0.6666 sub \dspPeriodize \dspTri{0}{0.5} x 1.3333 sub \dspPeriodize \dspTri{0}{0.5} add add}
\dspCustomTicks[axis=x]{0.3333 $\pi/3$}}
\dspCustomTicks[axis=y]{1 $1/3$}
\end{dspPlot}
\begin{dspPlot}[height=1.4cm,xtype=freq,xticks=2,yticks=custom,ylabel={$X_{3D}(e^{j\omega})$}]{-1,1}{0,1.2}
\only<6->{
\pnode(-1,1.2){leftB}\pnode( 1,1.2){rightB}
\psset{linecolor=orange}
\ncline[linewidth=2pt]{leftA}{rightA}
\ncline[linewidth=1pt,linestyle=dashed]{->}{leftA}{leftB}
\ncline[linewidth=1pt,linestyle=dashed]{->}{rightA}{rightB}
\smallStems \psset{linecolor=blue}
\dspFunc{x 3 div \dspPeriodize \dspTri{0}{0.5} x 3 div 0.6666 sub \dspPeriodize \dspTri{0}{0.5} x 3 div 1.3333 sub \dspPeriodize \dspTri{0}{0.5} add add}}
\dspCustomTicks[axis=y]{1 $1/3$}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\def\dspTriTru#1#2#3{ #1 sub abs #3 div dup 0.5 gt {pop 0} {#3 mul #2 div 1 exch sub} ifelse }
\begin{frame} \frametitle{Downsampling by 2 with antialiasing filter}
\begin{center}
\begin{figure}
\begin{dspPlot}[height=1.4cm,xtype=freq,xticks=4,yticks=1,ylabel={$X(e^{j\omega})$}]{-1,1}{0,1.2}
\smallStems \psset{linecolor=blue}
\only<1-2>{\dspFunc{x \dspTri{0}{0.75}} }
\only<2-3>{\dspFunc[linecolor=green,linestyle=dashed]{x \dspRect{0}{1}} }
\only<3->{\dspFunc{x \dspTriTru{0}{0.75}{1}} }
\end{dspPlot}
\begin{dspPlot}[height=1.4cm,xtype=freq,xticks=1,yticks=custom,ylabel={$X(e^{j\omega})$}]{-3,3}{0,1.2}
\smallStems \psset{linecolor=blue}
\only<4->{\dspFunc{x \dspPeriodize \dspTriTru{0}{0.75}{1}}}
\only<5->{\dspFunc[linecolor=cyan]{x 1 sub \dspPeriodize \dspTriTru{0}{0.75}{1}}}
\pnode(-0.5,0){leftA}\pnode(0.5,0){rightA}
\dspCustomTicks[axis=y]{1 $1/2$}
\end{dspPlot}
\begin{dspPlot}[height=1.4cm,xtype=freq,xticks=4,yticks=custom,ylabel={$X_{2D}(e^{j\omega})$}]{-1,1}{0,1.2}
\pnode(-1,1.2){leftB}\pnode( 1,1.2){rightB}
\psset{linecolor=orange}
\only<6->{
\ncline[linewidth=2pt]{leftA}{rightA}
\ncline[linewidth=1pt,linestyle=dashed]{->}{leftA}{leftB}
\ncline[linewidth=1pt,linestyle=dashed]{->}{rightA}{rightB}
\smallStems \psset{linecolor=blue}
\dspFunc{x \dspTriTru{0}{1.5}{2}}}
\dspCustomTicks[axis=y]{1 $1/2$}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\begin{frame} \frametitle{Downsampling}
\center
\begin{figure}
\begin{dspBlocks}{1.3}{0.6}
$x[n]$ & \BDfilter{LP$\{\pi/N\}$} & \BDdwsmp{N} & $y[n]$
\psset{arrows=->,linewidth=1.5pt}
\ncline{1,1}{1,2} \ncline{-}{1,2}{1,3}
\ncline{1,3}{1,4}
\end{dspBlocks}
\end{figure}
\end{frame}
\def\specHW{0.5 }
\def\specFunPar{abs 1 sub \specHW 2 mul div dup mul 1 exch sub }
\def\specFun{abs \specHW sub 1 \specHW sub div }
\def\periodSpec{%
1 sub 2 div dup floor sub 2 mul 1 sub dup dup % periodization
-\specHW lt {pop \specFunPar } {%
\specHW gt {\specFun } {pop 0} ifelse } %
ifelse }
\begin{frame} \frametitle{Downsampling by 2, careful with highpass signals}
\begin{center}
\begin{figure}
\begin{dspPlot}[height=1.4cm,xtype=freq,xticks=4,yticks=1,ylabel={$X(e^{j\omega})$}]{-1,1}{0,1.2}
\smallStems \psset{linecolor=blue}
\dspFunc{x \periodSpec}
\end{dspPlot}
\begin{dspPlot}[height=1.4cm,xtype=freq,xticks=1,yticks=custom,ylabel={$A(e^{j\omega})$}]{-3,3}{0,1.2}
\smallStems \psset{linecolor=blue}
\only<2->{\dspFunc{x \periodSpec }}
\only<3->{\dspFunc[linecolor=cyan]{x 1 sub \periodSpec}}
\pnode(-0.5,0){leftA}\pnode(0.5,0){rightA}
\dspCustomTicks[axis=y]{1 $1/2$}
\end{dspPlot}
\begin{dspPlot}[height=1.4cm,xtype=freq,xticks=4,yticks=custom,ylabel={$X_{2D}(e^{j\omega})$}]{-1,1}{0,1.2}
\pnode(-1,1.2){leftB}\pnode( 1,1.2){rightB}
\psset{linecolor=orange}
\only<4->{
\ncline[linewidth=2pt]{leftA}{rightA}
\ncline[linewidth=1pt,linestyle=dashed]{->}{leftA}{leftB}
\ncline[linewidth=1pt,linestyle=dashed]{->}{rightA}{rightB}
\smallStems \psset{linecolor=blue}
\dspFunc[xmin=-1]{%
x 0.5 mul 1 sub \periodSpec %
x 0.5 mul \periodSpec %
add}}
\dspCustomTicks[axis=y]{1 $1/2$}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\begin{frame} \frametitle{Rational Sampling Rate Change}
\center
\begin{figure}
\begin{dspBlocks}{0.8}{0.6}
$x[n]$ & \BDupsmp{N} & \BDfilter{LP$\{\min(\pi/N,\pi/M)\}$} & \BDdwsmp{M} & $y[n]$
\psset{arrows=->,linewidth=1.5pt}
\ncline{1,1}{1,2} \ncline{-}{1,2}{1,3}
\ncline{-}{1,3}{1,4}\ncline{1,4}{1,5}
\end{dspBlocks}
\end{figure}
\end{frame}
\begin{frame} \frametitle{Rational Sampling Rate Change}
Example CD to DVD:
\begin{itemize}
\item CD: $F_s = 44100$Hz
\item DVD: $F_S = 48000$Hz
\item $\displaystyle \frac{N}{M} = \frac{160}{147}$
\item in practice, we use time-varying local interpolation
\end{itemize}
\end{frame}
%% finite-length signal, 3 taps
\def\ta{.5 } \def\tb{2 } \def\tc{-1 }
%% the tap plotting string
\def\taps{-1 \ta 0 \tb 1 \tc }
\def\plotTaps{\dspTaps[linecolor=blue!70]{\taps}}
%% Lagrange polynomials
\def\lpa{%
dup -1 div exch %
-1 add -2 div %
mul }
\def\lpb{%
dup 1 add -1 div exch %
-1 add %
mul }
\def\lpc{%
dup exch %
1 add 2 div %
mul }
\def\lagInterp{%
dup \lpa \ta mul exch %
dup \lpb \tb mul exch %
\lpc \tc mul %
add add}
\def\interpolant#1#2#3#4{%
\FPupn\n{#1 1 + 0 trunc}%
\only<#1>{%
\dspTaps{#3 \csname t#4\endcsname}%
\dspFunc[linewidth=0.5pt]{x \csname lp#4\endcsname \csname t#4\endcsname mul}}%
\only<\n-#2>{\dspFunc[linewidth=0.5pt,linecolor=blue!50]{x \csname lp#4\endcsname \csname t#4\endcsname mul}}}%
\def\sample#1#2#3{%
\psline[linewidth=\dspStemWidth,#1](#2,0)(! #2 dup #3)
\psdot[dotstyle=o,dotsize=\dspDotSize,#1](! #2 dup #3)}
\begin{frame} \frametitle{Subsample Interpolation}
\begin{center}
\begin{figure}
\begin{dspPlot}[sidegap=0,xticks=custom]{-1.5,1.5}{-2,3}
\moocStyle%
\plotTaps%
\only<2->{\psdot[dotstyle=x,linecolor=green!70](0.3,0)}
\dspCustomTicks[axis=x]{-1 $n-1$ 0 $n$ 1 $n+1$}%
\only<2->{\dspCustomTicks[axis=x]{0.3 $n+\tau$}}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\begin{frame} \frametitle{Subsample Interpolation}
\begin{itemize}[<+->]
\item we want to compute $x(n + \tau)$, with $|\tau| < 1/2$
\item local Lagrange approximation around $n$
\begin{align*}
x_L(n; t) &= \sum_{k=-N}^{N} x[n + k] L_k^{(N)}(t) \\
L^{(N)}_k(t) &= \mathop{\prod_{i = -N}}_{i\neq n}^{N}\frac{t - i}{k - i} \qquad\qquad k = -N, \ldots, N
\end{align*}
\item $x(n + \tau) \approx x_L(n; \tau)$
\end{itemize}
\end{frame}
\def\LagPoly#1#2#3#4{\only<#1->{%
\dspFunc[linecolor=#2]{x \csname lp#3\endcsname}%
\dspText(0,1.3){\color{#2} $L_{#4}^{1}(t)$}}}
\begin{frame} \frametitle{2nd-order Lagrange interpolation polynomials ($N=1$)}
\center
\begin{figure}
\begin{dspPlot}[sidegap=0,yticks=0.5]{-1.5,1.5}{-0.8,1.6}
\moocStyle
\begin{dspClip}%
\LagPoly{1}{green}{a}{-1}%
\LagPoly{2}{blue}{b}{0}%
\LagPoly{3}{orange}{c}{1}%
\end{dspClip}
\end{dspPlot}
\end{figure}
\end{frame}
\begin{frame} \frametitle{Lagrange interpolation ($N=1$)}
\begin{center}
\begin{figure}
\begin{dspPlot}[sidegap=0,xticks=custom]{-1.5,1.5}{-2,3}
\moocStyle%
\plotTaps%
\only<2-6>{\psdot[dotstyle=x,linecolor=green!70](0.3,0)}%
\begin{dspClip}
\interpolant{3}{6}{-1}{a}%
\interpolant{4}{6}{0}{b}%
\interpolant{5}{6}{1}{c}%
\only<6->{\dspFunc[linewidth=2pt,xmin=-2,xmax=2]{x \lagInterp}}%
\only<7->{\sample{linecolor=green!70}{0.3}{\lagInterp}}%
\end{dspClip}
\dspCustomTicks[axis=x]{-1 $n-1$ 0 $n$ 1 $n+1$}%
\only<2->{\dspCustomTicks[axis=x]{0.3 $n+\tau$}}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\begin{frame} \frametitle{Lagrange interpolation as an FIR}
\begin{itemize}[<+->]
\item $x(n + \tau) \approx x_L(n; \tau)$
\item $x_L(n; \tau) = \sum_{k=-N}^{N} x[n + k] L_k^{(N)}(\tau) = \sum_{k=-N}^{N} x[n - k] L_{-k}^{(N)}(\tau)$
\item define $d_{\tau}[k] = L_{-k}^{(N)}(\tau)$, $k = -N, \ldots, N$
\item $x_L(n; \tau) = \sum_{k=-N}^{N} x[n - k] d_{\tau}[k]$
\item $x_L(n; \tau) = (x \ast d_{\tau})[n]$
\item $d_{\tau}[k]$ is a $(2N+1)$-tap FIR (dependent on $\tau$)
\end{itemize}
\end{frame}
\begin{frame} \frametitle{Example ($N=1$, second order approximation)}
\begin{align*}
L_{-1}^{(1)}(t) &= t\frac{t-1}{2} \\
L_{0}^{(1)}(t) &= (1-t)(1+t) \\
L_{1}^{(1)}(t) &= t\frac{t+1}{2} \\
\end{align*}
\end{frame}
\begin{frame}
\frametitle{Example ($N=1$, second order approximation)}
\[
d_{0.2}[n] = \begin{cases} 0.12 & n=-1 \\ 0.96 & n = 0 \\ -0.08 & n = 1 \\ 0 & \mbox{otherwise} \end{cases}
\]
\end{frame}
\begin{frame} \frametitle{CD to DVD, revisited}
\centering
for every 147 CD samples, generate 160 DVD samples
\end{frame}
\begin{frame} \frametitle{Fractional resampling: algorithm}
\begin{center}
sampling rate change $A/B$: for every $B$ input point, generate $A$ output points
\end{center}
\vspace{2em}
Initialization (pattern will repeat every $A$ output points)
\begin{itemize}
\item for each output index $0 \leq m < A$ find closest ($< 0.5$) input point
\item generate a FIR interpolation filter using difference between output and anchor
\end{itemize}
\vspace{2em}
For every block of $A$ output values $y[n]$:
\begin{itemize}
\item use all filters in turn
\item generate output points
\end{itemize}
\end{frame}
\def\xdot#1#2{\pnode(#1,1){#2X} \pscircle*(#1,1){3pt} \uput[90](#1,1){$x[#2]$}}
\def\ydot#1#2{\pnode(#1,0){#2Y} \pscircle*(#1,0){3pt} \uput[-90](#1,0){$y[#2]$}}
\def\anchor#1#2{\ncline[nodesep=6pt,linecolor=blue]{->}{#1Y}{#2X}}
\begin{frame} \frametitle{Fractional resampling: sample rate reduction}
\center
Downsampling: $\displaystyle\frac{A}{B} = \frac{4}{5}$
\vspace{2em}
\begin{figure}
\center
\psset{xunit=2.4cm,yunit=2cm}
\begin{pspicture}(-0.5,-0.5)(5.5,1.5)
\psline[linewidth=2pt,tickwidth=2pt,](0,1)(5,1)%
\multido{\n=0+1}{6}{\xdot{\n}{\n}}
\psline[linewidth=2pt,tickwidth=2pt,](0,0)(5,0)%
\multido{\i=0+1,\n=0.00+1.25}{5}{\ydot{\n}{\i}}
\only<2->{
\multido{\n=-0.5+1.0}{7}{\psline[linewidth=1pt,linecolor=red,linestyle=dotted](\n,-0.5)(\n,1.5)}}
\only<3->{
\anchor{0}{0} \anchor{1}{1} \anchor{2}{2} \anchor{3}{4} \anchor{4}{5} }
\end{pspicture}
\end{figure}
\end{frame}
\begin{frame} \frametitle{Fractional resampling: sample rate increase}
\center
Upsampling: $\displaystyle\frac{A}{B} = \frac{8}{5}$
\vspace{2em}
\begin{figure}
\center
\psset{xunit=2.4cm,yunit=2cm}
\begin{pspicture}(-0.5,-0.5)(5.5,1.5)
\psline[linewidth=2pt,tickwidth=2pt,](0,1)(5,1)%
\multido{\n=0+1}{6}{\xdot{\n}{\n}}
\psline[linewidth=2pt,tickwidth=2pt,](0,0)(5,0)%
\multido{\i=0+1,\n=0.000+0.625}{9}{\ydot{\n}{\i}}
\only<2->{
\multido{\n=-0.5+1.0}{7}{\psline[linewidth=1pt,linecolor=red,linestyle=dotted](\n,-0.5)(\n,1.5)}}
\only<3->{
\anchor{0}{0} \anchor{1}{1} \anchor{2}{1} \anchor{3}{2} \anchor{4}{2}
\anchor{5}{3} \anchor{6}{4} \anchor{7}{4} \anchor{8}{5} }
\end{pspicture}
\end{figure}
\end{frame}
\begin{frame} \frametitle{CD to DVD, revisited}
\begin{center}
\begin{figure}
\begin{dspPlot}[sidegap=0,xticks=custom]{-1.5,1.5}{-2,3}
\moocStyle%
\dspTapsAt[linecolor=blue]{-1}{0 0 0}
\dspTaps[linecolor=green]{0 0 0 0}
\dspCustomTicks[axis=x]{-1 -1 0 $0+0\tau$ 1 1}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\begin{frame} \frametitle{CD to DVD, revisited, $\tau[1]= 0.06875$}
\begin{center}
\begin{figure}
\begin{dspPlot}[sidegap=0,xticks=custom]{-1.5,1.5}{-2,3}
\moocStyle%
\dspTapsAt[linecolor=blue]{-1}{0 0 0}
\dspTaps[linecolor=green]{-.2 0 -.2 0}
\dspCustomTicks[axis=x]{-1 0 0 1 1 2 -.2 $-\tau$}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\begin{frame} \frametitle{CD to DVD, revisited}
\begin{center}
\begin{figure}
\begin{dspPlot}[sidegap=0,xticks=custom]{-1.5,1.5}{-2,3}
\moocStyle%
\dspTapsAt[linecolor=blue]{-1}{0 0 0}
\dspTaps[linecolor=green]{-.3 0 -.3 0}
\dspCustomTicks[axis=x]{-1 1 0 2 1 3 -.3 $-2\tau$}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\begin{frame} \frametitle{CD to DVD, revisited}
\begin{center}
\begin{figure}
\begin{dspPlot}[sidegap=0,xticks=custom]{-1.5,1.5}{-2,3}
\moocStyle%
\dspTapsAt[linecolor=blue]{-1}{0 0 0}
\dspTaps[linecolor=green]{-.5 0 -.5 0}
\dspCustomTicks[axis=x]{-1 5 0 6 1 7 -.5 $-6\tau$}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\begin{frame} \frametitle{CD to DVD, revisited}
\begin{center}
\begin{figure}
\begin{dspPlot}[sidegap=0,xticks=custom]{-1.5,1.5}{-2,3}
\moocStyle%
\dspTapsAt[linecolor=blue]{-1}{0 0 0}
\dspTaps[linecolor=green]{-.6 0 -.6 0}
\dspCustomTicks[axis=x]{-1 6 0 7 1 8 -.6 $-7\tau$}
\end{dspPlot}
\end{figure}
but $-7\tau < -0.5$
\end{center}
\end{frame}
\begin{frame} \frametitle{CD to DVD, revisited: repeat a sample}
\begin{center}
\begin{figure}
\begin{dspPlot}[sidegap=0,xticks=custom]{-1.5,1.5}{-2,3}
\moocStyle%
\dspTapsAt[linecolor=blue]{-1}{0 0 0}
\dspTaps[linecolor=green]{.5 0 .5 0}
\dspCustomTicks[axis=x]{-1 5 0 6 1 7 .5 $1-7\tau$}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\begin{frame} \frametitle{CD to DVD, revisited}
\begin{center}
\begin{figure}
\begin{dspPlot}[sidegap=0,xticks=custom]{-1.5,1.5}{-2,3}
\moocStyle%
\dspTapsAt[linecolor=blue]{-1}{0 0 0}
\dspTaps[linecolor=green]{.3 0 .3 0}
\dspCustomTicks[axis=x]{-1 6 0 7 1 8 .3 $1-8\tau$}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\begin{frame} \frametitle{CD to DVD, revisited}
\centering
efficient local interpolation with 160 3-tap filters, used in sequence
\end{frame}
\end{document}
\end{document}

Event Timeline