Page MenuHomec4science

4_DTFT.tex
No OneTemporary

File Metadata

Created
Thu, Mar 13, 13:07

4_DTFT.tex

\documentclass[aspectratio=169]{beamer}
\def\stylepath{../styles}
\usepackage{\stylepath/com303}
\begin{document}
\begin{frame}
\frametitle{Overview:}
\begin{itemize}
\item DTFT Existence
\item Properties
\item DTFT as basis expansion
\end{itemize}
\end{frame}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{frame}
\frametitle{Discrete-Time Fourier Transform}
\[
X(e^{j\omega}) = \sum_{n=-\infty}^{\infty} x[n]\, e^{-j\omega n}
\]
\begin{itemize}[<+->]
\item when does it exist?
\item is it a change of basis?
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Existence easy for absolutely summable sequences}
\note<1>{say abs summ implies finite energy\\ but not vice versa}
\begin{align*}
|X(e^{j\omega})| &= |\sum_{n=-\infty}^{\infty} x[n]\, e^{-j\omega n}| \\ \pause
&\leq \sum_{n=-\infty}^{\infty} |x[n]\, e^{-j\omega n}| \\ \pause
&= \sum_{n=-\infty}^{\infty} |x[n]| \\ \pause
&< \infty
\end{align*}
\end{frame}
\begin{frame}
\frametitle{Inversion easy for absolutely summable sequences}
\begin{align*}
\frac{1}{2\pi} \int_{-\pi}^{\pi} X(e^{j\omega})\,e^{j\omega n}d\omega
&= \frac{1}{2\pi} \int_{-\pi}^{\pi} \left( \sum_{k=-\infty}^{\infty} x[k]\, e^{-j\omega k} \right)e^{j\omega n}d\omega \\ \pause
&= \sum_{k=-\infty}^{\infty} x[k] \int_{-\pi}^{\pi} \frac{e^{j\omega (n-k)}}{2\pi}d\omega \\ \pause
&= x[n]
\end{align*}
\end{frame}
\begin{frame}
\frametitle{Inversion easy for absolutely summable sequences}
\begin{align*}
\int_{-\pi}^{\pi} \frac{e^{j\omega m}}{2\pi}d\omega &= \frac{1}{2\pi}\int_{-\pi}^{\pi} d\omega = 1 \qquad \mbox{for $m = 0$} \\[2em]
&= \frac{1}{2\pi} \frac{1}{jm} \left. e^{j\omega m} \right|_{-\pi}^{\pi} \\
&= \frac{1}{2\pi} \frac{1}{jm} \left(e^{j\pi m} - e^{-j\pi m}\right) = 0 \qquad \mbox{otherwise}
\end{align*}
\end{frame}
%%%% 1st EDITION SLIDE FLOW %%%%%
%%%%%%%%%%% Intuition by periodization %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\intertitle{the DTFT as the limit of the DFS}
\begin{frame} \frametitle{Synopsis}
\begin{itemize}[<+->]
\item $x[n]$ absolutely summable $\Rightarrow X(e^{j\omega})$ exists formally
\item $x[n]$ absolutely summable $\Rightarrow $ we can {\em periodize}\/ it into $\tilde{x}_N[n]$
\item natural Fourier representation for $\tilde{x}_N[n]$ is DFS
\item DFS of $\tilde{x}_N[n]$ turns out to be $X(e^{j\omega})$ at $\omega=(2\pi/N)k$
\item as $N$ grows to infinity $\tilde{x}_N[n]$ becomes $x[n]$
\item as $N$ grows to infinity natural Fourier representation becomes $X(e^{j\omega})$
\end{itemize}
\end{frame}
\begin{frame} \frametitle{Some intuition}
\centering
With $x[n]$ absolutely summable we can build arbitrarily ``periodized'' sequences:
\[
\tilde{x}_N[n] = \sum_{p=-\infty}^{\infty} x[n + pN]
\]
\vspace{2em}\pause
clearly $\tilde{x}_N[n] = \tilde{x}_N[n + N]$
\end{frame}
%% absolutely summable signal
\def\sig#1{dup \dspPorkpie{#1}{10} 0.2 mul exch #1 sub 2 div dup mul 1 add 1 exch div sub -1 mul }
%% periodization
\def\perSig#1{ 0 -80 #1.0 80 {/i exch def x \sig{i} add } for }
\begin{frame} \frametitle{Periodization}
\begin{center}
\vphantom{Let $N$ grow large...}
\begin{figure}
\begin{dspPlot}[xticks=100,yticks=none,sidegap=0]{-50,50}{-.2, 1.2}
\moocStyle
\only<1-4>{\dspFunc{x \sig{0}}}
\only<2-5>{\dspFunc[linecolor=red!50]{x \sig{10}}}
\only<3-5>{\dspFunc[linecolor=red!50]{x \sig{20}}}
\only<4-5>{\dspFunc[linecolor=red!50]{x \sig{30}}}
\only<5-6>{\multido{\n=-80+10}{16}{\dspFunc[linecolor=red!50]{x \sig{\n}}}}
\only<6-7>{\dspFunc[linecolor=blue!70]{\perSig{10} }}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
%# widening periodization
\def\perSigSlide#1#2{\only<#1>{%
\multido{\n=-80+#2}{16}{\dspFunc[linecolor=red!50]{x \sig{\n}}}
\dspFunc[linecolor=blue!70]{0 -80 #2.0 80 {/i exch def x \sig{i} add } for }
\dspText(60,0.5){$N=#2$}}}
\begin{frame} \frametitle{Periodization}
\begin{center}
\only<1-4>{Let $N$ grow large...}
\only<5->{... as $N$ grows, $\tilde{x}_N[n] \rightarrow x[n]$}
\begin{figure}
\begin{dspPlot}[xticks=100,yticks=none,sidegap=0]{-50,50}{-.2, 1.2}
\moocStyle
\perSigSlide{1}{10}
\perSigSlide{2}{16}
\perSigSlide{3}{20}
\perSigSlide{4}{40}
\perSigSlide{5}{80}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\begin{frame} \frametitle{From DFS to DTFT}
\note<2>{ remark that we can always add full multiples of $2\pi$\\
to a complex exponential in the last line \\ \vspace{2em}
also, remark on the exchange of the summations}
%
Natural spectral representation for $\tilde{x}_N[n]$ is the DFS:
\begin{align*}
\tilde{X}[k] &= \sum_{n=0}^{N-1} \tilde{x}_N[n] e^{-j\frac{2\pi}{N}nk} \\ \pause
&= \sum_{n=0}^{N-1} \sum_{p = -\infty}^{\infty} x[n +pN] e^{-j\frac{2\pi}{N}nk} \\ \pause
&= \sum_{p = -\infty}^{\infty} \sum_{n=0}^{N-1} x[n +pN] e^{-j\frac{2\pi}{N}(n+pN)k}
\end{align*}
\hspace{24em}\small (remember $e^{j\alpha} = e^{j(\alpha + 2K\pi)} \quad \forall K$)
\end{frame}
\begin{frame} \frametitle{From double sum to single sum}
\centering
we can always write for all $N \in \mathbb{N}^{+}$
\[
\sum_{m=-\infty}^{\infty} y[m] = \sum_{p=-\infty}^{\infty} \sum_{n=0}^{N-1} y[n + pN]
\]
\end{frame}
\begin{frame} \frametitle{Example (N=4)}
\centering
\Large
$p$~~
\begin{tabular}{c||c|c|c|c|}
\multicolumn{5}{c}{$n$} \\
& 0 & 1 & 2 & 3 \\ \hline\hline
& & & & \\ \hline
$\ldots$ & & & & \\ \hline
-1 & & & & \\ \hline
0 & \only<2->{0} & \only<3->{1} & \only<4->{2} & \only<5->{3} \\ \hline
1 & \only<6->{4} & \only<7->{5} & \only<8->{6} & \only<9->{7} \\ \hline
2 & & & & \\ \hline
$\ldots$ & & & & \\ \hline
& & & &
\end{tabular}
\hspace{3em}$m=n+4p$
\end{frame}
\begin{frame} \frametitle{Example (N=4)}
\centering
\Large
$p$~~
\begin{tabular}{c||c|c|c|c|}
\multicolumn{5}{c}{$m$} \\
& 0 & 1 & 2 & 3 \\ \hline\hline
& & & & \\ \hline
$\ldots$ & & & & \\ \hline
-1 & -4 & -3 & -2 & -1 \\ \hline
0 & 0 & 1 & 2 & 3 \\ \hline
1 & 4 & 5 & 6 & 7 \\ \hline
2 & 8 & 9 & 10 & 11 \\ \hline
$\ldots$ & & & & \\ \hline
& & & &
\end{tabular}
\hspace{3em}$n=4p+m$
\end{frame}
\begin{frame} \frametitle{From DFS to DTFT}
\begin{align*}
\tilde{X}[k] &= \sum_{p = -\infty}^{\infty} \sum_{n=0}^{N-1} x[n +pN] e^{-j\frac{2\pi}{N}(n+pN)k} \\ \pause
&= \sum_{m = -\infty}^{\infty} x[m] e^{-j\frac{2\pi}{N}km} \\ \pause
&= X(e^{j\omega})|_{\omega = \frac{2\pi}{N}k}
\end{align*}
\end{frame}
%# widening periodization
\def\perSigSlide#1#2{\only<#1>{%
\multido{\n=-80+#2}{16}{\dspFunc[linecolor=red!30]{x \sig{\n}}}
\dspSignal[linecolor=blue!70]{0 -80 #2.0 80 {/i exch def x \sig{i} add } for }
\dspText(60,0.5){$N=#2$}}}
\begin{frame} \frametitle{From DFS to DTFT}
\centering
\begin{dspPlot}[height=2cm,xticks=none,yticks=none,sidegap=0]{-50,50}{-.2, 1.2}
\moocStyle
\only<1>{\dspSignal{x \sig{0}}}
\perSigSlide{2}{10}
\perSigSlide{3}{20}
\perSigSlide{4}{40}
\perSigSlide{5}{80}
\end{dspPlot}
\vspace{2em}
\begin{dspPlot}[height=2cm,xtype=freq,xticks=4,yticks=none,sidegap=0]{-1,1}{0, 1.4}
\moocStyle
\dspFunc[linecolor=red!50]{x \dspPorkpie{0}{.8}}
\only<2>{\dspSignal[plotpoints=10,linecolor=blue!70]{x \dspPorkpie{0}{.8}}}
\only<3>{\dspSignal[plotpoints=20,linecolor=blue!70]{x \dspPorkpie{0}{.8}}}
\only<4>{\dspSignal[plotpoints=40,linecolor=blue!70]{x \dspPorkpie{0}{.8}}}
\only<5>{\dspSignal[plotpoints=80,linecolor=blue!70]{x \dspPorkpie{0}{.8}}}
\end{dspPlot}
\end{frame}
\begin{frame} \frametitle{From DFS to DTFT}
\begin{itemize}[<+->]
\item we're comfortable with DFS: change of basis, energy conservation, etc.
\item as $N$ grows, $\tilde{x}_N[n] \rightarrow x[n]$ and the spectral representation ``becomes'' the DTFT
\item we can retain the ``change of basis'' paradigm for the DTFT
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Review: DFT}
\note<1>{Idea now is to contextualize the next step\\ i.e. extending the basis-expansion paradigm\\ at least formally to the DTFT. To do so \\ we first recall the vector spaces involved \\ in the DFT and DFS and associated analysis \\
and synthesis formulas}
\begin{center}
\begin{figure}
\psset{linewidth=1pt}
\begin{dspBlocks}{4}{0.2}
\circlenode{A}{~~$\mathbb{C}^{N}$~~} & & \circlenode{B}{~~$\mathbb{C}^{N}$~~}
\end{dspBlocks}
\end{figure}
\ncarc[nodesep=3pt,arcangle=45]{->}{A}{B}\only<2->{\naput{$X[k] = \langle e^{j\frac{2\pi}{N}nk}, x[n] \rangle$}}
\ncarc[nodesep=3pt,arcangle=45]{->}{B}{A}\only<3->{\naput{$x[n] = (1/N)\sum X[k]\,e^{j\frac{2\pi}{N}nk}$}}
\ncline[linestyle=none]{A}{B}\only<4->{\ncput{basis: $\{e^{j\frac{2\pi}{N}nk}\}_k$}}
\end{center}
\end{frame}
\begin{frame}
\frametitle{Review: DFS}
\begin{center}
\begin{figure}
\psset{linewidth=1pt}
\begin{dspBlocks}{4}{0.2}
\circlenode{A}{~~$\tilde{\mathbb{C}}^{N}$~~} & & \circlenode{B}{~~$\mathbb{C}^{N}$~~}
\end{dspBlocks}
\end{figure}
\ncarc[nodesep=3pt,arcangle=45]{->}{A}{B}\naput{$\tilde{X}[k] = \langle e^{j\frac{2\pi}{N}nk}, \tilde{x}[n] \rangle$}
\ncarc[nodesep=3pt,arcangle=45]{->}{B}{A}\naput{$\tilde{x}[n] = (1/N)\sum \tilde{X}[k]\,e^{j\frac{2\pi}{N}nk}$}
\ncline[linestyle=none]{A}{B}\ncput{basis: $\{e^{j\frac{2\pi}{N}nk}\}_k$}
\end{center}
\end{frame}
\begin{frame} \frametitle{What about the DTFT?}
Intuitive interpretation:
\begin{itemize}[<+->]
\item formally the DTFT looks just like an inner product in $\mathbb{C}^\infty$:
\[
\sum_{n=-\infty}^{\infty} x[n]\, e^{-j\omega n} = \langle e^{j\omega n}, x[n] \rangle
\]
\item the ``basis'' is an infinite, uncountable set: $\{e^{j\omega n}\}_{\omega \in \mathbb{R}}$
\item something ``breaks down'': we start with sequences but the transform is a function
\item we used absolutely summable sequences but DTFT exists for all square-summable sequences (proof is rather technical)
\end{itemize}
\end{frame}
\begin{frame} \frametitle{The actual deal}
A mathematically precise interpretation
\begin{itemize}[<+->]
\item we \textit{start} in $L_2([-\pi,\pi])$
\item the countable set $\{e^{-j\omega n}\}_{n \in \mathbb{Z}}$ is an orthogonal basis for $L_2([-\pi,\pi])$
\item basis expansion coefficients are the inner products
\[
\langle e^{-j\omega n}, X(e^{j\omega}) \rangle = \frac{1}{2\pi} \int_{-\pi}^{\pi} X(e^{j\omega})\,e^{j\omega n}d\omega = x[n]
\]
\item any element of $L_2([-\pi,\pi])$ is equivalent to a square summable sequence $x[n] \in \ell_2(\mathbb{Z})$
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{DTFT}
\begin{center}
\begin{figure}
\psset{linewidth=1pt}
\begin{dspBlocks}{4}{0.2}
\circlenode{A}{~~$\ell_2(\mathbb{Z})$~~} & & \circlenode{B}{$L_2([-\pi,\pi])$}
\end{dspBlocks}
\end{figure}
\ncarc[nodesep=3pt,arcangle=45]{->}{A}{B}\naput{$X(e^{j\omega}) = \langle e^{j\omega n}, x[n] \rangle$}
\ncarc[nodesep=3pt,arcangle=45]{->}{B}{A}\naput{$x[n] = (1/2\pi)\int X(e^{j\omega})e^{j\omega n}d\omega$}
\ncline[linestyle=none]{A}{B}\ncput{``basis'': $\{e^{j\omega n}\}_\omega$}
\end{center}
\end{frame}
\begin{frame}
\frametitle{DTFT properties}
\note<1>{if we look at the DTFT as a formal change\\ of basis, the following properties \\ are naturally derived}
\begin{itemize}[<+->]
\item linearity
\[
\mbox{DTFT}\{\alpha x[n] + \beta y[n]\} = \alpha X(e^{j\omega}) + \beta Y(e^{j\omega})
\]
\item time shift
\[
\mbox{DTFT}\{x[n-M]\} = e^{-j\omega M} X(e^{j\omega})
\]
\item modulation (dual)
\[
\mbox{DTFT}\{e^{j\omega_0 n}\,x[n]\} = X(e^{j(\omega-\omega_0)})
\]
\end{itemize}
\end{frame}
\begin{frame} \frametitle{DTFT properties}
\begin{itemize}[<+->]
\item time reversal
\[
\mbox{DTFT}\{x[-n]\} = X(e^{-j\omega})
\]
\item conjugation
\[
\mbox{DTFT}\{ x^*[n]\} = X^*(e^{-j\omega})
\]
\end{itemize}
\end{frame}
\begin{frame} \frametitle{Some particular cases:}
\begin{itemize}[<+->]
\item if $x[n]$ is symmetric, the DTFT is symmetric:
\[
x[n] = x[-n] \Longleftrightarrow X(e^{j\omega}) = X(e^{-j\omega})
\]
\item if $x[n]$ is real, the DTFT is Hermitian-symmetric:
\[
x[n] = x^*[n] \Longleftrightarrow X(e^{j\omega}) = X^*(e^{-j\omega})
\]
\item in other words: if $x[n]$ is real, the magnitude of the DTFT is symmetric:
\[
x[n] \in \mathbb{R} \Longleftrightarrow |X(e^{j\omega})| = |X(e^{-j\omega})|
\]
\item finally, if $x[n]$ is real and symmetric, the DTFT is also real and symmetric!
\end{itemize}
\end{frame}
\begin{frame} \frametitle{DTFT as basis expansion}
Some things are OK:
\begin{itemize}[<+->]
\item $\DFT{\delta[n]} = 1$
\item $\DTFT{\delta[n]} = \langle e^{j\omega n}, \delta[n] \rangle = 1$
\end{itemize}
\end{frame}
\begin{frame} \frametitle{DTFT as basis expansion}
Some things aren't:
\begin{itemize}[<+->]
\item $\DFT{1} = \delta[n]$
\item $\DTFT{1} = \sum_{n=-\infty}^{\infty} e^{-j\omega n} = ?$
\vspace{2em}
\item problem: too many interesting sequences are {\em not} square summable!
\end{itemize}
\end{frame}
\intertitle{The DTFT of the Karplus-Strong output}
%% x[n] = 2n/(N-1) - 1
\def\sawTD#1{ cvi 32 mod 2 mul #1 1 sub div 1 sub}
\begin{frame}
\frametitle{Karplus-Strong revisited}
\begin{center}
\begin{figure}
\begin{dspBlocks}{2}{1}
% 1 2 3 4 5
$x[n]~~$ & \BDadd & & \BDsplit & $~~y[n]$ \\
& & \BDdelayN{M} & &
\ncline{->}{1,1}{1,2}\ncline{->}{1,2}{1,5}
\ncline{->}{2,2}{1,2}\ncline{2,2}{2,3}\taput{$\alpha$}\ncline{2,3}{2,4}
\ncline{2,4}{1,4}
\end{dspBlocks}
\end{figure}
\end{center}
\vspace{1em}
\[
y[n] = \alpha\,y[n-M] + x[n]
\]
\end{frame}
\begin{frame}
\frametitle{Karplus-Strong revisited}
\begin{itemize}[<+->]
\item choose a signal $\bar{x}[n]$ that is nonzero only for $0 \leq n < M$
\item generated signal is infinite-length but not periodic:
\[
y[n] = \rnode{A}{\bar{x}[0]}, \bar{x}[1], \ldots, \rnode{B}{\bar{x}[M-1]}, \rnode{C}{\alpha \bar{x}[0]}, \alpha \bar{x}[1], \ldots, \rnode{D}{\alpha \bar{x}[M-1]}, \rnode{E}{\alpha^2 \bar{x}[0]}, \alpha^2 \bar{x}[1], \ldots \rnode{F}{\phantom{\bar{x}[1]}}
\]
\only<2->{
\SpecialCoor
\psbrace[linecolor=blue,ref=C,nodesep=2ex,rot=90](!\psGetNodeCenter{A} A.x A.y 3 sub)(!\psGetNodeCenter{B} B.x B.y 3 sub){$1^{\mbox{st}}$ period}
\psbrace[linecolor=blue,ref=C,nodesep=2ex,rot=90](!\psGetNodeCenter{C} C.x C.y 3 sub)(!\psGetNodeCenter{D} D.x D.y 3 sub){$2^{\mbox{nd}}$ period}
\psbrace[linecolor=blue,ref=C,nodesep=2ex,rot=90](!\psGetNodeCenter{E} E.x E.y 3 sub)(!\psGetNodeCenter{F} F.x F.y 3 sub){$\ldots$}}
\vspace{2em}
\item what is the DTFT of this signal?
\end{itemize}
\end{frame}
%% x[n] = 2n/(N-1) - 1
\def\sawTD#1{ cvi 32 mod 2 mul #1 1 sub div 1 sub}
%% X[k] = 0 if k=0, (N/N-1)(-1 + jcot(pi/N)k
\def\sawFM#1{ dup 0 eq {pop 0} {180 #1 div mul dup cos exch sin div dup mul 1 add sqrt #1 #1 1 sub div mul} ifelse}
\begin{comment}
\begin{frame}
\frametitle{Example: 32-tap sawtooth wave}
\begin{center}
\begin{figure}
\begin{dspPlot}[xticks=16]{0,31}{-1.2, 1.2}
\moocStyle
\dspSignal{x \sawTD{32.0}}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\begin{frame}
\frametitle{Example: DFT of 32-tap sawtooth wave}
\begin{center}
\begin{figure}
\begin{dspPlot}[xticks=16,yticks=5]{0,31}{0, 12}
\moocStyle
\dspSignal{x \sawFM{32.0}}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\begin{frame}
\frametitle{What if we take the DFT of two periods?}
\begin{center}
\begin{figure}
\begin{dspPlot}[xticks=16,xout=true]{0,63}{-1.2, 1.2}
\moocStyle
\dspSignal{x \sawTD{32.0 }}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\end{comment}
\begin{frame}
\frametitle{KS revisited: 32-tap sawtooth wave}
\begin{center}
$ x[n] = 2n/(M-1) -1, \quad n = 0, 1, \ldots, M-1 $
\begin{figure}
\begin{dspPlot}[xticks=16]{0,31}{-1.2, 1.2}
\moocStyle
\dspSignal{x \sawTD{32.0}}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\begin{frame}
\frametitle{KS revisited: decay $\alpha=0.9$}
\begin{center}
$ y[n] = \alpha^{\lfloor n/M \rfloor}\bar{x}[n \mod M] \, u[n]$
\begin{figure}
\begin{dspPlot}[xout=true]{0,1000}{-1.2, 1.2}
\moocStyle
\dspFunc{x \sawTD{32.0} x cvi 32 idiv 0.9 exch exp mul}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\begin{frame} \frametitle{DTFT of KS signal}
\begin{align*}
Y(e^{j\omega}) &= \sum_{n=-\infty}^{\infty} y[n]\, e^{-j\omega n}
\end{align*}
\end{frame}
\begin{frame} \frametitle{Same trick we used before:}
\[
\sum_{m=-\infty}^{\infty} y[m] = \sum_{p=-\infty}^{\infty} \sum_{n=0}^{N-1} y[n + pN]
\]
\end{frame}
\begin{frame} \frametitle{DTFT of KS signal}
\begin{align*}
Y(e^{j\omega}) &= \sum_{n=-\infty}^{\infty} y[n]\, e^{-j\omega n} \\ \pause
&= \sum_{p=0}^{\infty} \sum_{m=0}^{M-1} \alpha^p \bar{x}[m] \, e^{-j\omega (pM + m)} \\ \pause
&= \sum_{p=0}^{\infty} \alpha^p e^{-j\omega Mp} \sum_{m=0}^{M-1} \bar{x}[m] e^{-j\omega m} \\ \pause
&= \sum_{p=0}^{\infty} \alpha^p e^{-j\omega Mp} \sum_{m=-\infty}^{\infty} \bar{x}[m] e^{-j\omega m} \\ \pause
&= A(e^{j\omega M})\,\bar{X}(e^{j\omega})
\end{align*}
\end{frame}
%% mag^2 = 1/(1 + a^2 - 2a cos w)
\def\a{0.9 }
\def\magA{ 180 mul cos \a -2 mul mul \a \a mul 1 add add sqrt 1 exch div }
\begin{frame}
\frametitle{We know the first term}
\begin{center}
$A(e^{j\omega}) = \DTFT{\alpha^n \, u[n]} = \frac{1}{1-\alpha e^{-j\omega}}$
\begin{figure}
\begin{dspPlot}[xtype=freq,yticks=none,ylabel={$|A(e^{j\omega})|$}]{-1,1}{0, 11}
\moocStyle
\dspFunc{x \magA}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\def\reps#1#2{\only<#1>{\dspFunc[plotpoints=5000]{x #2 mul \magA }
\dspText(1.2,5){$M=#2$}}}
\begin{frame}
\frametitle{We know the first term}
\begin{center}
$A(e^{j\omega M})$ rescales the frequency axis: {\color{red} periodicity!}
\begin{figure}
\begin{dspPlot}[xtype=freq,yticks=none,ylabel={$|A(e^{j\omega M})|$}]{-1,1}{0, 11}
\moocStyle
\reps{1}{1}
\reps{2}{2}
\reps{3}{3}
\reps{4}{12}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
%% magnitude:
%% r(\omega) = (N-1)*cos((N+1)*w) - (N+1)*cos(N*w) + (N+1)*cos(w) -(N-1);
%% i(\omega) = -(N-1)*sin((N+1)*w) + (N+1)*sin(N*w) - (N+1)*sin(w);
%% m(\omega) = 1/(N-1) * (1/4)(1+cot^2(w/2)) * sqrt(r*r + i*i)
\def\N{32.0 }
\def\magX{ /w exch 180 mul def %
/r \N 1 sub \N 1 add w mul cos mul
\N 1 add \N w mul cos -1 mul mul
\N 1 add w cos mul
\N 1 sub -1 mul
add add add
def
/i \N 1 sub \N 1 add w mul sin -1 mul mul
\N 1 add \N w mul sin mul
\N 1 add w sin -1 mul mul
add add
def
w 2 div dup cos exch sin div dup mul 1 add r r mul i i mul add sqrt mul 4 \N 1 sub mul div }
\begin{frame}
\frametitle{Second term is left as an exercise}
\[
\bar{X}(e^{j\omega}) = e^{-j\omega}\left(\frac{M+1}{M-1}\right)\frac{1-e^{-j(M-1)\omega}}{(1-e^{-j\omega})^2} - \frac{1-e^{-j(M+1)\omega}}{(1-e^{-j\omega})^2}
\]
\begin{center}
\begin{figure}
\begin{dspPlot}[xtype=freq,yticks=none,ylabel={$|\bar{X}(e^{j\omega})|$}]{-1,1}{0, 16}
\moocStyle
\dspFunc{x \magX}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\begin{frame}
\frametitle{DTFT of KS with decay}
\note<1>{Length of the repetion gives the spectral line pattern: \\ ``periodic'' component, i.e. the pitch\\
Shape of the sawtooth gives the overall spectral shape/decay \\ (timbre)}
\[
Y(e^{j\omega}) = A(e^{j\omega M})\bar{X}(e^{j\omega})
\]
\begin{center}
\begin{figure}
\begin{dspPlot}[xtype=freq,yticks=none,ylabel={$|Y(e^{j\omega})|$}]{-1,1}{0, 120}
\moocStyle
\dspFunc[plotpoints=5000]{x \N mul \magA x \magX mul }
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\end{document}

Event Timeline