Abstract
Positioning technologies can be generally divided into indoor and outdoor application scenarios. This paper focuses on an indoor positioning system which is able to be used in the Wireless Local Area Network environment in the hospitals. Compared with traditional techniques, the newly-proposed positioning scheme takes user’s context into consideration, using Radio Frequency Fingerprint Vector (RFFV) as the signal feature to identify and detect the location of the user in the hospital. Besides, space and time factors are considered as the constraints to reduce the positioning errors. Experiment result in hospital environment proves the performance of the scheme is better than those traditional schemes without error correction thus can successfully judge patient’s activity and prevent some accidents.
Introduction
With the development of information technology and wide application of the Internet of Things (IoT) and Location Based Service (LBS), smart living space has become a popular research topic [1]. Indoor positioning technique plays an important role in the study smart living space. Wireless local Area Network (WLAN), as a common network facility nowadays, is an ideal medium to be used as an indoor positioning infrastructure [1–3]. Outdoor techniques like Global Position System (GPS) and Cell Tower Locator (CTL) are hard to provide satisfied services in the indoor environment. Although WLAN covers smaller area than that of GPS and CTL, it provides users with more accurate location information. As for the Radio Frequency Identification (RFID) positioning technique, it requires additional hardware such as RFID chip and reader, which increases the cost of deployment and using.
By preprocessing the real-time collected WLAN data with the consideration of time factor and space factor, this paper proposes a Radio Frequency Fingerprint Vector (RFFV) model and corresponding context aware technologies. The rest of the paper is organized as follows: Section II reviews related work. Section III proposes an algorithm to improve the stability and positioning accuracy in signal fluctuation. Section IV formulates the RFFV model to describe and detect user’s behaviors in the context of WLAN. Section V evaluated the performance of this new positioning scheme. Last section concludes our work.
Related work
Since the Federal Communication Commission of the United States (the FCC) proposed E-911 positioning requirement based on cellular mobile communication systems, many researchers have begun to pay more attention to the wireless positioning technology both in the outdoor and indoor environment [4].
Microsoft firstly proposed a user positioning and tracking system named RADAR based on the radio frequency. RADAR used the radio frequency fingerprint algorithm to calculate the user’s location [5]. Then, Moustafa et al. implemented higher accuracy by using the signal distribution probability to reduce the number of positioning access points (APs) [6]. Some researchers also considered to train the positioning systems by using the Gaussian probability distribution models to reduce the training time. Later, more WLAN-based positioning systems were proposed, like Near-Me and Criket [7–9]. However, many researches always ignored two important factors, namely time-space sampling rate and device calibration [10]. With development of smart devices, some researchers studied meter-level accuracy positioning by using the sensors inside the phones [11]. Karim et al. presented an approach to estimate the local average signal level in an indoor environment based on a wall imperfection model [12]. To reduce the mismatch rate, Liproposed inertial/Wifi/magnetic fusion structure [13]. To recover the missing fingerprint data, Talvitie et al. studied several interpolation and extrapolation methods [14]. In the face of the portable devices with limited power, Wu et al. used online independent support vector machine (OISVM) classification method [15].
A few researchers considered the technologies into the establishment of accurate context-aware services in smart spaces. Scuturici et al. associated the positioning system with the user behaviors in pervasive environment and designed the PsaQL Language and the PerSE platform to prove the advantages in predicting the user behaviors [16]. It was a worthwhile try to link the user behaviors and location positioning changes together. In order to solve the unstable and low accuracy caused by TOA-based positioning ways and services, M. Lombart et al. described a special Wi-Fi positioning system to improve the positioning accuracy in some areas with high density of devices [17]. Alvarez et al. presented a universal human behavior recognition framework based on Fuzzy Rule-based Classifier and Fuzzy Finite State Machine, supported more easily by WLAN facilities [18]. Jeffrey et al. presented an algorithm for multi-dimensional vector regression to realize accurate mapping between the signal and the physical space [19]. Other works tried to improve localization accuracy [20–23]. The above work focuses on improving the accuracy of the static location estimation while they don’t take the moving trace into account.
Generally, the aforementioned works have focused on the positioning technologies and algorithms rather than context-awareness-based applications. Actually, however, the indoor environment is more complex than the outdoor environment. This paper will consider these complex factors that impact the indoor positioning.
Design of radio frequency fingerprint vector
This section formulates the user context with RFFV by analyzing the characteristics of WLAN signal environment. Then based on the natural rules of signal change, we give some approaches to identify the specific user scenarios.
Analysis of WLAN complex signal environment
Received Signal Strength Indication (RSSI) is defined as a measurement of the power present in a received radio signal, it is widely used to reflect the strength of WLAN signal. Previous works have proved that to capture the accurate values of RSSI in a complex layouts space is not easy to achieve [24, 25]. The value may fluctuate over time and even failed to be detected around the edge of the signal covering area. Therefore, it’s essential to establish a RSSI-based wireless positioning technique to represent the natural rules of reflected signal. Besides, ti is also proved by previous work that the RSSI Changes obey the Gaussian distribution.
Assume p is the location to collect WLAN signal from a certain Access Point (AP), n groups of RSSI values are collected during time interval Δt. Then the possibility of collected RSSI value x
i
that represents the signal strength at location p is as in
Where ‘x, σ obeys the following constraints as in Equation (1)
To give the most representative RSSI value, we select the highest probability at location p during time interval Δt,. The detected RSSI at location p is as in
Theoretically, Equation (1)–(4) can effectively filter the outliers. However, because of fluctuation we mentioned above, we’d better take more samples a to achieve better results. In the following sections we will give some methods to reduce the impact of fluctuations before using in the positioning.
In this section, we describe the proposed RFFV model, which is able to describe and predict the user trajectory under indoor conditions. Figure 1 illustrates an example of user trajectory, where the user come through an area covered by 5 Aps along the route RF1-RF2-RF3-RF4. Traditional indoor positioning technology firstly locates the user’s position and then works out his route, which requires high accuracy on locating. Thus, sometimes it may not able to tell whether user is in the neighbor room behind the wall or not. However, in RFFV, when user enters the area at RF1, and if his moving traces from RF1 to RF2 can be detected somehow, it will be possible to predict the trajectory and analyze the user scenarios.

An example of RFFV.
Figure 2 shows a real hospital indoor map with some vectors. Each vector represents a user moving action. RFFV model is proposed to identify the user’s moving trace by evaluating the directional signal attenuation.

The demonstration of RFFVs of WLAN in a real hospital.
Let Ri denotes the received signal feature model of the positioning AP numbered i, and it can be described as follows:
Where M denotes Media Access Control (MAC) address, we use it to distinguish different Aps in our model. V denotes RSSI value measured by dBm to represents the signal feature. Let RFF
i
denote the radio frequency fingerprint., it represents a group of APs’ signal feature in certain position i. RFF
i
is as in
Where n denotes the total number of detectable APs. Assume that the user’s trajectory begins at location p1(x1, y1, z1) and ends at location pm(xm, ym, zm), come across totally m different points. The RF of p
i
can be denoted by Ri(ri1,ri2,... r
in
) (1≤i≤n). Thus, radio frequency fingerprint vector model in this case can be described as (7).
In case that some Aps are temporally undetectable in some position, we use a small negative number like -100 dBm to represent the empty data.
In Fig. 3, we illustrate six different types of vectors that describe different moving activities. Subgraph (a) is a kind of user scenario that shows the location changes in one direction, Subgraph (b) means the user now has three different possible moving detections. Subgraph (c) describes a turning activity. Subgraph (d) shows the user keeps staying at the same location. And (e) means the user is circling. Subgraph (f) shows a dynamically changing from one forward direction into two directions.

Examples of RFFV patterns in space.
We store the predefined RFFV patterns mentioned above in database. So when user starts moving and creates new position information, the system will compare the corresponding vectors with reference vectors. These reference vectors are the basis of analyzing the user’s timely locations.
In this section, we present the RFFV-based indoor context-awareness model in detail.
Factors in WLAN environments
In a dynamic WLAN environment, the context-awareness model should consider many important factors to characterize the user scenarios. They are namely Basic Radio Frequency Fingerprint Vector RFV b , Deviation Vector RFV d , Deviation Vector Set {RFVx}, Deviation Vector RFV d , Deviation Vector Set {RFVx}, Offset Direction of Vector {o i }, Length of Vector m, Set of Sub Scenarios {S sub }, Matching Algorithm, Features of Carrier C and Features of Environment E.
Design of the context-awareness algorithm in WLAN
This section illustrates the awareness algorithm that take all the factors above into consideration. It is two phases namely data pre-processing phase and context identification phase.
Data preprocessing phase
Traditional positioning algorithms often meet the “location jump” problem if they don’t carefully deal with the signal data. In order to improve stability and accuracy, we propose the Time-Space Filtering Method (TS-FM) to preprocess the signal data. We consider both time and space factor as a person cannot appear in two different locations in a very short time, we also consider both the relationship of neighboring location and moving time. Thus, TS-FM can smooth the detected user trajectory, avoiding “location jump” problem.
In TS-FM, when the positioning system calculates the primitive positioning result, it will not be outputted immediately. Instead, the system pushed the result into a FIFO (First In, First Out policy) queue. Let L be the positioning result queue, and denote n as queue length, the formal equation of L can be given in (8)
In (9), N j (n+1) stands for the j-th point. Therefore, we are able to calculate the probability of moving from point n to all of its neighboring positions. Based on these probability, the neighbor with maximum probability is chosen as the final estimated positioning result.
Suppose the current final positioning result pushed to the user is p(n), and the matching positioning result p(n+1) is as in
In (10), function f(x) returns the probability of the next location, while function f-1 (x) returns the location with the probability of x. it filtered some error locations to improve the accuracy and stability of positioning result. To calculate the next location’s probability and the probability of user behaviors, the historical positioning data is used. Besides, the weights of results in the queue are also considered to improve the positioning accuracy.
Since the result queue L may have some duplicated positioning results, we use another queue Lu to store the distinct locations. Lu is represent as
Let Fu be the set of frequency of pi(0<i<m) in L, the set of the frequency of is defined in (12)
Note that we use 2i as the weight of i-th element. This is to amplify the difference between the unique location points in Lu. And then the most likely user location point will be p0, calculated as in
Equation (13) selects the location point with maximum probability in the queue as the next reliable location. It improves the entire stability and fault tolerance in such systems.
Figure 4 gives an example to illustrate how the context identification is processed under single AP environment.

An example of RSSI changes when position changes in the area covered by one AP.
In Fig. 4, RFV(B) is the basic reference value, while RFV(R) is the actual value detected. An experiment was implemented in an area covered with single AP. The bottom and top dotted lines (marked as RFV(L) and RFV(U)) represents the minimum and maximum Deviation RFV respectively. If RFV(R) is completely located in the area between RFV(L) and RFV(U), it matches the context-awareness model as user scenarios. Otherwise, if the line falls outside the dotted line area, such as RFV’(R), the location remain undetermined. This example shows how the context identification is processed for a single AP. Next, we will consider in multiple APs, which is more close to WLAN environment in real life.
Assume that a signal environment has n groups of positioning APs and each group has the same ID, and a predefined context-awareness model is represented by s. Let basic radio frequency fingerprint vector be RFV
b
, real-time radio frequency fingerprint vector be RFV
r
, and deviation radio frequency fingerprint vector be RFV
d
. Here RFV
t
(t ∈ {b, r, d}) is a set used to describe RFV
b
, RFV
r
, and RFV
d
in time t. Let m be the length of RFV
s
, Set(?) be a form of sorted collection. The common definition of three vectors is represented as (14)
Similarly, we have the following equation and inequality of RFb, RFr, and RFd as in
Let vi,j,k stand for the RSSI value of the k-th node of the j-th positioning AP of the i-th point in RFV
t
. It normalizes the real-time data to be in the interval [0, 1], which helps shield the signal difference of various signal carriers. And the corrected RSSI values can be calculated as in
For more complex situations that the context-awareness model has a cross-sectional area when combining the RFV
d
, we divide the senario into several sub scenarios with different directions of vectors. The definition of their directions can be described by using linear regression equation. Thus, the offset angle o(t) compared with RFV
b
are as in (18),(19).
If we define a direction set of context-awareness model as {o(b)i}, the condition to define the sub set is:
In (20), e stands for direction error vector.
When determining the specific context-awareness model, it is necessary to consider the directions of real-time RFFV {o i } and the description in corresponding context {S i }, which satisfies o i ⟶S i . After all of these steps, the system can provide the users with diverse location-based services in smart spaces based on the detected contexts.
Experimental analysis
To evaluate the performance of the new proposed models and algorithms, we implemented serval experimental analyses with different conditions in the real hospital environment. We use wearable devices such as smart bracelet and mobile phones to receive WLAN signals. We first tested the RSSI value changes when meeting obstacles in hospitals, then verify the effectiveness of the Time-Space Filtering Method, and finally successfully judged the patient’s behavior by using our model.
Analysis of signal changes in different obstacles
To evaluate the influence on the signal transmission in a complex indoor environment, we tested the RSSI values with the influence of indoor environment, the results are shown in Fig. 5.

The influence of the door against the signal inside and outside.
In this experiment, we tested and recorded the received signal strength affected by the barrier of the wall and wooden doors between the current location and APs. According to the results, the influence of a wooden door is relatively weak. The signal difference between with and without a door is approximately 10 dB. Howerver, the signal transmission was significantly influenced by the barrier of the wall. Thus, the experiment shows that the environment condition should be took into consideration especially there are barriers like doors and walls when correcting the calculated positioning results.
This section evaluate the TS-FM algorithm by implement an experiment. We assume that the user take the route a— >b— >b— >c— >a— >b in order, and the current user’s position is denoted as b, the neighbor positions of which are e, f, and g. The probabilities of moving from b to e, f, and g are respectively 0.3, 0.5, and 0.2. As shown in Table 1, by comparing the traditional method and our new method to correct the random result, the results indicated that when the signal changes, the independent-collected method (ICM) positioning result almost failed to locate the user while TS-FM holds a high matching percentage, which will link the correct location.
Comparison of the generated results between two methods
Comparison of the generated results between two methods
We use the weight of location to qualify the user preferences on the positions. A larger weight lead to a greater probability of the location where the user is. As shown in Fig. 6, the experiment showed that TS-FM is more sensitive and more likely to predict the correct location.

The path matching probability with the changes of the weight of actual location points.
Figure 6 indicates that ICM kept stable over the increasing of position weight, while the TS-FM is sensitive to the changes of location weight. Especially, when the weight is greater than 4, the probability of locating this position in TS-FM reaches 0.9. Sensitivity on location weights improves the accuracy of context-awareness.
We use the following signal generation detected function to illustrate the signal decay,
Where r i is the i-th (1≤i≤m) positioning AP, k denotes signal decay rate, x denotes a counter, b denotes a constant, d denotes the standard deviation of Gaussian distribution, and N i stands for the Gaussian function of i-th positioning AP.
In this experiment, we set 5 positioning APs, whose initiated values were r1(5, –80, 5, x), r2(5, –70, 5, x), r3(–5, –20, 5, x), r4(–3, –50, 5, x), and r5(4, –75, 5, x) where ri,max = –20 and ri,min = –85. The context-awareness model is defined as s, in which the basic radio frequency vector is {m1, m2, m3}, its signal data set is {{–80, –69, –17}, {–71, –62, –27}, {–43, –30, –61}, {–29, –19, –72}, {–29, –19, –72}}, direction set is {19, 20.5, –26.5} and the standard deviation for RSSI is 5.0.
On the other hand, in the real environment, to evaluate the captured actual RFFV, an experiment is implemented to create the basic RFFV standing for the scenario “enter the room”. We implement the experiment 5 times with the total time cost of approximately 5–8 seconds.
Figure 7 presents the changes of RSSI values captured in each AP when user entered a room. If we reverse the sequence of x axis, the signal features of the activity “leaving the room” was captured. This experiment indicates that using our WLAN positioning technology is completely capable of capturing the user scenario in the hospital context.

The signal changes of the scenario “enter the room” after the correction.
This paper proposed an indoor positioning scheme based on the detection and reasoning of WLAN signal applied in the hospital. We use RFFV and some reasoning rules to realize the accurate positioning in the indoor environment. One of the most important rules is the Time-Space Filtering Method, which combines time and space factors into consideration to improve the stability of positioning in real-time positioning. The experiments validate the theories in this paper and proved the feasibility of the new scheme. The user’s context is also considered in our new proposed scheme. This study further suggests that the context-aware based information reasoning and pushing is a valuable research topic applied in wearable devices in the hospitals in the future.
Footnotes
Acknowledgments
This work was partially supported by a key project of National Natural Science Foundation of China under grant number 71532002, the Fundamental fund for Humanities and Social Sciences of Beijing Jiaotong University(Grant number 2016JBZD01), the Fundamental Research Funds for the Central Universities under grant number 2016YJS057, Beijing Social Science Foundation under grant number 15JDJGC019, and Beijing Logistics Informatics Research Base.
