# Wi-Fi positioning system

Wi-Fi positioning system (WPS, WiPS or WFPS) is a geolocation system that uses the characteristics of nearby Wi‑Fi access points to discover where a device is located.
It is used where satellite navigation such as GPS is inadequate due to various causes including multipath and signal blockage indoors, or where acquiring a satellite fix would take too long. Such systems include assisted GPS, urban positioning services through hotspot databases, and indoor positioning systems. Wi-Fi positioning takes advantage of the rapid growth in the early 21st century of wireless access points in urban areas.
The most common technique for positioning using wireless access points is based on a rough proxy for the strength of the received signal (received signal strength indicator, or RSSI) and the method of "fingerprinting". Typically a wireless access point is identified by its SSID and MAC address, and these data are compared to a database of supposed locations of access points so identified. The accuracy depends on the accuracy of the database (e.g. if an access point has moved its entry is inaccurate), and the precision depends on the number of discovered nearby access points with (accurate) entries in the database and the precisions of those entries. The access point location database gets filled by correlating mobile device location data (determined by other systems, such as Galileo or GPS) with Wi‑Fi access point MAC addresses. The possible signal fluctuations that may occur can increase errors and inaccuracies in the path of the user. To minimize fluctuations in the received signal, there are certain techniques that can be applied to filter the noise.
In the case of low precision, some techniques have been proposed to merge the Wi-Fi traces with other data sources such as geographical information and time constraints (i.e., time geography).

## Motivation and applications

Accurate indoor localization is becoming more important for Wi‑Fi–based devices due to the increased use of augmented reality, social networking, health care monitoring, personal tracking, inventory control and other indoor location-aware applications.
In wireless security, it is an important method used to locate and map rogue access points.
The popularity and low price of Wi-Fi network interface cards is an attractive incentive to use Wi-Fi as the basis for a localization system and significant research has been done in this area in the past 15 years.

## Problem statement and basic concepts

The problem of Wi‑Fi–based indoor localization of a device is that of determining the position of client devices with respect to access points. Many techniques exist to accomplish this, and these may be classified based on the four different criteria they use: received signal strength indication (RSSI), fingerprinting, angle of arrival (AoA) and time of flight (ToF).
In most cases the first step to determine a device's position is to determine the distance between the target client device and a few access points. With the known distances between the target device and access points, trilateration algorithms may be used to determine the relative position of the target device, using the known position of access points as a reference. Alternatively, the angles of arriving signals at a target client device can be employed to determine the device's location based on triangulation algorithms.
A combination of these techniques may be used to improve the precision of a system.

## Techniques
### Signal strength

RSSI localization techniques are based on measuring rough relative signal strength at a client device from several different access points, and then combining this information with a propagation model to determine the distance between the client device and the access points. Trilateration (sometimes called multilateration) techniques can be used to calculate the estimated client device position relative to the expected position of access points.
Though one of the cheapest and easiest methods to implement, its disadvantage is that it does not provide very good precision (median of 2–4m), because the RSSI measurements tend to fluctuate according to changes in the environment or multipath fading.
Cisco uses RSSI to locate devices through its access points. Access points collect the location data and update the location on the Cisco cloud called Cisco DNA Spaces.

### Monte Carlo sampling

Monte Carlo sampling is a statistical technique used in indoor Wi-Fi mapping to estimate the location of wireless nodes. The process involves creating wireless signal strength maps using a two-step parametric and measurement-driven ray-tracing approach. This accounts for the absorption and reflection characteristics of various obstacles in the indoor environment.
The location estimates are then computed using Bayesian filtering on sample sets derived by Monte Carlo sampling. This method has been found to provide good location estimates of users with sub-room precision using received signal strength indication (RSSI) readings from a single access point.

### Fingerprinting

Traditional fingerprinting is also RSSI-based, but it simply relies on the recording of the signal strength from several access points in range and storing this information in a database along with the known coordinates of the client device in an offline phase. This information can be deterministic or probabilistic. During the online tracking phase, the current RSSI vector at an unknown location is compared to those stored in the fingerprint and the closest match is returned as the estimated user location. Such systems may provide a median accuracy of 0.6m and tail accuracy of 1.3m.
Its main disadvantage is that any changes to the environment, such as adding or removing furniture or buildings, may change the "fingerprint" that corresponds to each location, requiring an update to the fingerprint database. However, integration with other sensors such as cameras can be used in order to deal with a changing environment.

### Angle of arrival

With the advent of MIMO Wi-Fi interfaces, which use multiple antennas, it is possible to estimate the AoA of the multipath signals received at the antenna arrays in the access points, and apply triangulation to calculate the location of client devices. SpotFi, ArrayTrack and LTEye are proposed solutions which employ this kind of technique.
Typical computation of the AoA is done with the MUSIC algorithm. Assuming an antenna array of $M$ antennas equally spaced by a distance of $d$ and a signal arriving at the antenna array through $L$ propagation paths, an additional distance of $d\sin \theta$ is traveled by the signal to reach the second antenna of the array.
Considering that the $k$-th propagation path arrives with angle $\theta _{k}$ with respect to the normal of the antenna array of the access point, $\gamma _{k}$ is the attenuation experienced at any antenna of the array. The attenuation is the same in every antenna, except for a phase shift which changes for every antenna due to the extra distance traveled by the signal. This means that the signal arrives with an additional phase of
$-2\pi \cdot d\cdot \sin(\theta )\cdot (f/c)\cdot (2-1)$
at the second antenna and
$-2\pi \cdot d\cdot \sin(\theta )\cdot (f/c)\cdot (m-1)$
at the $m$-th antenna.
Therefore, the following complex exponential can be used as a simplified representation of the phase shifts experienced by each antenna as a function of the AoA of the propagation path:
$\phi (\theta _{k})=\exp(-j\cdot 2\pi \cdot d\cdot \sin(\theta _{k})\cdot f/c)$
The AoA can then be expressed as the vector ${\vec {a}}(\theta _{k})\gamma _{k}$ of received signals due to the $k$-th propagation path, where ${\vec {a}}(\theta _{k})$ is the steering vector and given by:${\vec {a}}(\theta _{k})=[1,\ \phi (\theta _{k}),\ \dots ,\ \phi (\theta _{k})^{M-1}]^{T}$There is one steering vector for each propagation path, and the steering matrix $\mathbf {A}$ (of dimensions $M\cdot L$) is then defined as:$\mathbf {A} =[{\vec {a}}(\theta _{1}),\dots ,{\vec {a}}(\theta _{L})]$and the received signal vector ${\vec {x}}$ is:${\vec {x}}=\mathbf {A} {\vec {\Gamma }}$where ${\vec {\Gamma }}=[{\vec {\gamma }}_{1}\dots {\vec {\gamma }}_{L}]$ is the vector complex attenuations along the $L$ paths. OFDM transmits data over multiple different sub carriers, so the measured received signals ${\vec {x}}$ corresponding to each sub carrier form the matrix $\mathbf {X}$ expressed as:$\mathbf {X} =[{\vec {x}}_{1}\dots {\vec {x}}_{L}]=\mathbf {A} [{\vec {\Gamma }}_{1}\dots {\vec {\Gamma }}_{L}]=\mathbf {AF}$The matrix $\mathbf {X}$ is given by the channel state information (CSI) matrix which can be extracted from modern wireless cards with special tools such as the Linux 802.11n CSI Tool.
This is where the MUSIC algorithm is applied in, first by computing the eigenvectors of $\mathbf {X} \mathbf {X} ^{H}$ (where $\mathbf {X} ^{H}$ is the conjugate transpose of $\mathbf {X}$) and using the vectors corresponding to eigenvalue zero to calculate the steering vectors and the matrix $\mathbf {A}$. The AoAs can then be deduced from this matrix and used to estimate the position of the client device through triangulation.
Though this technique is usually more accurate than others, it may require special hardware in order to be deployed, such as an array of six to eight antennas or rotating antennas. SpotFi proposes the use of a superresolution algorithm which takes advantage of the number of measurements taken by each of the antennas of the Wi-Fi cards with only three antennas, and also incorporates ToF-based localization to improve its accuracy.

### Time of flight

Time of flight (ToF) localization approach takes timestamps provided by the wireless interfaces to calculate the ToF of signals and then use this information to estimate the distance and relative position of one client device with respect to access points. The granularity of such time measurements is in the order of nanoseconds and systems which use this technique have reported localization errors in the order of 2m. Typical applications for this technology are tagging and locating assets in buildings, for which room-level accuracy (~3m) is usually enough.
The time measurements taken at the wireless interfaces are based on the fact that RF waves travel close to the speed of light, which remains nearly constant in most propagation media in indoor environments. Therefore, the signal propagation speed (and consequently the ToF) is not affected so much by the environment as the RSSI measurements are.
Unlike traditional ToF-based echo techniques, such as those used in RADAR systems, Wi-Fi echo techniques use regular data and acknowledgement communication frames to measure the ToF.
As in the RSSI approach, the ToF is used only to estimate the distance between the client device and access points. Then a trilateration technique can be used to calculate the estimated position of the device relative to the access points. The greatest challenges in the ToF approach consist in dealing with clock synchronization issues, noise, sampling artifacts and multipath channel effects. Some techniques use mathematical approaches to remove the need for clock synchronization.
More recently, the Wi-Fi Round Trip Time standard has provided fine ToF ranging capabilities to Wi‑Fi.

### Self-advertisement

As of 2019, French law requires drones weighing more than 800 grams to broadcast their GPS coordinates, speed, heading, aircraft type, and serial numbers via Wi-Fi. The data is encoded in Wi-Fi beacon frames via an 802.11 vendor element (with the SGSDN's OUI of 6A:5C:35) containing TLV-encoded subfields specified in the legislation.
Although the data format is intended for use in moving aerial vehicles, it can easily be adapted to static Wi-Fi access points (i.e. by setting the horizontal speed field to zero).
The GPS coordinates from these broadcasts are specified to a precision of 10$^{−5}$ decimal degrees, and can be read by Wi-Fi client devices, and then used to infer the position of the client device in conjunction with confirmation from other techniques and data sources.

## Privacy concerns

Citing the specific privacy concerns arising out of WPS, Google suggested a unified approach for excluding a particular access point from taking part in determining location using WPS, supposedly by every access point owner deliberately opting out for each access point to be excluded. Appending "_nomap" to a wireless access point's SSID excludes it from Google's WPS database. Mozilla honors _nomap as a method of opting out of its location service.

## Public Wi-Fi location databases

A number of public Wi-Fi location databases are available (only active projects):
| Name | Unique Wi-Fi networks | Observations | Free database download | SSID lookup | BSSID lookup | Data License | Opt-out | Coverage map | Comment |
| Combain Positioning Service | >2,400,000,000 | >67,000,000,000 | No | Yes | Yes | Proprietary | _nomap | Map Archived 2015-07-06 at the Wayback Machine | Also Cell ID database. |
| LocationAPI.org by Unwired Labs | >1,500,010,000 | >4,100,000,000 | No | No | Yes | Proprietary | No | Map | Also Cell ID database |
| Mylnikov GEO | 860,655,230 | | Yes | No | Yes | MIT | — (aggregator) | Map Archived 2017-09-14 at the Wayback Machine | Also Cell ID database |
| Navizon | 480,000,000 | 21,500,000,000 | No | No | Yes | Proprietary | No | Map Archived 2015-06-22 at the Wayback Machine | Based on crowd-sourced data. Also Cell ID database. |
| radiocells.org | 13,610,728 | | Yes | No | Yes | ODbL | _nomap | Map Archived 2016-02-08 at the Wayback Machine | Based on crowd-sourced data. Also Cell ID database. Including raw data |
| WiGLE | 1,205,634,974 | 16,460,980,303 | No | Yes | Yes | Proprietary | _nomap, request | Map | Also Cell ID and Bluetooth databases. |
| BeaconDB | 17,940,999 | | No | No | Yes | Proprietary | _nomap | Map | Based on crowd-sourced data. Plans to publish data with public domain license. Also Cell ID and Bluetooth databases. |