Page MenuHomec4science

3_ctproc.tex
No OneTemporary

File Metadata

Created
Thu, Mar 13, 03:30

3_ctproc.tex

\documentclass[aspectratio=169]{beamer}
\def\stylepath{../styles}
\usepackage{\stylepath/com303}
\begin{document}
\begin{frame}
\frametitle{Overview:}
\begin{itemize}
\item Impulse invariance
\item Duality
\item Examples
\end{itemize}
\end{frame}
\begin{frame} \frametitle{Basic setup}
\setbeamercovered{invisible}
\begin{figure}[t]
\center %\small
\begin{dspBlocks}{1.5}{0.3}
$x_c(t)$~~ & \BDsamplerFramed[0.5em] & \BDfilter{$H(z)$} & \BDsinc[0.5em] & ~~$y_c(t)$ \\
& $T_s$ & & $F_s=1/T_s$ \\
\psset{linewidth=1.5pt}
\ncline{-}{1,1}{1,2}
\ncline{->}{1,2}{1,3}{\taput{$x[n]$}}
\ncline{->}{1,3}{1,4}{\taput{$y[n]$}}
\ncline{->}{1,4}{1,5}
\psset{unit=1em}%\psgrid(40,20)
\psframe[linecolor=darkred,framearc=.3,linestyle=dashed](4,0.5)(27,8)
\dspText(27.5,0.5){\color{darkred}~$H_c(f)$}
\end{dspBlocks}
\end{figure}
\vspace{2em}
assume $x_c(t)$ is $F_s$-bandlimited and $T_s = 1/F_s$:
\begin{itemize}
\item $X(e^{j\omega}) = F_s X_c\left(\frac{\omega}{2\pi}F_s\right)$
\item $Y(e^{j\omega}) = X(e^{j\omega})\,H(e^{j\omega})$
\item $Y_c(f) = (1/F_s)\,Y(e^{j2\pi f / F_s})$
\end{itemize}
\end{frame}
\begin{frame} \frametitle{Impulse invariance}
\[
\only<1>{Y_c(f) = X_c(f)\,H(e^{j2\pi f/ F_s})}
\only<2>{H_c(f) = H(e^{j2\pi f/ F_s})}
\]
\end{frame}
\begin{frame} \frametitle{Impulse invariance}
\note<1>{Impulse invariance lets us design\\ DT filters for use with CT signals. E.g. half-band filter remains half band}
\begin{figure}
\begin{dspPlot}[xtype=freq,xticks=custom]{0,1}{0,1.1}
\moocStyle
\dspFunc{x \dspRect{0}{1}}
\only<1>{\dspCustomTicks[axis=x]{0 0 0.5 $\pi/2$ 1 $\pi$}}
\only<2>{\dspCustomTicks[axis=x]{0 0 0.5 $F_s/4$ 1 $F_s/2$}}
\end{dspPlot}
\end{figure}
\end{frame}
\def\nbl#1{#1 sub 4 mul abs dup mul 0.5 mul 1 add 1 exch div }
\def\nblb#1{#1 sub dup abs 1 gt {pop 0} { 4 mul abs dup mul 0.5 mul 1 add 1 exch div} ifelse }
\begin{frame} \frametitle{DT processing of CT signals}
\setbeamercovered{invisible}
\begin{center}
\begin{figure}
% original spectrum
\begin{dspPlot}[sidegap=0,height=1.4cm,xticks=none,yticks=none,ylabel={$X_c(f)$}]{-5,5}{0,1.2}
\moocStyle
\dspFunc{x \nblb{0}}
\dspCustomTicks[axis=x]{0 0 1 $F_s/2$ -1 $-F_s/2$}
\end{dspPlot}
% periodized spectrum, in two steps
\uncover<2->{%
\begin{dspPlot}[xtype=freq,height=1.4cm,xticks=2,yticks=none,ylabel={$X(e^{j\omega})$}]{-1,1}{0,1.2}
\moocStyle
\only<2-3>{\dspFunc[linecolor=blue!80]{x \nblb{0}}}
\only<3>{\dspFunc[linecolor=green!70,linestyle=dashed]{x \dspRect{0}{1}}}
\only<4->{\dspFunc[linecolor=blue!80]{x \nblb{0} x \dspRect{0}{1} mul}}
\end{dspPlot}}
\uncover<5->{%
\begin{dspPlot}[sidegap=0,height=1.4cm,xticks=none,yticks=none,ylabel={$Y_c(f)$}]{-5,5}{0,1.2}
\moocStyle
\dspFunc{x \nblb{0} x \dspRect{0}{1} mul}
\dspCustomTicks[axis=x]{0 0 1 $F_s/2$ -1 $-F_s/2$}
\end{dspPlot}}
\end{figure}
\end{center}
\end{frame}
\begin{frame} \frametitle{Example}
\centering
quickly design a discrete-time filter to isolate a band of frequencies between 4000 and 5000Hz; \\
input signals are bandlimited to 7KHz.
\end{frame}
\begin{frame} \frametitle{Example}
\begin{itemize}
\item 7KHz band limit $\Rightarrow$ we can use any sampling frequency above 14KHz
\item pick $F_s = 16KHz$
\item we need a bandpass with a 1000Hz bandwidth
\item start with some lowpass with cutoff $f_c = 500$Hz
\item modulate it to center it on $f_0 = 4500$Hz
\end{itemize}
\end{frame}
\begin{frame} \frametitle{Impulse invariance}
\note<1>{Impulse invariance lets us design\\ DT filters for use with CT signals. E.g. half-band filter remains half band}
\begin{figure}
\begin{dspPlot}[xtype=freq,xticks=custom]{-1,1}{0,1.1}
\moocStyle
\only<1>{%
\dspFunc{x \dspRect{0}{0.125}}
\dspCustomTicks[axis=x]{0 0 0.0625 $~~~~500Hz$ 1 $8000Hz$}}
\only<2->{%
\dspFunc[linecolor=lightgray,linestyle=dashed,xmin=-.1,xmax=.1]{x \dspRect{0}{0.125}}
\dspFunc{x \dspRect{0.5625}{0.125} x \dspRect{-0.5625}{0.125} add}}
\only<2>{
\dspCustomTicks[axis=x]{0 0 0.0625 $~~~~500Hz$ 0.5625 $4500Hz$ 1 $8000Hz$}}
\only<3>{
\dspCustomTicks[axis=x]{0.0625 $~~\omega_c$ 0 0 0.5625 $\omega_0$ 1 $\pi$}}
\end{dspPlot}
\end{figure}
\end{frame}
\begin{frame} \frametitle{Example}
\begin{itemize}
\item $\omega_c = 2\pi\frac{f_c}{F_s} = 2\pi\frac{500}{16000} = 0.0625\pi$
\item $\omega_0 = 2\pi\frac{4500}{16000} = 0.5625\pi$
\item modulate the impulse response of an ideal lowpass with cutoss $\omega_c$ by $2\cos \omega_0 n$
\item truncate the impulse response with an appropriate window
\end{itemize}
\end{frame}
\begin{frame} \frametitle{Duality}
\note<1>{duality of impulse invariance \\ allows us to understand \\ the structure of DT operators \\ that are not intuitive to analyze in DT}
\setbeamercovered{invisible}
\begin{figure}[t]
\center %\small
\begin{dspBlocks}{1.5}{0.3}
$x[n]$~~ & \BDsinc[0.5em] & \BDfilter{$H_c(f)$} & \BDsamplerFramed[0.5em] & ~~$y[n]$ \\
& $T_s$ & & $T_s$ \\
\psset{linewidth=1.5pt}
\ncline{-}{1,1}{1,2}
\ncline{->}{1,2}{1,3}{\taput{$x_c(t)$}}
\ncline{1,3}{1,4}{\taput{$y_c(t)$}}
\ncline{->}{1,4}{1,5}
\psset{unit=1em}%\psgrid(40,20)
\psframe[linecolor=darkred,framearc=.3,linestyle=dashed](4,0.0)(27,7.5)
\dspText(27.5,0.0){\color{darkred}~$H(e^{j\omega})$}
\end{dspBlocks}
\end{figure}
\vspace{2em}
we can pick any $T_s$ so pick $T_s=1$:
\begin{itemize}
\item $X_c(f) = X(e^{j2\pi f})$
\item $Y_c(f) = X_c(f)H_c(f)$
\item LTI systems cannot change the bandwidth $\Rightarrow Y(e^{j\omega}) = Y_c(\frac{\omega}{2\pi})$
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Duality}
\[
\only<1>{Y(e^{j\omega}) = X(e^{j\omega})\,H_c\left(\frac{\omega}{2\pi}\right)}
\only<2>{H(e^{j\omega}) = H_c\left(\frac{\omega}{2\pi}\right)}
\]
\end{frame}
\def\ctfr{ abs 3 mul 2.5 exch exp 1 add 2 exch div }
\begin{frame} \frametitle{CT processing of DT signals}
\setbeamercovered{invisible}
\begin{center}
\begin{figure}
% original spectrum
\begin{dspPlot}[xtype=freq,height=1.4cm,xticks=3,yticks=none,ylabel={$X(e^{j\omega})$}]{-1,1}{0,1.2}
\moocStyle
\dspFunc[linecolor=blue!80]{x \dspPorkpie{0}{0.666666}}
\end{dspPlot}
% periodized spectrum, in two steps
\uncover<2->{
\begin{dspPlot}[sidegap=0,height=1.4cm,xticks=custom,yticks=none,ylabel={$X_c(f)$}]{-5,5}{0,1.2}
\moocStyle
\dspCustomTicks[axis=x]{0 0 1 $1/2$ -1 $-1/2$}
% spectrum
\only<2-3>{\dspFunc{x \dspPorkpie{0}{0.666666}}}
% filter
\only<3>{\dspFunc[linecolor=green!70,linestyle=dashed]{x \ctfr}}
\only<4->{\dspFunc{x \dspPorkpie{0}{0.666666} x \ctfr mul}}
\end{dspPlot}}
\uncover<5->{
\begin{dspPlot}[xtype=freq,height=1.4cm,xticks=3,yticks=none,ylabel={$Y(e^{j\omega})$}]{-1,1}{0,1.2}
\moocStyle
\dspFunc[linecolor=blue!80]{x \dspPorkpie{0}{0.666666} x \ctfr mul}
\end{dspPlot}}
\end{figure}
\end{center}
\end{frame}
%\begin{frame}
% \frametitle{Duality}
%
% \[
% \only<1>{Y(e^{j\omega}) = X(e^{j\omega})\,H_c(j\omega)}
% \only<2>{H(e^{j\omega}) = H_c(j\omega)}
% \]
%\end{frame}
\begin{frame} \frametitle{Delays in continuous time}
\begin{figure}[t]
\center %\small
\begin{dspBlocks}{1.5}{0.1}
$x(t)$~~ & \BDfilter{$H(f)$} & ~~$y(t) = x(t - d)$ \\
\psset{linewidth=1.5pt}
\ncline{-}{1,1}{1,2}
\ncline{->}{1,2}{1,3}
\end{dspBlocks}
\end{figure}
\vspace{2em}
\begin{itemize}
\item in continuous time, delays are well defined for all $d \in \mathbb{R}$
\item $H(f) = e^{-j2\pi d f}$
\end{itemize}
\end{frame}
\begin{frame} \frametitle{Interpretation of fractional delay by duality}
\begin{figure}[t]
\center %\small
\begin{dspBlocks}{1.5}{0.1}
$x[n]$~~ & \BDsinc[0.5em] & \BDfilter{$e^{-j2\pi d f}$} & \BDsamplerFramed[0.5em] & ~~$y[n]$ \\
\psset{linewidth=1.5pt}
\ncline{-}{1,1}{1,2}
\ncline{->}{1,2}{1,3}\taput{$x_c(t)$}
\ncline{1,3}{1,4}\taput{$y_c(t)$}
\ncline{->}{1,4}{1,5}
\end{dspBlocks}
\end{figure}
\vspace{2em}
\begin{itemize}
\item chain interpolates $x[n]$, delays the result by $d$ and resamples
\item equivalent filter $H(e^{j\omega}) = H_c(\omega/(2\pi)) = e^{-j\omega d}$
\item that's how a discrete-time fractional delay works internally
\end{itemize}
\end{frame}
\def\smooth{ 10 div 360 mul dup sin exch dup 2 mul sin exch dup mul 360 div sin add add 2.2 div 0.2 add }
\begin{frame} \frametitle{Example: fractional delay}
\begin{center}
\begin{figure}
\begin{dspPlot}[yticks=1,xticks=100,sidegap=0]{-4.5,7.5}{-0.8,1.2}
\moocStyle \SpecialCoor
\only<1>{%
\dspSignal{x \smooth}
\dspText(1,1.4){$x[n]$}}
\only<2>{%
\dspSignal[linecolor=blue!70]{x \smooth}
\multido{\n=-4+1}{12}{%
\dspFunc[linewidth=0.5pt,linecolor=blue!50]{x \dspSinc{\n}{1} \n \smooth mul}}}
\only<3->{\dspSignal[linecolor=lightgray!70]{x \smooth}}
\only<3>{%
\dspFunc{x \smooth}
\dspText(1,1.4){$x_c(t)$}}
\only<4-5>{%
\dspFunc{x 0.3 sub \smooth}
\dspText(1,1.4){$y_c(t)$}}
\only<5-6>{%
\dspSignal{x 0.3 sub \smooth}
\dspText(1,1.4){$y[n]$}}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\begin{frame} \frametitle{Example: fractional delay}
\begin{itemize}
\item $h[n] = \sinc(n-d)$
\item to delay a discrete-time signal by a fraction of a sample we need an ideal filter!
\item efficient approximations exist (e.g. cubic local interpolation)
\end{itemize}
\end{frame}
\begin{frame} \frametitle{Differentiation in continuous time}
\begin{figure}[t]
\center %\small
\begin{dspBlocks}{1.5}{0.1}
$x(t)$~~ & \BDfilter{$H(f)$} & ~~$y(t) = x'(t)$ \\
\psset{linewidth=1.5pt}
\ncline{-}{1,1}{1,2}
\ncline{->}{1,2}{1,3}
\end{dspBlocks}
\end{figure}
\vspace{2em}
\begin{itemize}
\item easy to show that $\FT{x'(t)} = j2\pi f\,X(f)$
\item $H(f) = j2\pi f$
\end{itemize}
\end{frame}
\begin{frame} \frametitle{By duality}
\begin{figure}[t]
\center %\small
\begin{dspBlocks}{1.5}{0.1}
$x[n]$~~ & \BDsinc[0.5em] & \BDfilter{$j2\pi f$} & \BDsamplerFramed[0.5em] & ~~$y[n]$ \\
\psset{linewidth=1.5pt}
\ncline{-}{1,1}{1,2}
\ncline{->}{1,2}{1,3}\taput{$x_c(t)$}
\ncline{1,3}{1,4}\taput{$y_c(t)$}
\ncline{->}{1,4}{1,5}
\end{dspBlocks}
\end{figure}
\vspace{2em}
\begin{itemize}
\item chain interpolates $x[n]$, differentiates the result and resamples
\item equivalent filter $H(e^{j\omega}) = H_c(\omega/(2\pi)) = j\omega$
\item equivalent filter defines a digital differentiator
\end{itemize}
\end{frame}
\begin{frame} \frametitle{Digital differentiator, magnitude response}
\begin{center}
$H(e^{j\omega}) = j\omega$
\begin{figure}
\begin{dspPlot}[xtype=freq,ylabel={$|H(e^{j\omega})|$}]{-1,1}{0, 1.2}
\moocStyle
\dspFunc{x abs}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\begin{frame} \frametitle{Digital differentiator, phase response}
\begin{center}
$H(e^{j\omega}) = j\omega$
\begin{figure}
\begin{dspPlot}[xtype=freq,xout=true,yticks=custom,ylabel={$\angle H(e^{j\omega})$}]{-1,1}{-4,4}
\moocStyle
\dspFunc{x 0 ge {3.14} {-3.14} ifelse}
\dspCustomTicks[axis=y]{-3.14 $-\pi/2$ 3.14 $\pi/2$}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\begin{frame} \frametitle{Digital differentiator, impulse response}
\begin{align*}
h[n] &= \frac{1}{2\pi}\int_{-\pi}^{\pi} j\omega e^{j\omega n} d\omega \\
&= \ldots \mbox{\em(integration by parts)} \ldots \\
&= \begin{cases} 0 & n=0 \\ \displaystyle\frac{(-1)^n}{n} & n \neq 0 \end{cases}
\end{align*}
\end{frame}
\begin{frame} \frametitle{Digital differentiator, impulse response}
\begin{center}
\begin{figure}
\begin{dspPlot}[xout=true]{-10,10}{-1.2,1.2}
\moocStyle
\dspSignal{x 0 eq {0} {x cvi 2 mod abs -1 exch exp x div} ifelse}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\begin{frame} \frametitle{Digital differentiator}
\begin{itemize}
\item the digital differentiator is again an ideal filter!
\item many approximations exist, with different properties
\end{itemize}
\end{frame}
%\begin{frame} \frametitle{Wrap up}
% \begin{itemize}
% \item Continuous-time processing of discrete-time sequences
% \item Discrete-time processing of continuous-time signals
% \item Jumping back and forth using sampling and interpolation
% \item In practice: Many applications of processing continuous-time signals in discrete time!
% \end{itemize}
%\end{frame}
\note{exercise: take the "standard" first difference approximation to the derivative y[n] = x[n]-x[n-1]/2 and compute the difference in magnitude for the frequency response wrt the ideal differentiator at $\omega=0.9\pi$}
\end{document}

Event Timeline