WiFi stuff

This commit is contained in:
2019-11-20 13:33:21 +01:00
parent 10ec252c36
commit 39aba04943
3 changed files with 80 additions and 28 deletions

View File

@@ -28,6 +28,7 @@
\usepackage{siunitx}
\usepackage{array}
\usepackage{multirow}
\usepackage{xfrac}
%\updates{yes} % If there is an update available, un-comment this line

View File

@@ -48,27 +48,36 @@ However, in the present of noise and imperfect measurements estimating a accurat
Received Signal Strength Indication (RSSI) is a measure of the received RF power and is obtained by the radio hardware at the antenna connector using an analog-to-digital converter.
It is usually expressed in \si{\dBm} and quantified to integer values.
For indoor localization RSSI is often used to deduce the distance from a smartphone to the access point, because it is virtually always available on common devices.
The \docLogDistance{} model is commonly used to predict the signal strength $s$ at a given distance $d$.
The \docLogDistance{} model is commonly used to predict the received signal strength $P_i$ from an AP $i$ at a given distance $d_i$.
Which is formally given with
\begin{equation}
s = \mTXP - 10 \mPLE \log_{10}{\frac{\mMdlDist}{\mMdlDist_0}} + \mathcal{X} \text{,}
P_i = \mTXP - 10 \mPLE \log_{10}{\frac{\mMdlDist_i}{\mMdlDist_0}} + \mathcal{X}_{\sigma_i} \text{,}
\label{eq:logDistModel}
\end{equation}
where $\mTXP$ denotes the sending power of the AP at reference distance $\mMdlDist_0$ (\eg \si{1}{m}) in \si{\dBm}, $\mPLE$ is the path loss exponent, which value needs to be empirically chosen for the given environment.
The added zero-mean Gaussian random variable $\mathcal{X}$ models signal fading and random channel noise in \si{\decibel}.
where $\mTXP$ denotes the sending power in \si{\dBm} of the AP at reference distance $\mMdlDist_0$ (usually \SI{1}{\meter}), $\mPLE$ is the path loss exponent, which value needs to be empirically chosen for the given environment.
The added zero-mean Gaussian random variable $\mathcal{X}_{\sigma_i}$ with a variance of $\sigma^2_i \si{\dBm}$ models signal fading and random channel noise.
Hence, the measured RSSI is assumed to follow a normal distribution $P_i \sim \mathcal{N}(P_i^*, \sigma_i^2)$, where $P_i^*$ is the expected RSSI and $\sigma_i^2$ is the variance of the measurement.
%, both given in \si{\dBm}.
The \docLogDistance{} model can be reformulated to compute the distance $d$ based on the RSSI $s$ with
The \docLogDistance{} model can be reformulated to compute the distance $d_i$ based on the measured RSSI $P_i$ and assuming $d_0=\SI{1}{\meter}$ with
\begin{equation}
d = 10^{(\mTXP-s) / 10\mPLE}
\log_{10}{d_i} = \frac{\mTXP-P_i}{10\mPLE} + \frac{\mathcal{X}_{\sigma_i}}{10\mPLE }
\end{equation}
\begin{equation}
% d_i = 10^{(\mTXP-P_i) / 10\mPLE} + 10^{\mathcal{X}_{\sigma^2_i}/10\mPLE}
d_i = 10^{\sfrac{(\mTXP-P_i + \mathcal{X}_{\sigma_i})}{10\mPLE}}
\end{equation}
Since $\mathcal{X}_{\sigma_i}$ is a Gaussian random variable, the logarithm of $d_i$ is normally distributed as well.
Consequently, the distance $d_i$ follows a log-normal distribution, $\ln{d_i} \sim \mathcal{N}(d_i^*, \sigma_{i,d}^2)$, where $d_i=\ln(10) \frac{P_0 - P_i}{10\mPLE}$ is the expected distance and $\sigma_{i,d}^2=\left( \frac{\ln(10)\sigma_i}{10\mPLE} \right)^2$ is the variance of the distance.
In free space the value of the path loss exponent is $\mPLE=2$.
In indoor scenarios $\mPLE$ accounts for the architecture around the AP, thus a single global factor is chosen for the whole building.
%This restricts the \docLogDistance{} model to a uniform view on the complete environment and does not allow to differentiate between different types of materials, and ignores which walls are actually transmitted the signal.
This restricts the \docLogDistance{} model to a uniform view on the whole environment and does not take the actual propagation path of the signal into account.
Therefore it is not possible
not allow to differentiate between different types of materials, and ignores which walls are actually transmitted the signal.
Therefore, the model does not consider the actual signal propagation path and thus makes it impossible to differentiate between different types of obstacles or wall materials.
In order to take walls into account the model must include the power loss of every traversed wall, which results in the wall-attenuation factor model \cite{TODO}.
Often the dampening factors of walls are unknown and hard to measure.
@@ -76,39 +85,77 @@ Additionally, the computation of the wall-attenuation factor model requires cost
Another approach is to take measurements at known positions distributed throughout the building.
These fingerprints can then be used in the localization phase to obtain the current position with a nearest neighbour search.
Given the current RSSI value the most likely position is the one which has
Given the current RSSI value the most likely position is the one which is closest to other similar RSSI fingerprints.
This method includes the characteristics of the environment into the prerecorded fingerprints.
Recording the fingerprints is a time-consuming and tedious process for large buildings and needs to be redone whenever the environment changes significantly.
However, RSSI values are often coarsely quantized, depend heavily on the environment, differ from device to device, and are affected by the interferences.
%While fingerprinting can increase the accuracy of the localization computing the distance from the RSSI directly is easier to deploy.
%However, RSSI values are often coarsely quantized, depend heavily on the environment, differ from device to device, and are affected by the interferences.
- free space loss
- walls
, also dynamic obstacles like persons can interfere with the signal.
%- free space loss
%- walls
%, also dynamic obstacles like persons can interfere with the signal.
\subsection{Fine Timing Measurement}
Time-based distance measurements are based on successive timestamps taken at the sender and receiver site.
The difference of the two timestamps is the time the signal took to travel from the sender to the receiver.
Time-based distance measurements are intuitively based on the delay the signal took to travel from the sender to the receiver.
Multiplied by the propagation speed of light results in the distance between the two nodes.
The propagation speed of the signal depends on the propagation medium and is slower in media with higher relative permittivity, like concrete walls, compared to air.
The propagation speed of the signal depends on the propagation medium and is slower in media with higher relative permittivity compared to air, like concrete walls.
However, for most indoor environments the signal propagation speed can be assumed to be constant, as the total travel distance in non-air media is usually negligible short compared to the travel distance in air \cite{marcaletti2014filtering}.
For that reason, time of flight (ToF) measurements are more robust compared to received power measurements.
While RF power is relatively simple to measure, obtaining accurate ToF values at small resolutions like nanoseconds needs much more caution, as the measurements are sensitive to noise.
Relatively small deviations from the real time value result in a large error in the distance estimate, \eg a error of 1ns results in xx meter.
Therefore, distance estimates can greatly differ from the ideal euclidean distance.
For that reason, time-based distance measurements are assumed to be more robust compared to received power measurements, because the propagation path and interaction with the environment is inherent in the measurement.
The accuracy of distance estimate depends on the ability of the hardware to detect the line-of-sight signal.
A straightforward method to measure the propagation delay of a signal is time of arrival (ToA), where the propagation time of the signal is computed from absolute time values measured at the transmitter and receiver.
This method is used famously in satellite navigation, \eg GPS.
While being precise, ToA requires costly high precision synchronized clocks, which are not suitable for indoor localization.
Two way ranging (TWR) eliminates the requirement for synchronized clocks.
\ieeWifiFTM{} defines the fine timing measurement (FTM) protocol, which implements the TWR method for standard conform WiFi devices.
This made time-based distance measurements broadly available for WiFi based systems and relevant for smartphone based indoor localization.
Instead of using absolute time, the round trip time is measured based on time differences at the sender and receiver.
As successive time measurements are only done at one site synchronized clocks are not required.
By definition the responder (\eg AP) is passive while the FTM initiator (\eg smartphone) actively requests FTM measurements.
The FTM protocol is shown in \figref{TODO}.
The procedure starts with an initial FTM request frame send by the initiator, which can be rejected or accepted by the responder.
If the responder agrees to the request it sends an acknowledge frame.
Following, the responder stores the current time $t_1$, which represents the start of the measurement, and sends a FTM frame.
At the initiator the time $t_2$ is recored as soon as the incoming signal is detected at the antenna.
After receiving the FTM frame the initiator prepares a ACK frame and sends it to the responder.
However, to account for the signal processing delay of the initiator's hardware it is necessary to record an additional timestamp $t_3$ when the ACK frame is transmitted. % TODO detail wie wird t_3-t_2 übertragen?
When the ACK frame is received at the responder at time $t_4$ the responder can calculate the round trip time of the signal by subtracting $t_1$ from $t_4$.
To exclude the processing delay of the initiator the difference between $t_2$ and $t_3$ is subtracted from the total round trip time, which results in the propagation delay of the signal
\begin{equation}
\text{ToF} = (t_4-t_1) - (t_3-t_2) % TODO besseres Symbol als RTT
\end{equation}
While RF power is relatively simple to measure, obtaining accurate ToF values at a small resolution like nanoseconds needs much more caution, as the measurements are sensitive to noise.
Relatively small deviations from the real time value result in a vast error in the distance estimate, \eg a measurement error of \SI{10}{ns} results in a distance error of \SI{3}{m}.
For this reason the above outlined procedure is repeated multiple times to reduce the impact of noise.
In fact, a single FTM measurement consists of many FTM-ACK exchanges and the final value $ToF^*$ is the average over the $n$ measurements
\begin{equation}
ToF^* = \frac{1}{n} \sum_{k=1}^{n} \left[ (t_{4,k}-t_{1,k}) - (t_{3,k}-t_{2,k}) \right]
\end{equation}
After calculating the average ToF the responder transfers the result to the initiator where the result can be processed by an application.
The accuracy of distance estimate depends on the ability of the hardware to detect the line-of-sight signal, or direct path.
In an indoor environment it is very common that a signal will reach the receiver from different paths with different lengths.
The prime example is a signal which reaches the receiver via a direct line-of-sight propagation plus two reflected paths of the same length.
As the reflected paths have the same length and phase they constructively interfere at the receiver resulting in a higher receiving power compared to the direct connection.
The difficulty in such multipath scenarios is to distinguish the direct path from the reflected paths.
Here the limiting factor is the sampling rate of the receiving hardware.
Given 802.11xxx the channel bandwidth is 20 mhz which results in a sampling rate of
The difficulty in such multipath scenarios is to distinguish the direct path from the reflected paths \cite{ibrahim2018verification}, or that the direct path signal gets undetected because of interference \cite{TODO}.
Also, if the delay of the reflected paths is near the time resolution of the hardware, the multipath components will degrade the precision of the time of arrival estimate.
This results in an over-estimate of the propagation time of the signal, and consequently in the range estimate.
The limiting factor is the sampling rate of the receiving hardware, which is defined by the channel bandwidth.
Hence, the time resolution is proportional to the inverse of the bandwidth.
In order to measure the ToF the hardware needs to detect the direct line-of-sight signal
However, obtaining accurate ToF measurements of the line-of-sight signal in heavy multipath environment like indoors is not easy.
In \ieeWifiN the channel bandwidth is \SI{20}{Mhz} in the \SI{2.4}{GHz} range which results in a sampling rate of one sample every \SI{50}{ns}, or one sample every \SI{12.5}{ns} for \SI{80}{Mhz} channels in the \ieeWifiAC \SI{5}{GHz} range.
Assuming that the receiver recognizes the signal at the first sample of the preamble the smallest possible resolution of the range estimate is \SI{15}{m} for \SI{20}{Mhz} bandwidth, and \SI{3.74}{m} for \SI{80}{Mhz}.
To allow much finer resolution the receiver uses super resolution methods to allow sub-sample resolution \cite{TODO}.
%Therefore, time-based distance estimates can greatly differ from the ideal euclidean distance.
Error sources:

View File

@@ -3,11 +3,15 @@
\newcommand{\ie} {i.\,e.\@\xspace}
\newcommand{\qq} [1]{``#1''}
\newcommand{\figref}[1]{fig.~\ref{#1}}
\newcommand{\etal} [1]{#1~et~al.}
\newcommand{\etal} [1]{#1~et~al.\@\xspace}
\DeclareSIUnit{\belmilliwatt}{Bm}
\DeclareSIUnit{\dBm}{\deci\belmilliwatt}
\newcommand{\ieeWifiFTM}{\mbox{IEEE 802.11-2016}\xspace}
\newcommand{\ieeWifiN} {\mbox{IEEE 802.11n}\xspace}
\newcommand{\ieeWifiAC} {\mbox{IEEE 802.11ac}\xspace}
% keyword macros
\newcommand{\docIBeacon}{iBeacon}