Abstract
RSSI wireless signal is a reference information that is widely used in indoor positioning. However, due to the wireless multipath influence, the value of the received RSSI will have large fluctuations and cause large distance error when RSSI is fitted to distance. But experimental data showed that, being affected by the combined factors of the environment, the received RSSI feature vector which is formed by lots of RSSI values from different APs is a certain stability. Therefore, the paper proposed RSSI-based fingerprint feature vector algorithm which divides location area into grids, and mobile devices are localized through the similarity matching between the real-time RSSI feature vector and RSSI fingerprint database feature vectors. Test shows that the algorithm can achieve positioning accuracy up to 2–4 meters in a typical indoor environment.
1. Introduction
Localization technology based on RSSI (Received Signal Strength Indication) makes use of radio frequency signals to estimate the distance between the transmitting and receiving devices. Then the position of mobile device is obtained by those distances with trilateration technique algorithm [1]. Currently, localization algorithm is divided into two categories, ranging algorithm and nonranging algorithm. Among them, ranging algorithm is implemented in the way of trilateration, triangulation, or maximum likelihood estimation by measuring the distance and angle between receptors and transmitters, such as TOA, TDAO, and AOA. Nonranging localization algorithm is implemented by the connectivity between different devices and does not need the information of distances and angles. Furthermore, the distances based on RSSI can be measured by the signals transmitted from wireless communication devices, and this kind of localization will not increase hardware costs, so it is the common method for localization in wireless sensor networks [2–9].
But in the actual applications, the distance measurement based on RSSI is influenced by reflection, multipath, antenna gain, and so forth, and large positioning error is caused. Therefore, the localization method based on fingerprint feature vector is put forward in this paper. First, the location area will be divided into grids, and the received RSSI values of all Wi-Fi sources in each grid will be collected. Second, all the received RSSI values will be stored into fingerprint database which can be formed by training sample vectors. Third, the localization results are obtained through the similarity matching between the real-time RSSI value vector of mobile devices and fingerprint database in actual positioning. In this method of localization, neither the known coordinates of Wi-Fi sources are necessary, nor does the RSSI value need to be transferred into distances, so it can reduce the impact of environmental factors.
2. Wireless Localization Design Based on RSSI Fingerprint Feature Vector
In the course of wireless localization based on RSSI fingerprint feature vector, the RSSI values received from all of the wireless APs make up the fingerprint feature vectors of the location grids, and the fingerprint database is established. Then the real-time RSSI value vector received can be identified for fingerprint positioning. Its positioning process is divided into two stages, which are the establishment of fingerprint database and real-time positioning, and shown in Figure 1.

Framework of Wi-Fi localization based on RSSI fingerprint.
In the course of wireless localization based on RSSI fingerprint feature vector, first, a lot of Wi-Fi signal devices are arranged, typically wireless APs (Access Point), and the number of APs is in correspondence with the dimensions of vector, here represented by k. Then the localization area is divided into a number of grids, here represented by
In the stage of establishment of fingerprint database, the RSSI values and MAC (Media Access Control) address in each center of all the grids are collected, and they are stored into the database. Due to environmental factors, single RSSI value is not stable. In order to weaken the influence of unstable RSSI values, multiple times of measurements are carried out and averaged in each grid. In real-time localization stage, the real-time location of the grid is calculated by comparing real-time RSSI value vector received with grid vectors in the database. To the end, the method includes the RSSI data collection and establishment of fingerprint database, grid matching and localization for real-time RSSI value vector, and accuracy analysis of the positioning results, and they will be introduced separately in the following.
3. The Data Collection and Organization of RSSI Fingerprint Feature Vector
3.1. Data Collection Points Arrangement for RSSI Fingerprint Feature Vector
As is shown in Figure 2, location area is divided into closely linked grids, and the grids can be arbitrarily sized and shaped. In order to illustrate the idea of positioning, the grids are set to squares in the paper; at the same time, the size of the grid represents the spatial positioning accuracy. All grids are numbered from southwest to northeast orderly, and there are a lot of wireless signal devices in the targeted area, ranked by

Schematic diagram of grid data collection in localization area.
Typically, the larger vector dimensions of k, the richer expression of vector features, and the higher difference between different vectors will be acquired. In order to improve the wireless Wi-Fi positioning accuracy, enough wireless APs should be laid in the location area, but it also makes the RSSI data collection capacity increase. For example, a location area is 100 × 80 m, mesh size is 2 × 2 m, and the number of the wireless APs is 20; then the recorded number of RSSI values to be stored is 100 × 80 × 20/(2 × 2) = 40000. For the purpose of management of all the grid vector data effectively, database is suitable for storing and organization of the received RSSI data.
3.2. Data Organization of RSSI Fingerprint Feature Vectors
Large quantity of RSSI fingerprint feature vector needs to be read for localization each time. Therefore, a more efficient data organization way needs to be used in terms of matching algorithm characteristics on RSSI feature vectors.
In order to improve data management flexibility for all of the APs, each piece of wireless AP data is stored in a separate table; that is, the number of RSSI data tables is equal to the number of the wireless APs, and all the tables have the same structure. Thus RSSI data in the table is consistent with the array of RSSI data collection grids, as shown in Table 1.
The structure of RSSI data table.
In the table, m, n correspond to the values of the row and column of the grids, respectively. “MACid” is the primary key for each record, and
In practical applications, the number of wireless APs may appear as changes with equipment damage, updates, and so forth; to this end, the fingerprint database must be adjusted. Therefore, only the changed RSSI data tables need to be updated, and the modification of the database can be accomplished easily; at the same time, the design of the database has a good flexibility. In the course of localization, the RSSI data from all the APs must be queried and read, and its process from data query to build a fingerprint feature vector is shown in Figure 3.

The process of RSSI data query and fingerprint feature vector construct.
In light of the given row and column of the grid ranked by
4. Grids Matching and Localization of RSSI Fingerprint Feature Vector
4.1. The Localization Algorithm of RSSI Fingerprint Feature Vector
After a given database, the received wireless AP RSSI value vector will compare with the vectors in the fingerprint database in terms of certain matching algorithm, and the mobile location will be estimated. Among them, the matching algorithm is key to the efficiency and positioning accuracy of localization. The usual matching algorithms are nearest neighbor, K-nearest neighbor, and neural networks [10]. The method of vector angle is used in this paper.
Assuming that the observations of received real-time RSSI vector at the mobile device are
4.2. Similarity Matching Based on Vector Cosine
There are two ways on determination of vector similarity, that is, the similarity function and distance measurement [11]. Among them, similarity function is more popular in practical applications, and the common similarity functions are as follows: vector cosine method, correlation coefficient, generalized Dice coefficient, and generalized Jaccard coefficient method. Vector cosine function is adopted in this paper.
Vector cosine is used to calculate the angle between two vectors. Assume that the cosine of the angle between two vectors x and y is shown in
The geometric meaning of vector cosine is characterized by the angular dimension between two vectors in N-dimensional space. Generally, dimensionless treatment for vector elements is required beforehand, and the vector elements are made to be positive; then the cosine of the angle will be at the range of
In practical application, assume that the real-time RSSI vector of mobile devices is

Matching diagram of grids vectors.
Among them, k is the number of APs and also for the dimension of a grid vector. As to each real-time mobile localization, the number of
5. Wireless Localization Experiment for RSSI Fingerprint Feature Vector
Using Java programming language, the Wi-Fi wireless positioning system based on RSSI fingerprint feature vectors has been designed and implemented. Among them, RSSI data collection for mobile devices is developed in Android platform, and the collected RSSI data can be stored into SQLite database in accordance with Section 3.2 in this paper. Then the data in SQLite is dumped into PostgreSQL database. Finally, the data management and application services are developed by the use of Eclipse + Mybatis programming tools, so the cosine between real-time RSSI vector and fingerprint feature vector can be calculated, and also the positioning result corresponding to the largest vector cosine value can be acquired.
The following scenario is as an example of a gymnasium. A wireless localization experiment based on RSSI fingerprint feature vector is made by using this developed program, and the RSSI collection and distribution of the fingerprint database in the stadium area are in Figure 5.

Distribution diagram of RSSI grids in positioning area.
As shown in Figure 6, the whole localization area is divided into grids by the size of 2 m × 2 m, and it comprises grids by the number of 15 rows × 28 columns; at the same time, the field RSSI vector data in each grid is collected. Meanwhile, there are 22 kinds of Wi-Fi signals which can be received in any of the grids, including China Telecom and China Mobile, and 20 of them were selected for the experiment. The results of RSSI data distribution and storage of the grid with the MAC address of 00: 24: b2: eb: 21: 21 wireless AP are shown in Figure 6.

RSSI data storage in database.
In this scenario, RSSI value vector of each grid is selected as real-time reference vector individually and used to perform vector cosine matching localization. Meanwhile, in order to check out the positioning results, all kinds of Wi-Fi signals are divided into three groups of 7 + 7 + 6 in Table 2, and different RSSI value deviations are given to the elements of positioned vector, whereby the corresponding different real-time vectors are obtained. In different RSSI deviation range and accuracy, the correct rate of localization by a total of 420 grids is shown in Table 2.
Localization results based on RSSI fingerprint feature.
As shown in Table 2,
Under the conditions of the fingerprint database and the deviations of the real-time RSSI vector elements being within 10, the correct rate of localization is more than 90%, which can meet necessity for the mostly actual application. Meanwhile, with the vector dimension increasing, the correct rate of localization will be improved to some extent.
At the same time, the computational complexity and cost have been tested with Lenovo K23, and the results are shown in Table 3.
Computational complexity and cost of wireless localization.
As shown in Table 3, with the increase of the times of localization in scenario of this paper, the computational complexity and time costs are also increased, and the growth of time costs is not obvious with the increase of times of localization.
6. Conclusion
The errors of fitted distance with RSSI values are large, because they are affected by multipath and other factors in indoor positioning environment. In this paper, without fitting distance, also without position of the known APs, the real-time localization results can be obtained by matching similarity between real-time RSSI feature vector and different fingerprint feature vectors. At the same time, with an actual experiment, good results of localization are achieved.
Footnotes
Conflict of Interests
The authors declare that there is no conflict of interests regarding the publication of this paper.
Acknowledgment
The work was supported by the National Natural Science Foundation of China (61373147 and 41204032).
