\section{Sensors}

	\subsection{Barometer}
	\label{sec:sensBaro}
	
As stated by \cite{Muralidharan14-BPS}, ambient pressure readings are highly influenced by environmental conditions like the weather, time-of-day and others. 
Thus, relative pressure readings are preferred over absolute ones. 
However, due to noisy sensors, one single reading is not enough as a relative base. 
Harnessing the usual setup time of a navigation-system (route calculation, user checking the route) we use the average of all barometer readings during this timeframe as relative base $\overline{\mObsPressure}$. 
However, it is often necessary to omit the first few sensors readings, as the sensor needs some time to settle.
Otherwise the estimated base would be far off the real values as shown in fig. \ref{fig:baroSetupError}. 
Besides, we use the system's setup time to estimate the sensors uncertainty $\sigma_\text{baro}$ for later use within the evaluation.
%		
		\begin{figure}
			\include{gfx/baro/baro_setup_issue}
			\caption{Sometimes the barometer provides erroneous \SI{}{\hpa} readings during the first seconds. Those
			need to be omitted before $\sigma_\text{baro}$ and $\overline{\mObsPressure}$ are estimated.}
			\label{fig:baroSetupError}
		\end{figure}
%	
During each transition from $\mStateVec_{t-1}$ to $\mStateVec_t$, we need a corresponding, relative pressure prediction $\mStatePressure$ which is adjusted according to the resulting $z$-change, if any:
%		
		\begin{equation}
			\mState_{t}^{\mStatePressure} = \mState_{t-1}^{\mStatePressure} + \Delta z \cdot \SI{0.105}{\hpa}
			,\enskip
			\Delta z = \mState_{t-1}^{z} - \mState_{t}^z
			.
			\label{eq:baroTransition}
		\end{equation}
%	
The evaluation following the transition then compares the predicted relative pressure with the observed one using a normal distribution with the previously estimated $\sigma_\text{baro}$:
		
		\begin{equation}
			p(\mObsVec_t \mid \mStateVec_t)_\text{baro} = \mathcal{N}(\mObs_t^{\mObsPressure} \mid \mState_t^{\mStatePressure}, \sigma_\text{baro}).
			\label{eq:baroEval}
		\end{equation}
		
		
		
		
		
		
	\subsection{Wi-Fi \& iBeacons}
		For additional absolute location hints, we use the smartphones Wi-Fi and iBeacon sensor to measure the signal-strengths
		of nearby transmitters. As the positions of both \docAP{}s and and \docIBeacon{}s are known beforehand, we compare
		each measurement with its corresponding signal strength prediction which is defined by the 3D distance $d$
		and the number of floors $\Delta f$ between the \docAPshort{} and the particle
%	
		\begin{equation}
			P_r(d, \Delta f) = \mTXP - 10 \mPLE \log_{10}{\frac{\mMdlDist}{\mMdlDist_0}} + \Delta{f} \mWAF,
		\end{equation}
%		
		and calculate the resulting probability as described in \cite{Ebner-15}:
%		
		\begin{equation}
			\mProb(\mObsVec_t \mid \mStateVec_t)_\text{wifi} =
			\prod\limits_{i=1}^{n} \mathcal{N}(\mRssi_\text{wifi}^{i} \mid P_{r}(\mMdlDist_{i}, \Delta{f_{i}}), \sigma_{\text{wifi}}^2).
			\label{eq:wifiTotal}
		\end{equation}
				
		For the \docWIFI{} component we thus need two parameters per \docAPshort{}: $\mTXP$ measured at a distance 
		$\mMdlDist_0$ (usually \SI{1}{\meter}) and the path-loss exponent $\mPLE$ describing the environment.
		To reduce complexity and system setup time, we use the same values for all \docAP{}s at the cost of accuracy.
		While, $\mTXP$ is best determined using averaged measurements at a single location,
		a good estimation of $\mPLE$ requires several measurements and numerical optimization \cite{PathLossPredictionModelsForIndoor}.
		$\mPLE$ is thus chosen empirically.
		
		For the \docIBeacon{} component we also use \refeq{eq:wifiTotal} but $\mTXP$ is transmitted by each beacon. 
Due to the short-range coverage the model parameters require less consideration of the senders ambient conditions (e.g. walls).
Therefore, a smaller $\mPLE$ can be chosen to model the signal strength prediction for \docIBeacon{}s.
	
	
\subsection{Step- \& Turn-Detection}

\commentByToni{da muessen wir nochmal drueber reden. das problem ist glaube ich. das die state transition vorher zu wenig gestreut hat und dadurch auch zu wenige particles in "hochwinkligen" bereichen hatte. dann haben die turns immer entsprechen einen delay gehabt. bin mir also nicht sicher ob es wirklich das downvoting / sample impoverishment ist. hast du da vielleicht noch ein paar infos für mich? weil unser sigma war ja immer rießig... quasi fast gleichverteilt.}

A big disadvantage of using the state transition as proposal distribution is the high possibility of sample impoverishment due to a small measurement noise. This happens since accurate observations result in high peaks of the evaluation density and therefore the proposal density is not able to sample outside that peak \cite{Isard98:CCD}. This causes a downvoting of particles with increased heading deviation. ... 


To prevent degradation within the particle-filter \cite{??} due to downvoting of particles with increased heading deviation, we incorporate the step- and turn-detection within the transition step. 



directly into the transition
		$p(\mStateVec_{t} \mid \mStateVec_{t-1}, \mObsVec_{t-1})$.
		\cite{thrun?}\cite{lukas2014?} to get a more directed sampling instead of a truly random one.

This happens since accurate observations result in high peaks of the evaluation density and therefore the importance density is not able to sample outside that peak [IB98b].
		
		
		
		\commentByFrank{todo: wie wird die unsicherheit in der transition eingebracht, sigma, ..} 
		
		
		
