% !TeX program = xelatex % !TeX encoding = utf8 % !TeX root = DigSig1.tex % vim: set ts=2 sw=2 et: \documentclass[margin=small]{tex/hsrzf} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Packages %% Font configuration \usepackage{fontspec} \usepackage{fouriernc} %% Own packages % \usepackage{tex/hsrstud} \usepackage{tex/docmacros} %% Mathematics \usepackage{amssymb} %% Frames \usepackage{framed} %% Language configuration \usepackage{polyglossia} \setdefaultlanguage{english} %% License configuration \usepackage[ type={CC}, modifier={by-nc-sa}, version={4.0}, ]{doclicense} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Metadata \course{Electrial Engineering} \module{DigSig1} \semester{Fall Semester 2021} \authoremail{naoki.pross@ost.ch} \author{\textsl{Naoki Pross} -- \texttt{\theauthoremail}} \title{Digital Signal Processing Lecture Notes} \date{\thesemester} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Document \begin{document} \pagenumbering{roman} \maketitle \tableofcontents \section*{License} \doclicenseThis \twocolumn \setcounter{page}{1} \pagenumbering{arabic} \section{Probability and stochastics} \subsection{Random variables} A \emph{random variable} (RV) is a function \(x : \Omega \to \mathbb{R}\). The \emph{distribution function} of a RV is a function \(F_x : \mathbb{R} \to [0,1]\) that is always monotonically increasing and given by \[ F_x(\alpha) = \Pr{x \leq \alpha}. \] The \emph{probability density function} (PDF) of a RV is \[ f_x(\alpha) = \frac{dF_x}{d\alpha}. \] The \emph{expectation} of a RV is \[ \E{x} = \int_\mathbb{R} \alpha f_x(\alpha) \,d\alpha, \] and in the case of a discrete RV \[ \E{x} = \sum_k \alpha_k \Pr{x = \alpha_k}. \] In general it holds that \[ \E{g(x)} = \int_\mathbb{R} g(\alpha) f_x(\alpha) \,d\alpha, \] for example \begin{align*} \E{x^2} &= \int_\mathbb{R} \alpha^2 f_x(\alpha) \,d\alpha \\ \E{|x|} &= \int_\mathbb{R} |\alpha| f_x(\alpha) \,d\alpha \\ &= \int_0^\infty \alpha \left[ f_x(\alpha) + f_x(-\alpha) \right] \,d\alpha \end{align*} The \emph{variance} of a RV is \[ \Var{x} = \sigma^2 = \E{(x - \E{x})^2} = \E{x^2} - \E{x}^2, \] where \(\sigma\) is called the \emph{standard deviation}. The variance is sometimes also called the \emph{second moment} of a RV, the \emph{\(n\)-th moment} of a RV is \(\E{x^n}\). \subsection{Jointly distributed RVs} \section{Analog signals} In this document we will use the notation \(\Omega = 2\pi f\) for physical analog frequencies (in radians / second), and \(\omega\) for digital frequencies (in radians / sample). \subsection{Transformations} Recall the three important operations for the analysis of analog signals. \begin{flalign*} \textit{Fourier Transform} && X(\Omega) &= \int_\mathbb{R} x(t) e^{j\Omega t} \,dt \\ % \textit{Inverse Fourier Transform} && x(t) &= \int_\mathbb{R} X(\Omega) e^{j\Omega t} \,\frac{d\Omega}{2\pi} \\ % \textit{Laplace Transform} && X(s) &= \int_\mathbb{R} x(t) e^{-st} \,dt \end{flalign*} The Laplace transform reduces to the Fourier transform under the substitution \(s = j\Omega\). \subsection{Linear Systems} Recall that superposition holds. Thus the system is characterized completely by the impulse response function \(h(t)\). The output in the time domain \(y(t)\) is given by the convolution product \[ y(t) = h(t) * x(t) = \int_\mathbb{R} h(t - t') x(t') \,dt', \] and in the frequency domain \(Y(\Omega) = H(\Omega) X(\Omega)\), where \(H(\Omega)\) is the Fourier transform of \(h(t)\). % Analog signals: % TODO: FT of eigenfunctions e^{j\Omega_k t\} \section{Sampling and reconstruction} To sample a signal \(x(t)\) it means to measure (take) the value at a periodic interval every \(T\) seconds. \(T\) is thus called the \emph{sample interval} and \(f_s =1/T\) is the \emph{sampling frequency}. We will introduce the notation \[ x[n] = x(nT) \] to indicate that a signal is a set of discrete samples. \subsection{Sampling theorem} To represent a signal \(x(t)\) by its samples \(x[n]\) two conditions must be met: \begin{enumerate} \item \(x(t)\) must be \emph{bandlimited}, i.e. there must be a frequency \(f_\text{max}\) after which the spectrum of \(x(t)\) is always zero. \item The sampling rate \(f_s\) must be chosen so that \[ f_s \geq 2 f_\text{max}. \] \end{enumerate} In other words you need at least 2 samples / period to reconstruct a signal. When \(f_s = 2 f_\text{max}\), the edge case, the sampling rate is called \emph{Nyquist rate}. The interval \(\left[-f_s / 2, f_2 / 2\right]\), and its multiples are called \emph{Nyquist intervals}, as they are bounded by the Nyquist frequencies. It would be good to have an arbitrarily high sampling frequency but in reality there is upper limit given by processing time \(T_\text{proc}\). Thus \(2f_\text{max} \leq f_s \leq f_\text{proc}\). \subsection{Discrete-Time Fourier Transform} Mathematically speaking, to sample a signal is equivalent multiplying a function with the \emph{impulse train distribution}\footnote{Sometimes it is also called the Dirac comb.} \[ \Comb_T (t) = \sum_{n = -\infty}^{\infty} \delta(t - nT), \] so \(x[n] = \Comb_T(t)\, x(t)\). Interestingly the impulse train is periodic, and has thus a Fourier series with all coefficients equal to \(1/T\). So the Fourier transform of a comb is also a comb, i.e. \[ \Comb_T(t) \leftrightarrow \Comb_{1/T}(\Omega). \] \subsection{Spectrum replication and aliasing} % Alias frequency \(f_a = f \pmod{f_s}\). % Anti-aliasing: analog LP prefilter cutoff \@ \(f_s/2\) \end{document}