From d5726abcecefa765bd3ccef9a56acc20a8e5daef Mon Sep 17 00:00:00 2001
From: Nao Pross <np@0hm.ch>
Date: Sun, 14 Nov 2021 19:14:22 +0100
Subject: Continue discrete model

---
 doc/thesis/chapters/theory.tex | 63 ++++++++++++++++++++++--------------------
 1 file changed, 33 insertions(+), 30 deletions(-)

(limited to 'doc/thesis/chapters/theory.tex')

diff --git a/doc/thesis/chapters/theory.tex b/doc/thesis/chapters/theory.tex
index 36a9bee..1a0945b 100644
--- a/doc/thesis/chapters/theory.tex
+++ b/doc/thesis/chapters/theory.tex
@@ -159,15 +159,6 @@ In theory because wireless transmission happens through electromagnetic radiatio
 
 In our model we are going to include an additive white Gaussian noise (AWGN) and a Rician (or Rayleighan) fading; both are required to model physical effects of the real world. The former in particular is relevant today, as it mathematically describes dense urban environments.
 
-\subsection{Additive white Gaussian noise}
-
-%% TODO: Discuss thermal stuff etc?
-\skelpar[3]{What does AWGN model?}
-\skelpar[3]{Mathematical model of AWGN, assumptions, limits etc.}
-\begin{equation}
-	\skelline
-\end{equation}
-
 \subsection{Geometric multipath fading model}
 
 The simplest way to understand the multipath fading, is to consider it from a geometrical perspective. \figref{fig:multipath-sketch} is a sketch a wireless transmission system affected by multipath fading. The sender's antenna radiates an electromagnetic wave in the direction of the receiver (red line), however even under the best circumstances a part of the signal is dispersed in other directions (blue lines).
@@ -176,7 +167,7 @@ The simplest way to understand the multipath fading, is to consider it from a ge
 	\centering
 	\input{figures/tikz/multipath-sketch}
 	\caption{
-		Sketch of channel with multipath fading
+		Sketch of channel with multipath fading.
 		\label{fig:multipath-sketch}
 	}
 \end{figure}
@@ -190,6 +181,15 @@ The linearity of the model is justified by the assumption that the underlying el
 
 A further complication arises, when one end (or both) is not stationary. In that case the lengths of the paths change over time, and as a result both the delays \(\tau_k\) as well as the attenuations \(c_k\) become functions of time: \(\tau_k(t)\) and \(c_k(t)\) respectively \cite{Gallager,Messier}. Even worse is when the velocity at which the device is moving is high, because then Doppler shifts of the electromagnetic wave frequency become non negligible \cite{Gallager}.
 
+\begin{figure}
+	\centering
+	\input{figures/tikz/multipath-impulse-response}
+	\caption{
+		LTV impulse response of a multipath fading channel.
+		\label{fig:multipath-impulse-response}
+	}
+\end{figure}
+
 We have thus observed that the arrangement can be modelled as a linear time-\emph{varying} system (LTV), if the sender or the receiver (or anything else in the channel) is moving, and as a linear time \emph{invariant} (LTI) system if the geometry is stationary. Regardless of which of the two cases, linearity alone is sufficient to approximate the channel as finite impulse response (FIR) filter \cite{Messier}. We can rewrite LTV version of equation \eqref{eqn:geom-multipath-rx} using a convolution product as following:
 \begin{align*}
 	r(t) = \sum_k c_k(t) s(t - \tau_k(t)) &= \sum_k c_k(t) \int_\mathbb{R} s(\tau) \delta(\tau - \tau_k(t)) \,d\tau \\
@@ -199,16 +199,7 @@ obtaining a new function
 \begin{equation} \label{eqn:multipath-impulse-response}
 	h(\tau, t) = \sum_k c_k(t) \delta(\tau - \tau_k(t)),
 \end{equation}
-that describes the \emph{channel impulse response} (CIR). This function is dependant on two time parameters: actual time \(t\) and convolution time \(\tau\). To better understand \(h(\tau, t)\), consider an example shown in figure \ref{fig:multipath-impulse-response}. Each stem represents a weighted Dirac delta, so each series of stems of the same color, along the convolution time \(\tau\) axis, is a channel response at some specific time \(t\). Along the other \(t\) axis we see how the entire channel response changes over time\footnote{In the figure only a finite number of stems was drawn, but actually \(h(\tau, t)\) is continuous in \(t\), i.e. the weights \(c_k(t)\) of the Dirac deltas change continuously.}. Notice that the stems are not quite aligned to the \(\tau\) time raster (dotted lines), that is because in \eqref{eqn:multipath-impulse-response} not only the weights \(c_k\) but also the delays \(\tau_k\) are time dependent.
-
-\begin{figure}
-	\centering
-	\input{figures/tikz/multipath-impulse-response}
-	\caption{
-		LTV impulse response of a multipath fading channel.
-		\label{fig:multipath-impulse-response}
-	}
-\end{figure}
+that describes the \emph{channel impulse response} (CIR). This function depends on two time parameters: actual time \(t\) and convolution time \(\tau\). To better understand \(h(\tau, t)\), consider an example shown in figure \ref{fig:multipath-impulse-response}. Each stem represents a weighted Dirac delta, so each series of stems of the same color, along the convolution time \(\tau\) axis, is a channel response at some specific time \(t\). Along the other \(t\) axis we see how the entire channel response changes over time\footnote{In the figure only a finite number of stems was drawn, but actually \(h(\tau, t)\) is continuous in \(t\), i.e. the weights \(c_k(t)\) of the Dirac deltas change continuously.}. Notice that the stems are not quite aligned to the \(\tau\) time raster (dotted lines), that is because in \eqref{eqn:multipath-impulse-response} not only the weights \(c_k\) but also the delays \(\tau_k\) are time dependent.
 
 \subsection{Spectrum of a multipath fading channel}
 
@@ -233,7 +224,7 @@ Equation \eqref{eqn:multipath-frequency-response} shows that the frequency respo
 
 \subsection{Discrete-time model}
 
-Since often in practice signal processing is done digitally, it is meaningful to discuss some properties of a discrete-time model. To keep the complexity of the model manageable some assumptions are necessary, thus the sent discrete signal \(s(n)\)\footnote{This is an abuse of notation. The argument \(n\) is used to mean the \(n\)-th digital sample of \(s\), whereas the \(s(t)\) is used for the analog waveform.} is assumed to have a finite single sided bandwidth \(W\). This implies that in the time-domain signal is a series of sinc-shaped pulses each shifted from the previous by a time interval \(T = 1 / (2W)\) (Nyquist rate):
+Since in practice signal processing is done digitally, it is meaningful to discuss the properties of a discrete-time model. To keep the complexity of the model manageable some assumptions are necessary, thus the sent discrete signal \(s(n)\)\footnote{This is an abuse of notation. The argument \(n\) is used to mean the \(n\)-th digital sample of \(s\), whereas \(s(t)\) is used for the analog waveform.} is assumed to have a finite single sided bandwidth \(W\). This implies that in the time-domain signal is a series of sinc-shaped pulses each shifted from the previous by a time interval \(T = 1 / (2W)\) (Nyquist rate):
 \begin{equation}
 	s(t) = \sum_n s(n) \sinc(t/T - n)
 \end{equation}
@@ -242,22 +233,34 @@ The waveform \(s(t)\) is then convolved with the CIR function \(h(\tau, t)\) (wi
 	r(t) &= \int_ \mathbb{R} \sum_n s(n) \sinc(\tau / T - n) \sum_k c_k(t) \delta(\tau - \tau_k(t)) \,d\tau \\
 	&= \sum_n s(n) \sum_k c_k(t) \sinc(t/T - \tau_k(t)/T - n),
 \end{align*}
-which is then sampled at the Nyquist rate of \(2W = 1/T\), resulting in a set of samples\footnote{Again, the abuse of notation \(r(m)\) means the \(m\)-th digital sample of \(r(t)\).}:
-\begin{equation} \label{eqn:discr-multipath-rx}
+which is then sampled at the Nyquist rate of \(2W = 1/T\), resulting in a set of samples\footnote{Again, the abusing notation \(r(m)\) means the \(m\)-th digital sample of \(r(t)\).}:
+\[
 	r(m) = \sum_n s(n) \sum_k c_k(mT) \sinc(m - \tau_k(mT)/T - n).
-\end{equation}
-Finally the substitution \(l = m - n\) eliminates the sender's sample counter \(n\) from \eqref{eqn:discr-multipath-rx} and reformulates it as a discrete convolution product with a discrete CIR function \(h_l(m)\):
+\]
+Finally the substitution \(l = m - n\) eliminates the sender's sample counter \(n\) (unknown to the receiver) and reformulates \(r(m)\) as a discrete convolution product of with a discrete CIR function \(h_l(m)\):
 \begin{equation}
 	r(m) = \sum_l s(m - l) \sum_k c_k(mT) \sinc(l - \tau_k(mT)/T) 
 	= \sum_l s(m - l) h_l (m).
 \end{equation}
-This result is very similar to the continuous time model described by \eqref{eqn:multipath-impulse-response} in the sense that each received digital sample is the sent sample convolved with a different discrete channel response (because of time variance).
+This result is very similar to the continuous time model described by \eqref{eqn:multipath-impulse-response} in the sense that each received digital sample is a sent sample convolved with a different discrete channel response (because of time variance). To see how the discrete CIR
+\begin{equation} \label{eqn:discrete-multipath-impulse-response}
+	h_l(m) = \sum_k c_k(mT) \sinc(l - \tau(mT)/T)
+\end{equation}
+is different from \eqref{eqn:multipath-impulse-response} consider again the plot of \(h(\tau,t)\) in \figref{fig:multipath-impulse-response}. The plot of \(h_l(m)\) would have discrete axes with \(m\) replacing \(t\) and \(l\) instead of \(\tau\), and because of the finite bandwidth in the \(l\) axis instead of Dirac deltas there would be superposed sinc functions.
 
-\skelpar[3]{Mathematical discretization}
+From another perspective equation \eqref{eqn:discrete-multipath-impulse-response} is a simple tapped delay line FIR filter, which is very easy to implement. In fact multipath channels can be easily simulated with just a few lines of code. For example \figref{fig:multipath-frequency-response} is implemented in four lines of Python as shown in listing \ref{lst:two-tap-fir}.
 
-\begin{equation}
-	h(n, k) = \skelline[8cm]{Discrete-time multipath fading channel impulse response}
-\end{equation}
+\begin{lstlisting}[language=python, captionpos=b, caption={
+	Simulation of a multipath channel using a 2 tap FIR filter.
+}, label={lst:two-tap-fir}]
+import numpy as np
+
+def tap(c, tau, f):
+    return np.exp(2j * np.pi * f * tau)
+
+f = np.logspace(5, 8, num=320)
+multipath = tap(.8, 500e-9, f) + tap(.4, 300e-9, f)
+\end{lstlisting}
 
 \skelpar[3]{Discrete frequency response. Discuss bins, etc.}
 
-- 
cgit v1.2.1

