Page MenuHomec4science

3_basis.tex
No OneTemporary

File Metadata

Created
Sat, Mar 15, 09:51

3_basis.tex

\documentclass[aspectratio=169]{beamer}
\def\stylepath{../styles}
\usepackage{\stylepath/com303}
%\setbeameroption{show only notes}\def\logoEPFL{}
%\setbeameroption{show notes}
\begin{document}
\begin{frame}
\frametitle{The Fourier Basis for $\mathbb{C}^N$}
\centering
Claim: the set of $N$ signals in $\mathbb{C}^N$
\[
w_k[n] = e^{j\frac{2\pi}{N}nk}, \qquad n, k = 0, 1, \ldots, N-1
\]
is an orthogonal basis in $\mathbb{C}^N$.
\end{frame}
\begin{frame}
\frametitle{The Fourier Basis for $\mathbb{C}^N$}
\centering
Claim: the set of $N$ signals in $\mathbb{C}^N$
\[
w_k[n] = e^{j\frac{2\pi}{N}nk}, \qquad n, k = 0, 1, \ldots, N-1
\]
is an orthogonal basis in $\mathbb{C}^N$.
\end{frame}
\begin{frame}
\frametitle{The Fourier Basis for $\mathbb{C}^N$}
\centering
In vector notation:
\[
\{\mathbf{w}^{(k)}\}_{k = 0, 1, \ldots, N-1}
\]
with
\[
w^{(k)}_n = e^{j\frac{2\pi}{N}nk} %, \qquad n = 0, 1, \ldots, N-1,
\]
is an orthogonal basis in $\mathbb{C}^N$
\end{frame}
\def\ceStep#1{% define \a (freq) and \p (initial phase)
\FPupn\np{1 #1 - clip} \FPupn\anp{\np{} \a{} * \p{} + clip} \FPupn\anpp{\a{} \anp{} - clip}%
\only<#1->{\dspCPCirclePoint[linecolor=lightgray,toorg=true]{1}{\anpp}{}}
\only<#1>{\dspCPCirclePoint[linecolor=red,toorg=true]{1}{\anp}{$w_1[\np]$}
\dspCPArc{0.6}{\anpp}{\anp}{{\tiny $2\pi/N$}}}}
\begin{frame}
\frametitle{Recall the complex exponential generating machine...}
\begin{center}
\begin{figure}
\begin{dspPZPlot}[width=6cm,circle=0,xticks=none,yticks=none]{1.5}
\dspCPCircle[linewidth=0.5pt,linecolor=lightgray]{0,0}{1}
\def\a{30}\def\p{0}
\only<1>{\dspCPCirclePoint[linecolor=red,toorg=true]{1}{\p}{$w_1[0]$}}
\multido{\n=2+1}{5}{\ceStep{\n}}
\end{dspPZPlot}
\end{figure}
\end{center}
\end{frame}
\def\basisVectorImp#1#2#3{
\begin{frame}
\frametitle{Basis vector $\mathbf{w}^{(#1)} \in \mathbb{C}^{64}$}
\begin{center}
\begin{figure}
\begin{dspPlot}[yticks=1,xticks=32,width=8cm,height=2.5cm,ylabel={Re},xout=true]{0, 63}{-1.1, 1.1}
\moocStyle
\dspSignal{x 360 mul 64 div #1 mul cos}
\dspFunc[linewidth=0.5pt,linecolor=blue!60,linestyle=#3]{x 360 mul 64 div #1 mul cos}
\dspText(80,-1.8){$\displaystyle\omega_{#1}=#2$}
\end{dspPlot}
\end{figure}
\begin{figure}
\begin{dspPlot}[yticks=1,xticks=32,width=8cm,height=2.5cm,ylabel={Im},xout=true]{0, 63}{-1.1, 1.1}
\moocStyle
\dspSignal{x 360 mul 64 div #1 mul sin}
\dspFunc[linewidth=0.5pt,linecolor=blue!60,linestyle=#3]{x 360 mul 64 div #1 mul sin}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
}
\def\basisVector#1{\basisVectorImp{#1}{2\pi\,\frac{#1}{64}}{none}}
\def\basisVectorShow#1{\basisVectorImp{#1}{2\pi\,\frac{#1}{64}}{solid}}
\def\basisVectorFreq#1#2{\basisVectorImp{#1}{#2}{none}}
\basisVectorFreq{0}{0}
\basisVectorFreq{1}{\frac{2\pi}{64}}
\basisVector{2}
\basisVector{3}
\basisVector{4}
\basisVector{5}
\basisVector{16}\basisVectorShow{16}
\basisVector{20}\basisVectorShow{20}
\basisVector{30}\basisVectorShow{30}
\basisVector{31}\basisVectorShow{31}
\basisVector{32}\basisVectorShow{32}
\basisVector{33}
\basisVector{34}
\basisVector{60}
\basisVector{61}
\basisVector{62}
\basisVector{63}
\begin{frame}
\frametitle{Proof of orthogonality}
\note<1>{Probably want to write by hand the reminder:
\[
\sum_{n = 0}^{N-1} a^n = \frac{1-a^N}{1-a}
\]}
\begin{align*}
\langle \mathbf{w}^{(k)}, \mathbf{w}^{(h)} \rangle
\uncover<2->{&= \sum_{n = 0}^{N-1} (e^{j\frac{2\pi}{N}nk})^* \, e^{j\frac{2\pi}{N}nh}} \\
\uncover<3->{ &= \sum_{n = 0}^{N-1} e^{j\frac{2\pi}{N}(h-k)n} } \\
\uncover<4->{ &= \left\{\begin{array}{ll}
N & \mbox{for $h=k$}\\
\displaystyle\frac{1- e^{j 2\pi (h-k)}}{1 - e^{j\frac{2\pi}{N}(h-k)}} = 0 & \mbox{otherwise}
\end{array}\right. }
\end{align*}
\end{frame}
\begin{frame}
\frametitle{Remarks}
\begin{itemize}[<+->]
\item $N$ orthogonal vectors $\longrightarrow$ basis for $\mathbb{C}^{N}$
\item vectors are not ortho{\em normal}. Normalization factor would be $1/\sqrt{N}$
\end{itemize}
\end{frame}
\end{document}
\begin{frame}
\frametitle{Binary quadratic forms}
\[
Q(x_0,x_1) = ax_0^2 + 2b\,x_0x_1 + cx_1^2
\]
\vspace{2em}
\pause
\begin{align*}
Q(\mathbf{x}) &= \begin{bmatrix} x_0 & x_1 \end{bmatrix}
\begin{bmatrix} a & b \\ b & c \end{bmatrix} \begin{bmatrix} x_0 \\ x_1 \end{bmatrix} \\
&= \mathbf{x}^T \mathbf{A} \mathbf{x}
\end{align*}
\end{frame}
\begin{frame}
\frametitle{Curves on the plane}
\begin{columns}
\begin{column}{.4\paperwidth}
Intersection of the quadratic form with a plane gives a conic curve. Eg. plot
\[
Q(\mathbf{x}) = 1
\]
with
\[
\mathbf{A} = \begin{bmatrix}
7 & 2\sqrt{3} \\
2\sqrt{3} & 3 \\
\end{bmatrix}
\]
\vspace{1em}
\only<3>{Not easy to parametrize the rotated ellipse}
\end{column}
\begin{column}{.5\paperwidth}
\begin{figure}
\begin{dspPZPlot}[xticks=none,yticks=none,circle=0,cunits=false,width=5cm]{2}
\psset{linecolor=darkred}
\only<2->{
\pscustom{
\rotate{30}
% x^2/3^2 + y^2/1^2 = 1
\psellipse(1.5,0.5)}}
\end{dspPZPlot}
\end{figure}
\end{column}
\end{columns}
\end{frame}
\begin{frame}
\frametitle{Principal axis theorem}
\begin{columns}
\begin{column}{.4\paperwidth}
\begin{itemize}[<+->]
\item $\mathbf{A}$ real, symmetric $\longrightarrow$ diagonalize
\item find normalized eigenvectors $\mathbf{v}^{(0)},\mathbf{v}^{(1)}$
\item diagonalization matrix $\mathbf{R} = [\mathbf{v}^{(0)}\,\mathbf{v}^{(1)}]$
\item $\mathbf{D} = \mbox{diag}\{e, f\} = \mathbf{R}^T\mathbf{A}\mathbf{R}$
\item $Q(\mathbf{x}_r) = ex_{0,r}^2 + fx_{1,r}^2 = 1$
\item radii: $1/\sqrt{e}$ and $1/\sqrt{f}$
\end{itemize}
\end{column}
\begin{column}{.5\paperwidth}
\begin{figure}
\begin{dspPZPlot}[xticks=none,yticks=none,circle=0,cunits=false,width=5cm]{2}
\only<1-4>{%
\psset{linecolor=darkred}
\pscustom{
\rotate{30}
\psellipse(1.5,0.5)}}
\only<5->{
\psset{linecolor=green}
\pscustom{
\psellipse(1.5,0.5)}}
\only<6->{
\dspText(1.9,0.2){\color{green} $1/\sqrt{e}$}
\dspText(0.5,0.7){\color{green} $1/\sqrt{f}$}}
\end{dspPZPlot}
\end{figure}
\end{column}
\end{columns}
\end{frame}
\begin{frame}
\frametitle{What did we just do?}
\[
\mathbf{x}_r^T \mathbf{D} \mathbf{x}_r = (\mathbf{Rx})^T \mathbf{A} (\mathbf{Rx})
\]
\begin{itemize}[<+->]
\item $\mathbf{R}$ is a change of basis matrix
\item $\mathbf{R}$ rotates and aligns the reference system with the ellipse
\end{itemize}
\end{frame}
\begin{frame}
\frametitle{Change of basis: change of perspective}
\begin{columns}
\begin{column}{.4\paperwidth}
\[
\mathbf{A} = \begin{bmatrix}
7 & 2\sqrt{3} \\
2\sqrt{3} & 3 \\
\end{bmatrix}
\]
\uncover<2->{Rotate the reference by 30 degrees:
\[
\mathbf{R} = \begin{bmatrix}
\cos \theta & -\sin\theta \\
\sin\theta & \cos\theta \\
\end{bmatrix} =
\begin{bmatrix}
\sqrt{3}/2 & -1/2 \\
1/2 & \sqrt{3}/2 \\
\end{bmatrix}
\]}
\uncover<3->{Diagonal form:
\[
\mathbf{D} = \mathbf{R}^T\mathbf{A}\mathbf{R} = \begin{bmatrix}
9 & 0 \\
0 & 1 \\
\end{bmatrix}
\]}
\end{column}
\begin{column}{.5\paperwidth}
\centering
\begin{figure}
\begin{dspPZPlot}[xticks=none,yticks=none,circle=0,cunits=false,width=5cm]{2}
\only<1-2>{%
\psset{linecolor=darkred}
\pscustom{
\rotate{30}
\psellipse(1.5,0.5)}}
\only<2>{
\SpecialCoor
\psline[linecolor=lightgray,linewidth=0.5pt]{->}(! 30 dup cos -2 mul exch sin -2 mul)(! 30 dup cos 2 mul exch sin 2 mul)
\psline[linecolor=lightgray,linewidth=0.5pt]{->}(! -60 dup cos 2 mul exch sin 2 mul)(! -60 dup cos -2 mul exch sin -2 mul)
\dspCPArcn[linecolor=blue]{1.8}{30}{0}{}}
\only<3->{
\psset{linecolor=green}
\pscustom{
\psellipse(1.5,0.5)}}
\end{dspPZPlot}
\end{figure}
\only<1-2>{$\mathbf{x}^T\mathbf{Ax} = 1$\vphantom{$x_r^T$}}
\only<3>{$\mathbf{x}_r^T\mathbf{Ax}_r = \mathbf{xR}^T\mathbf{ARx}^T = \mathbf{x}^T\mathbf{Dx} = 1$}
\end{column}
\end{columns}
\end{frame}
\begin{frame}
\frametitle{Mystery Signal}
\note<1>{Just like a change of basis helped us determine \\ the parameters of the ellipse, we can use\\
the concept of rotation to discover hidden structures \\ in higher-dimensional vector spaces. For instance, \\here is a 1024-point signal that looks like noise. \\ But with a suitable ``rotation'' we can discover what it hides.}
\begin{center}
\begin{figure}
\begin{dspPlot}[yticks=2,xout=true]{0, 1023}{-3, 3}
\moocStyle
\dspFunc{x 1024 div 360 mul 64 mul cos rand 2147483647 div 0.5 sub 2 mul add}
\end{dspPlot}
\end{figure}
\end{center}
\end{frame}
\end{document}

Event Timeline