% !TeX program = xelatex
% !TeX encoding = utf8
% !TeX root = Fading.tex
% vim: set ts=2 sw=2 noet:

\documentclass[
	% show when a line is too long (drafting)
	overfullrule,
	% page size and margins
	paper = a4, twoside, openright, BCOR = 5mm,
	headinclude, footexclude,
	% font size
	fontsize = 11pt,
	% style of empty pages (after chapters)
	cleardoublepage = empty,
	% extra sections
	titlepage, abstract = on,
	% header and footers
	automark,
]{scrreprt}

%% Language configuration
\usepackage{polyglossia}
\setmainlanguage{english}

% Use a different font for german
\usepackage{xcolor}
\setotherlanguage{german}
\newfontfamily{\germanfont}{Roboto Condensed Light}

%% Custom packages
\usepackage{tex/docmacros}
\usepackage[draft]{tex/docstyle}

%% Pretty figures
\usepackage{circuitikz}  % Electric diagrams
\usepackage{pgfplots}    % Pretty plots
\usepackage{tikz}        % Pretty drawings
\usepackage{tikz-3dplot} % More dimensions!

\pgfplotsset{compat=newest}
\usetikzlibrary{
	external,
	calc,
	positioning,
	backgrounds,
	decorations.pathreplacing,
	calligraphy,
	decorations.markings,
	matrix,
	arrows,
	patterns,
}
\tikzexternalize[mode=graphics if exists]{Fading}
\pgfdeclarelayer{background}
\pgfdeclarelayer{foreground}
\pgfsetlayers{background,main,foreground}

\usepackage{graphicx}   % Include pictures
\usepackage{subcaption} % Subfigures

%% Placeholders
\usepackage{skeldoc}

%% Nicer tables
\usepackage{tabularx}
\usepackage{booktabs}


%% Writing units
\usepackage{siunitx}
% this one is for siunitx v3, debian and older systems
% still have only siunitx v2 installed
% \sisetup{uncertainty-mode = separate}
\sisetup{separate-uncertainty}

%% List of acronyms
% \usepackage{acronym}

%% Load bibliography 
\addbibresource{Fading.bib}

%% Recompute page margins
\KOMAoptions{DIV=default}

%% Metadata
\title{Multipath Fading Demonstration Platform using Software Defined Radio}
\author{Naoki Sean Pross \and Sara Cinzia Halter}
\date{Fall semester 2021}

\begin{document}

	\hypersetup{pageanchor = false}

	%% TODO: create a proper titlepage
	\maketitle
	% \include{tex/titlepage}

	\begin{abstract}
		%% TODO: write abstract
		\skelpar
	\end{abstract}

	\cleardoublepage
	\pagenumbering{roman}
	\setcounter{page}{1}

	\tableofcontents
	\cleardoublepage

	%% TODO: move in a separate file
	\chapter*{List of symbols}
	\noindent %
	\begin{tabularx}{\linewidth}{>{\(}c<{\)} X}
		\toprule
		% \textbf{Notation} & \bfseries Description \\
		% \midrule
		\multicolumn{2}{l}{\itshape Mathematics} \\
		\vec{v},\, \vec{m} & Vector quantity \\
		\phi^*             & Complex conjugate of \(\phi\) \\
		\midrule
		\multicolumn{2}{l}{\itshape Physical quantities} \\
		t      & Time \\
		T      & Period \\
		\tau   & Convolution time \\
		f      & Frequency in Hz \\
		\omega & Frequency in radians per second \\
		\Omega & Digital frequency in radians per sample \\
		\midrule
		\multicolumn{2}{l}{\itshape Modulation schemes} \\
		n(t)    & Additive white Gaussian noise (AWGN) \\
		f(t)    & Multiplicative fading noise \\
		p(t)    & Pulse function \\
		m(n)    & Message samples \\
		m(t)    & Message waveform \\
		\phi(t) & Carrier signal \\
		s(t)    & Signal waveform \\
		s(n)    & Signal samples \\
		r(t)    & Received signal \\
		r(m)    & Received samples \\
		\midrule
		\multicolumn{2}{l}{\itshape Channel modelling} \\
		h(t)       & LTI impluse response, \(h(\tau, t\) for the LTV IR \\
		h(m)       & LTI discrete time impulse response, \(h_l(m)\) for the LTV discrete time IR \\
		H(f)       & LTI Frequency response, \(H(f, t)\) for the LTV frequency response \\
		c_k        & Tap attenuation \\
		\tau_k     & Tap delay \\
		T_d        & Delay spread \\
		B_c        & Coherence bandwidth \\
		R_{xy}     & Correlation between \(x\) and \(y\) \\
		\bottomrule
	\end{tabularx}

	\chapter*{List of Acronyms}
	\noindent
	\begin{tabularx}{\linewidth}{l X}
		\toprule
		\bfseries Acronym & \bfseries Description \\
		\midrule
		API    & Application Programming Interface                \\
		AWGN   & Additive White Gaussian Noise                    \\
		BER    & Bit Error Rate                                   \\
		CAZAC  & Constant Amplitude Zero Autocorrelation Waveform \\
		CIR    & Channel Impulse Response                         \\
		CMA    & Constant Modulus Adaptive filter                 \\
		DPG    & Dear PyGUI                                       \\
		ETSI   & European Telecommunication Standards Insitite    \\
		FIR    & Finite Impulse Response                          \\
		GR     & GNU Radio                                        \\
		GRC    & GNU Radio Companion                              \\
		GSM    & Global System for Mobile communication           \\
		IMGUI  & Immediate Graphical User Interface               \\
		IP     & Internet Protocol                                \\
		IR     & Impulse Response                                 \\
		IoT    & Internet of Things                               \\
		LMS-DD & Least Mean Square Decision-Directed equalizer    \\
		LOS    & Line of Sight                                    \\
		LTI    & Linear Time Invariant                            \\
		LTV    & Linear Time-Varying                              \\
		MSB    & Most Significant Bit                             \\
		NLOS   & No Line Of Sight                                 \\
		PDP    & Power Delay Profile                              \\
		PSK    & Phase Shift Keying                               \\
		QAM    & Quadrature Amplitude                             \\
		QPSK   & Quadrature Phase Shift Keying                    \\
		SDR    & Software Defined radio                           \\
		UDP    & User Datagram Protocol                           \\
		US     & Uncorrelated Scattering                          \\
		WSS    & Wide Sense Stationary                            \\
		WSSUS  & Wide Sense Stationary Uncorrelated Scaterring    \\
		\bottomrule
	\end{tabularx}

	\cleardoublepage

	\hypersetup{pageanchor = true}
	\pagenumbering{arabic}
	\setcounter{page}{1}
	\pagestyle{scrheadings}

	\include{chapters/introduction}
	\include{chapters/theory}
	\include{chapters/implementation}
	\include{chapters/conclusions}

	%% TODO: remove in final version
	\printskelnotes
	\printbibliography

\end{document}
