# An Optimization Method Combining RSSI and PDR Data to Estimate Distance between Smart Devices for COVID-19 Contact Tracing

Authors: Bo Zhao; Chao Zheng; Xinxin Ren; Jianrong Dai
Journal: Journal of Healthcare Engineering
 (2023)

---

## Abstract

Distance estimation methods arise in many applications, such as indoor positioning and COVID-19 contact tracing. The received signal strength indicator (RSSI) is favored in distance estimation. However, the accuracy is not satisfactory due to the signal fluctuation. Besides, the RSSI-only method has a large-ranging error because it uses fixed parameters of the path loss model. Here, we propose an optimization method combining RSSI and pedestrian dead reckoning (PDR) data to estimate the distance between smart devices. The PDR may provide high accuracy of walking distance and direction. Moreover, the parameters of the path loss model are optimized to dynamically fit the complex electromagnetic environment. The proposed method is evaluated in outdoor and indoor environments and compared with the RSSI-only method. The results show that the mean absolute error is reduced up to 0.51 m and 1.02 m, with an improvement of 10.60% and 64.55% for outdoor and indoor environments, respectively, compared with the RSSI-only method. Consequently, the proposed optimization method has better accuracy of distance estimation than the RSSI-only method, and its feasibility is demonstrated through real-world evaluations.


---

## Body

## 1. Introduction

In the field of the Internet of things (IoT), excellent distance estimation is the key point for many applications [1–3], such as indoor positioning for wireless sensor networks (WSNs) and danger alerts for unmanned vehicles on the road [4, 5]. For human beings, currently, mobile smartphone apps are used to facilitate COVID-19 contact tracing [6, 7]. If two people carrying smartphones contact close to one another (generally, within 2 meters), then the apps on their smartphones will both record this contact event. The exposure notifications will be provided when one is diagnosed with COVID-19. The apps focus on the task of proximity sensing, which is relied on predicting accurate distance between the two smartphones [8].In recent years, the received signal strength indicator (RSSI) of Bluetooth low-energy (BLE) has been exploited for distance estimation [9, 10]. RSSI-distance estimation method is based on the theoretical log-distance path loss (LDPL) model, which describes that the signal value attenuates as the distance increases [11, 12]. The LDPL model contains two main parameters, the RSSI at the reference distance (named as A) and the path loss exponent (named as n) [13]. These two parameters need to be calibrated before distance measurement for a known scenario. However, for an unknown situation, distance estimation may have inaccuracies because it uses parameters not fitted to this environment [14]. Furthermore, RSSI fluctuates significantly in an indoor environment [15]. Despite the limitations in RSSI and LDPL models, the RSSI-only method is still widely used for distance estimation applications, such as Google/Apple Exposure Notification (GAEN) app for COVID-19 contact tracing [16]. Leith and Farrell report on the evaluation results of this app in a commuter bus [17]. However, they find that the attenuation level indicated by the app need not increase with the distance between phones. The results showed that the distance estimation method of this app might have inaccuracies because it uses parameters not fitted to an unknown situation.On the other hand, pedestrian dead reckoning (PDR) is recognized as a relative localization technique, which predicts the current location by taking into account the three main inputs, i.e., pedestrian’s start position, walking distance, and walking direction [18]. It utilizes multiple sensors available in smart devices; for instance, magnetometer, gyro, and accelerometer sensors [19, 20]. Since the properties of the RSSI-based distance estimation method and PDR-based localization method are complementary, so the combination of these two methods would be beneficial to improve the estimation accuracy. Han et al. proposed a probabilistic position selection algorithm based on the RSSI and PDR, which needs a number of BLE beacons deployed in an indoor environment [21]. Moreover, recent studies try to dynamically adjust the parameters of the RSSI-distance model by using a neural network. Shi et al. built the RSSI-distance model with the backpropagation neural network (BPNN), which requires a huge amount of data to train the neural network before distance estimation [22, 23]. Nonetheless, it is challenging to implement these above methods into real-time COVID-19 contact tracing due to deploying dozens of beacons, requiring a large amount of calibrated data and training the neural network for the known scenario before distance estimation [24].Given the need for better distance estimation without time-consuming beacon deployment and neural network training in advance, we propose an optimization method combining RSSI and PDR data, which can dynamically adapt to different environments, especially for an unknown situation.In summary, this paper has the following contributions:(i)
An optimization method is developed to estimate the distance between smart devices by combining RSSI and PDR data. The method optimizes the parameters of the RSSI-distance model and the relative locations of each pair of devices simultaneously.(ii)
The method does not require a time-consuming fingerprint database build-up or beacon deployment for an unknown environment. Thus, it has high feasibility and low complexity.(iii)
The performance of the method is tested in outdoor and indoor environments. The results show better accuracy of distance estimation than the RSSI-only method.The rest of this paper is organized as follows: Section2 describes the proposed distance estimation method. Section 3 shows the experimental setup and procedure, as well as the evaluation results for several scenarios in outdoor and indoor environments. Finally, Section 4 concludes this paper and presents some future directions.


## 2. Materials and Methods

In order to illustrate the proposed distance estimation method, we consider the general situation as follows. For a pair of two smart devices, device #1 and device #2 suppose that there arem sampling points during their recorded contacting paths, as Figure 1 shows.Figure 1
Schematic diagram of the recorded contacting path from device #1 and device #2.In Figure1, xi,yi denotes the coordinates of the device at the ith sampling point, Li denotes the walking distance from the i−1th sampling point to the i th, αi denotes the walking direction, 0≤α<360, and di denotes the real distance between two devices at the i th sampling point. The subscripts 1 and 2 of x, y, L, and α represent device #1 and device #2, respectively. The subscript 0 represents the start point of this recorded contacting path. Additionally, at each sampling point, the receiver will record the RSSI, which can be denoted as Ri for the ith time point. Matrix Q is defined to contain all of the previous data, that is,(1)Q=L1,0α1,0L2,0α2,0R0⋮L1,iα1,iL2,iα2,iRi⋮L1,mα1,mL2,mα2,mRm.For simplicity’s sake, the start point of device #1 is defined as the origin of the coordinate system, and the start point of device #2 is defined as∆x,∆y in this coordinate system, that is,(2)x1,0=0,y1,0=0,(3)x2,0=∆x,y2,0=∆y.The distance between the two devices can be calculated from both the RSSI-only method and the PDR-based method. These two methods will be described in the following.


### 2.1. Distance Estimation by Using RSSI-Only Method

The RSSI-only method generally uses the log-distance path loss (LDPL) model [13]. It is expressed as follows:(4)RSSI=A−10∗n∗lgdd0+ε,where d is the distance between the transmitter and the receiver, and n is the path loss exponent which varies depending upon the radio propagation environment. A is the RSSI at the reference distance d0 from the transmitter. ε is a Gaussian distribution random variable with mean zero. For convenience, d0 is assigned as 1 meter, and ε has a mean value of zero. Then, the LDPL model can be obtained as follows:(5)RSSI=A−10∗n∗lgd.According to equation (5), the distance at the kth sampling point can be calculated by the following equation:(6)dr,k=10A−Rk/10∗n.Consequently, the distance estimation of the RSSI-only method is as follows:(7)dr=dr,0,dr,1,…,dr,k,…,dr,m,can be written as a function of R, A, and n, that is,(8)dr=gR,A,n,it can also be written as follows:(9)dr=gQ,A,n,where Q is the known data, and A and n are the optimization variables.In this study, the LDPL model is optimized by particle swarm optimization without training. The RSSI-distance between two devicesdr is achieved during the optimization process, which is also a part of the optimization objective function.


### 2.2. Distance Estimation by Using PDR-Based Method

The PDR is a relative location method based on walking data of pedestrians, which can navigate with low-cost devices (e.g., the inertial sensors available in most smartphones, such as accelerometer, magnetometer, and gyro sensor) [25, 26]. It is comprised of three main parts: (i) pedestrian’s start location, (ii) walking distance, and (iii) walking direction, as depicted in Figure 2, where E and N represent the East and North directions, respectively.Figure 2
Schematic diagram of pedestrian dead reckoning (PDR) method for distance estimation.The formula for the PDR can be defined as follows:(10)xk=x0+∑i=1kLisinαi,yk=y0+∑i=1kLicosαi.Here,αi and Li represent the walking direction (the angle between forwarding direction and North), and the walking distance from the i−1th sampling point to the ith, respectively. The coordinates can be calculated by equation (10) if αi and Li are obtained.According to equations (2) and (10), the coordinates of device #1 at the kth sampling point are as follows:(11)x1,k=x1,0+∑i=1kL1,isinα1,i=∑i=1kL1,isinα1,i,(12)y1,k=y1,0+∑i=1kL1,icosα1,i=∑i=1kL1,icosα1,i.Similarly, according to equations (3) and (10), the coordinates of device #2 at the kth sampling point are as follows:(13)x2,k=x2,0+∑i=1kL2,isinα2,i=∆x+∑i=1kL2,isinα2,i,(14)y2,k=y2,0+∑i=1kL2,icosα2,i=∆y+∑i=1kL2,icosα2,i.So, for the PDR-based method, the distance at thekth sampling point can be calculated by the following equation:(15)dp,k=∆x+∑i=1kL2,isinα2,i−∑i=1kL1,isinα1,i2+∆y+∑i=1kL2,icosα2,i−∑i=1kL1,icosα1,i21/2.Consequently, the distance estimation of the PDR-based method is as follows:(16)dp=dp,0,dp,1,…,dp,k,…,dp,m,can be written as a function of L, α, ∆x, and ∆y, that is,(17)dp=hL,α,∆x,∆y,it can also be written as follows:(18)dp=hQ,∆x,∆y,where Q is the known data and ∆x and ∆y are the optimization variables.In this study, the PDR-distance between two devicesdp is obtained from the coordinates of the two devices’ locations. dp is also a part of the optimization objective function.


### 2.3. Proposed Optimization Method Combining RSSI and PDR Data

Based on equations (9) and (18), the objective function of the distance estimation optimization problem is proposed as follows:(19)minfdr,dp,that is,(20)minA,n,∆x,∆yfgQ,A,n,hQ,∆x,∆y.The functionf is defined as follows:(21)fdr,dp=∑i=1mdr,i−dp,i2.So, the objective function can be written as follows:(22)min∑i=1mdr,i−dp,i2,that is,(23)minA,n,∆x,∆y∑i=1mgQ,A,n−hQ,∆x,∆y2,where Q is the known data and A, n,∆x, and ∆y are the optimization variables. The values of ∆x and ∆y can be determined after optimization, and then the estimated distance can be obtained based on the equation (18).In addition, for three-dimensional cases, the formulation could be extended straightforwardly, that is, the optimization problem can be expressed as follows:(24)minA,n,∆x,∆y,∆z∑i=1mgQ,A,n−hQ,∆x,∆y,∆z2.For COVID-19 contact tracing, the risk estimation mainly depends on the two-dimensional plane distance between side-by-side persons. Therefore, this paper only focuses on the solution method of two-dimensional optimization problems.The constraints of this optimization problem include three items as follows:(1)
The domain of the model parametersA and nFor common smartphones, the value ofA is in the range of −80 dBm and −40 dBm. n is the path loss exponent that varies depending on the radio propagation environment. T. S. Rappaport gives typical values for n in outdoor and indoor environments. The minimal value of n is 2 for free space, while the maximum can be set to 6 for obstructed building. The constraints are written as follows:(25)−40−A≥0,A+80≥0,n−2≥0,6−n≥0.(2)
The domain of the relative coordinates of device #2 start pointDue to the range of Bluetooth low-energy (BLE) is about 100 m, the minimal relative coordinate value of device #2 start point can be set to −100 m, and the maximum can be set to 100 m. The constraints are written as follows:(26)∆x+100≥01,00−∆x≥0,∆y+100≥0,100−∆y≥0.(3)
The effective measurable range of the proposed distance estimation methodThe effective measurable range depends on the application scenario. For COVID-19 contact tracing apps, the minimal effective distance can be set to 0.1 m, and the maximum can be set to 10 m. The constraints are written as follows:(27)gQ,A,n−0.1≥0,10−gQ,A,n≥0,hQ,∆x,∆y−0.1≥0,10−hQ,∆x,∆y≥0.The previous optimization problem is solved by the particle swarm optimization (PSO) algorithm. The PSO algorithm first creates initial particles and then assigns initial velocities to them. It evaluates the objective function (fitness) of each particle position and determines the best function value and the best position. It selects a new velocity based on the current velocity, the individual best position of the particle (pbest), and the best position among all the population (gbest). Then, it iteratively updates the particle position and velocity (the new position is the old position plus the velocity, and keeps the particle within the boundary). The algorithm iterates until it reaches the stopping criterion. The following two equations illustrate the searching process:(28)vi,j+1=w∗vi,j+c1∗u1∗pbesti−xi,j+c2∗u2∗gbestj−xi,j,xi,j+1=vi,j+xi,j,where i denotes the particle index and j denotes the iteration index. xi,j and vi,j represent the position and velocity of particle i in iteration j, respectively. u1 and u2 are random numbers uniformly distributed in the interval (0, 1). c1 and c2 are positive constants, where c1 is the self-adjustment weight and c2 is the global adjustment weight. w presents inertia weight. In this study, the value of w was constantly reduced from 0.8 to 0.4 during the searching process. c1 and c2 were set to 0.4 and 0.6, respectively.


## 2.1. Distance Estimation by Using RSSI-Only Method

The RSSI-only method generally uses the log-distance path loss (LDPL) model [13]. It is expressed as follows:(4)RSSI=A−10∗n∗lgdd0+ε,where d is the distance between the transmitter and the receiver, and n is the path loss exponent which varies depending upon the radio propagation environment. A is the RSSI at the reference distance d0 from the transmitter. ε is a Gaussian distribution random variable with mean zero. For convenience, d0 is assigned as 1 meter, and ε has a mean value of zero. Then, the LDPL model can be obtained as follows:(5)RSSI=A−10∗n∗lgd.According to equation (5), the distance at the kth sampling point can be calculated by the following equation:(6)dr,k=10A−Rk/10∗n.Consequently, the distance estimation of the RSSI-only method is as follows:(7)dr=dr,0,dr,1,…,dr,k,…,dr,m,can be written as a function of R, A, and n, that is,(8)dr=gR,A,n,it can also be written as follows:(9)dr=gQ,A,n,where Q is the known data, and A and n are the optimization variables.In this study, the LDPL model is optimized by particle swarm optimization without training. The RSSI-distance between two devicesdr is achieved during the optimization process, which is also a part of the optimization objective function.


## 2.2. Distance Estimation by Using PDR-Based Method

The PDR is a relative location method based on walking data of pedestrians, which can navigate with low-cost devices (e.g., the inertial sensors available in most smartphones, such as accelerometer, magnetometer, and gyro sensor) [25, 26]. It is comprised of three main parts: (i) pedestrian’s start location, (ii) walking distance, and (iii) walking direction, as depicted in Figure 2, where E and N represent the East and North directions, respectively.Figure 2
Schematic diagram of pedestrian dead reckoning (PDR) method for distance estimation.The formula for the PDR can be defined as follows:(10)xk=x0+∑i=1kLisinαi,yk=y0+∑i=1kLicosαi.Here,αi and Li represent the walking direction (the angle between forwarding direction and North), and the walking distance from the i−1th sampling point to the ith, respectively. The coordinates can be calculated by equation (10) if αi and Li are obtained.According to equations (2) and (10), the coordinates of device #1 at the kth sampling point are as follows:(11)x1,k=x1,0+∑i=1kL1,isinα1,i=∑i=1kL1,isinα1,i,(12)y1,k=y1,0+∑i=1kL1,icosα1,i=∑i=1kL1,icosα1,i.Similarly, according to equations (3) and (10), the coordinates of device #2 at the kth sampling point are as follows:(13)x2,k=x2,0+∑i=1kL2,isinα2,i=∆x+∑i=1kL2,isinα2,i,(14)y2,k=y2,0+∑i=1kL2,icosα2,i=∆y+∑i=1kL2,icosα2,i.So, for the PDR-based method, the distance at thekth sampling point can be calculated by the following equation:(15)dp,k=∆x+∑i=1kL2,isinα2,i−∑i=1kL1,isinα1,i2+∆y+∑i=1kL2,icosα2,i−∑i=1kL1,icosα1,i21/2.Consequently, the distance estimation of the PDR-based method is as follows:(16)dp=dp,0,dp,1,…,dp,k,…,dp,m,can be written as a function of L, α, ∆x, and ∆y, that is,(17)dp=hL,α,∆x,∆y,it can also be written as follows:(18)dp=hQ,∆x,∆y,where Q is the known data and ∆x and ∆y are the optimization variables.In this study, the PDR-distance between two devicesdp is obtained from the coordinates of the two devices’ locations. dp is also a part of the optimization objective function.


## 2.3. Proposed Optimization Method Combining RSSI and PDR Data

Based on equations (9) and (18), the objective function of the distance estimation optimization problem is proposed as follows:(19)minfdr,dp,that is,(20)minA,n,∆x,∆yfgQ,A,n,hQ,∆x,∆y.The functionf is defined as follows:(21)fdr,dp=∑i=1mdr,i−dp,i2.So, the objective function can be written as follows:(22)min∑i=1mdr,i−dp,i2,that is,(23)minA,n,∆x,∆y∑i=1mgQ,A,n−hQ,∆x,∆y2,where Q is the known data and A, n,∆x, and ∆y are the optimization variables. The values of ∆x and ∆y can be determined after optimization, and then the estimated distance can be obtained based on the equation (18).In addition, for three-dimensional cases, the formulation could be extended straightforwardly, that is, the optimization problem can be expressed as follows:(24)minA,n,∆x,∆y,∆z∑i=1mgQ,A,n−hQ,∆x,∆y,∆z2.For COVID-19 contact tracing, the risk estimation mainly depends on the two-dimensional plane distance between side-by-side persons. Therefore, this paper only focuses on the solution method of two-dimensional optimization problems.The constraints of this optimization problem include three items as follows:(1)
The domain of the model parametersA and nFor common smartphones, the value ofA is in the range of −80 dBm and −40 dBm. n is the path loss exponent that varies depending on the radio propagation environment. T. S. Rappaport gives typical values for n in outdoor and indoor environments. The minimal value of n is 2 for free space, while the maximum can be set to 6 for obstructed building. The constraints are written as follows:(25)−40−A≥0,A+80≥0,n−2≥0,6−n≥0.(2)
The domain of the relative coordinates of device #2 start pointDue to the range of Bluetooth low-energy (BLE) is about 100 m, the minimal relative coordinate value of device #2 start point can be set to −100 m, and the maximum can be set to 100 m. The constraints are written as follows:(26)∆x+100≥01,00−∆x≥0,∆y+100≥0,100−∆y≥0.(3)
The effective measurable range of the proposed distance estimation methodThe effective measurable range depends on the application scenario. For COVID-19 contact tracing apps, the minimal effective distance can be set to 0.1 m, and the maximum can be set to 10 m. The constraints are written as follows:(27)gQ,A,n−0.1≥0,10−gQ,A,n≥0,hQ,∆x,∆y−0.1≥0,10−hQ,∆x,∆y≥0.The previous optimization problem is solved by the particle swarm optimization (PSO) algorithm. The PSO algorithm first creates initial particles and then assigns initial velocities to them. It evaluates the objective function (fitness) of each particle position and determines the best function value and the best position. It selects a new velocity based on the current velocity, the individual best position of the particle (pbest), and the best position among all the population (gbest). Then, it iteratively updates the particle position and velocity (the new position is the old position plus the velocity, and keeps the particle within the boundary). The algorithm iterates until it reaches the stopping criterion. The following two equations illustrate the searching process:(28)vi,j+1=w∗vi,j+c1∗u1∗pbesti−xi,j+c2∗u2∗gbestj−xi,j,xi,j+1=vi,j+xi,j,where i denotes the particle index and j denotes the iteration index. xi,j and vi,j represent the position and velocity of particle i in iteration j, respectively. u1 and u2 are random numbers uniformly distributed in the interval (0, 1). c1 and c2 are positive constants, where c1 is the self-adjustment weight and c2 is the global adjustment weight. w presents inertia weight. In this study, the value of w was constantly reduced from 0.8 to 0.4 during the searching process. c1 and c2 were set to 0.4 and 0.6, respectively.


## 3. Results and Discussion

The proposed scheme is integrated into smartphones with Android or IOS system. Then, the method is evaluated in outdoor and indoor environments and compared with the RSSI-only method. The results will be illustrated in the following.


### 3.1. Outdoor Experiments with Participants

We placed 13 sampling points (A∼M) on outdoor park ground, as the following Figure3 shows. Two participants walked from the start point to the endpoint with smartphones, following the designed path (detailed description in Table 1). The first participant held device #1 (iPhone XS) as a transmitter; the second participant held device #2 (Samsung Note10) as a receiver.Figure 3
The experimental setup in the outdoor environment: (a) the picture of the park ground and (b) the schematic diagram of the experimental setup for the park ground. The side length of the grid is about 0.5 meters, and the 13 sampling points (A∼M) were located at the vertex of the grid.
(a)(b)Table 1
The results of the outdoor experiments.
Path indexDesigned scenarioDesigned path and distance symbol (#1 location-#2 location)Real distance (m)Estimation error of RSSI-onlymethod (m)Estimation error of proposed method (m)1Two people walk side by side in the same direction#1 A⟶B⟶C⟶D⟶E#2 F⟶G⟶H⟶I⟶Jd1 (A-F)1.01−0.08−0.16d2 (B-G)0.510.02−0.27d3 (C-H)1.010.06−0.18d4 (D-I)0.510.02−0.09d5 (E-J)0.510.06−0.112Two people walk forward in the same direction, the one in front is fast, while the one behind is slow#1 E⟶D⟶C#2 I⟶H⟶Fd1 (E-I)2.100.05−0.05d2 (D-H)2.280.380.09d3 (C-F)4.211.130.233Two people walk forward in the same direction, and the one behind exceeds the one in front#1 B⟶C⟶D#2 F⟶H⟶Jd1 (B-F)2.280.200.20d2 (C-H)1.010.06−0.31d3 (D-J)2.100.050.034Two people face each other, pass by, continue walking in the opposite direction#1 E⟶D⟶C⟶B⟶A#2 F⟶G⟶H⟶I⟶Jd1 (E-F)8.22−0.11−0.98d2 (D-G)4.11−0.84−0.91d3 (C-H)1.011.470.97d4 (B-I)4.113.452.19d5 (A-J)8.181.822.235Two people meet vertically at an intersection#1 A⟶B⟶C⟶D#2 K⟶L⟶M⟶Id1 (A-K)8.650.05−0.22d2 (B-L)5.770.37−0.34d3 (C-M)2.88−0.03−0.43d4 (D-I)0.510.02−0.126Two people walk to an intersection, one goes on, and the other turns#1 B⟶C⟶D⟶E#2 G⟶H⟶M⟶Ld1 (B-G)0.510.640.76d2 (C-H)1.010.860.84d3 (D-M)2.042.000.98d4 (E-L)4.561.580.907Two people meet at an intersection, and then go forward in the same direction#1 E⟶D⟶C⟶B#2 L⟶M⟶H⟶Gd1 (E-L)4.560.42−0.06d2 (D-M)2.040.11−0.22d3 (C-H)1.01−0.01−0.32d4 (B-G)0.510.02−0.128Two people facing each other at an intersection, one turns after the other, and then walk forward in the same direction#1 E⟶D⟶M⟶L#2 B⟶C⟶I⟶Md1 (E-B)6.12−1.48−1.79d2 (D-C)2.04−0.03−0.40d3 (M-I)1.531.741.00d4 (L-M)2.040.440.509One sits on a chair on the side of the road, and the other walks in front of him#1 I⟶I⟶I⟶I#2 B⟶C⟶D⟶Ed1 (I-B)4.110.530.01d2 (I-C)2.100.05−0.06d3 (I-D)0.510.06−0.18d4 (I-E)2.100.210.08For the RSSI-only method, the RSSI-distance model’s parameterA was set to −65 dBm and n was 3.3, after a typical calibration procedure. For the proposed method, the domain of A was between −80 and −40 dBm, and the domain of n was between 2 and 6. These values and domains of parameters were also used for indoor experiments. To reduce the effects of signal fluctuation, at each sampling point, we measured RSSI for one minute. The median of sampled RSSI was considered as the RSSI value for our experiments. The distance between two smartphones was estimated by using the RSSI-only method and the proposed method, respectively. Then, we measured the real distance to evaluate the performance of these two methods. The real distance, the estimation errors of the RSSI-only method, and the proposed method are shown in Table 1.We can see that the estimation results of the RSSI-only method were still average even when the parameter calibration was used. The mean value was 0.43 m, the root mean square error (RMSE) was 0.96 m, the mean absolute error (MAE) was 0.57 m, and the maximum error was 3.45 m. The proposed method was able to reduce the estimation error. The mean was 0.10 m, the RMSE was 0.76 m, the MAE was 0.51 m, and the maximum error was 2.23 m. The results were compared with the paired-samplest-test using SPSS statistical software version 26.0. The statistical results indicated that there was a significant difference between the two methods, P value <0.00001.


### 3.2. Indoor Experiments with Participants

We placed 16 sampling points (A∼I, O, and M1∼M6) on an indoor meeting room ground, as the following Figure4 shows. The first participant held iPhone XS (transmitter) at point I, and the second participant walked from the start point to the endpoint with Samsung Note10 (receiver), following the designed path (detailed description in Table 2).Figure 4
The experimental setup in the indoor environment. (a) The picture of the meeting room. There was a desk in the center of a meeting room. Some obstacles were on the desk, such as computers, books, and bottles of water. Point O was the start point for all designed paths, which are located at the door and (b) the schematic diagram of the experimental setup for the meeting room.
(a)(b)Table 2
The results of the indoor experiments.
Path indexDesigned scenarioDesigned path and distance symbol (#1 location-#2 location)Real distance (m)Estimation error of typical method (m)Estimation error of proposed method (m)1The second participant entered from the door, and then walked to seat A#1 I⟶I⟶I#2 O⟶M1⟶Ad1 (I-O)5.79−4.49−1.14d2 (I-M1)3.11−1.92−0.64d3 (I-A)0.830.092.152The second participant entered from the door, and then walked to seat B#1 I⟶I⟶I#2 O⟶M2⟶Bd1 (I-O)5.79−4.49−0.73d2 (I-M2)3.86−2.35−0.69d3 (I-B)1.61−0.761.083The second participant entered from the door, and then walked to seat C#1 I⟶I⟶I#2 O⟶M3⟶Cd1 (I-O)5.79−4.49−1.79d2 (I-M3)4.35−3.14−1.33d3 (I-C)2.69−1.480.884The second participant entered from the door, and then walked to seat D#1 I⟶I⟶I#2 O⟶M4⟶Dd1 (I-O)5.79−4.49−1.88d2 (I-M4)4.33−3.14−1.33d3 (I-D)3.39−2.180.225The second participant entered from the door, and then walked to seat E#1 I⟶I⟶I#2 O⟶M5⟶Ed1 (I-O)5.79−4.49−1.74d2 (I-M5)4.09−2.510.16d3 (I-E)2.79−1.750.476The second participant entered from the door, and then walked to seat F#1 I⟶I⟶I#2 O⟶M5⟶Fd1 (I-O)5.79−4.49−1.24d2 (I-M5)4.09−2.51−0.06d3 (I-F)1.80−0.901.237The second participant entered from the door, and then walked to seat G#1 I⟶I⟶I#2 O⟶M5⟶Gd1 (I-O)5.79−4.49−0.39d2 (I-M5)4.09−2.51−0.16d3 (I-G)0.93−0.261.868The second participant entered from the door, and then walked to seat H#1 I⟶I⟶I#2 O⟶M6⟶Hd1 (I-O)5.79−4.49−2.12d2 (I-M6)5.55−4.05−0.83d3 (I-H)5.81−3.880.47Similarly, as in the outdoor experiment, the distance between two smartphones was estimated by using the RSSI-only method and the proposed method, respectively. Then, we measured the real distance to evaluate the performance of these two methods. The real distance, the estimation errors of the RSSI-only method, and the proposed method are listed in Table2.We can see that the estimation results of the RSSI-only method were poor when the parametersA and n used the fixed value. The mean value was −2.88 m, the RMSE was 3.24 m, the MAE was 2.89 m, and the maximum error was 4.49 m. The proposed method was able to effectively reduce the estimation error. The mean was −0.31 m, the RMSE was 1.21 m, the MAE was 1.02 m, and the maximum error was 2.15 m. The paired-samples t-test results indicated that there was a significant difference between the two methods, P value <0.00001.


## 3.1. Outdoor Experiments with Participants

We placed 13 sampling points (A∼M) on outdoor park ground, as the following Figure3 shows. Two participants walked from the start point to the endpoint with smartphones, following the designed path (detailed description in Table 1). The first participant held device #1 (iPhone XS) as a transmitter; the second participant held device #2 (Samsung Note10) as a receiver.Figure 3
The experimental setup in the outdoor environment: (a) the picture of the park ground and (b) the schematic diagram of the experimental setup for the park ground. The side length of the grid is about 0.5 meters, and the 13 sampling points (A∼M) were located at the vertex of the grid.
(a)(b)Table 1
The results of the outdoor experiments.
Path indexDesigned scenarioDesigned path and distance symbol (#1 location-#2 location)Real distance (m)Estimation error of RSSI-onlymethod (m)Estimation error of proposed method (m)1Two people walk side by side in the same direction#1 A⟶B⟶C⟶D⟶E#2 F⟶G⟶H⟶I⟶Jd1 (A-F)1.01−0.08−0.16d2 (B-G)0.510.02−0.27d3 (C-H)1.010.06−0.18d4 (D-I)0.510.02−0.09d5 (E-J)0.510.06−0.112Two people walk forward in the same direction, the one in front is fast, while the one behind is slow#1 E⟶D⟶C#2 I⟶H⟶Fd1 (E-I)2.100.05−0.05d2 (D-H)2.280.380.09d3 (C-F)4.211.130.233Two people walk forward in the same direction, and the one behind exceeds the one in front#1 B⟶C⟶D#2 F⟶H⟶Jd1 (B-F)2.280.200.20d2 (C-H)1.010.06−0.31d3 (D-J)2.100.050.034Two people face each other, pass by, continue walking in the opposite direction#1 E⟶D⟶C⟶B⟶A#2 F⟶G⟶H⟶I⟶Jd1 (E-F)8.22−0.11−0.98d2 (D-G)4.11−0.84−0.91d3 (C-H)1.011.470.97d4 (B-I)4.113.452.19d5 (A-J)8.181.822.235Two people meet vertically at an intersection#1 A⟶B⟶C⟶D#2 K⟶L⟶M⟶Id1 (A-K)8.650.05−0.22d2 (B-L)5.770.37−0.34d3 (C-M)2.88−0.03−0.43d4 (D-I)0.510.02−0.126Two people walk to an intersection, one goes on, and the other turns#1 B⟶C⟶D⟶E#2 G⟶H⟶M⟶Ld1 (B-G)0.510.640.76d2 (C-H)1.010.860.84d3 (D-M)2.042.000.98d4 (E-L)4.561.580.907Two people meet at an intersection, and then go forward in the same direction#1 E⟶D⟶C⟶B#2 L⟶M⟶H⟶Gd1 (E-L)4.560.42−0.06d2 (D-M)2.040.11−0.22d3 (C-H)1.01−0.01−0.32d4 (B-G)0.510.02−0.128Two people facing each other at an intersection, one turns after the other, and then walk forward in the same direction#1 E⟶D⟶M⟶L#2 B⟶C⟶I⟶Md1 (E-B)6.12−1.48−1.79d2 (D-C)2.04−0.03−0.40d3 (M-I)1.531.741.00d4 (L-M)2.040.440.509One sits on a chair on the side of the road, and the other walks in front of him#1 I⟶I⟶I⟶I#2 B⟶C⟶D⟶Ed1 (I-B)4.110.530.01d2 (I-C)2.100.05−0.06d3 (I-D)0.510.06−0.18d4 (I-E)2.100.210.08For the RSSI-only method, the RSSI-distance model’s parameterA was set to −65 dBm and n was 3.3, after a typical calibration procedure. For the proposed method, the domain of A was between −80 and −40 dBm, and the domain of n was between 2 and 6. These values and domains of parameters were also used for indoor experiments. To reduce the effects of signal fluctuation, at each sampling point, we measured RSSI for one minute. The median of sampled RSSI was considered as the RSSI value for our experiments. The distance between two smartphones was estimated by using the RSSI-only method and the proposed method, respectively. Then, we measured the real distance to evaluate the performance of these two methods. The real distance, the estimation errors of the RSSI-only method, and the proposed method are shown in Table 1.We can see that the estimation results of the RSSI-only method were still average even when the parameter calibration was used. The mean value was 0.43 m, the root mean square error (RMSE) was 0.96 m, the mean absolute error (MAE) was 0.57 m, and the maximum error was 3.45 m. The proposed method was able to reduce the estimation error. The mean was 0.10 m, the RMSE was 0.76 m, the MAE was 0.51 m, and the maximum error was 2.23 m. The results were compared with the paired-samplest-test using SPSS statistical software version 26.0. The statistical results indicated that there was a significant difference between the two methods, P value <0.00001.


## 3.2. Indoor Experiments with Participants

We placed 16 sampling points (A∼I, O, and M1∼M6) on an indoor meeting room ground, as the following Figure4 shows. The first participant held iPhone XS (transmitter) at point I, and the second participant walked from the start point to the endpoint with Samsung Note10 (receiver), following the designed path (detailed description in Table 2).Figure 4
The experimental setup in the indoor environment. (a) The picture of the meeting room. There was a desk in the center of a meeting room. Some obstacles were on the desk, such as computers, books, and bottles of water. Point O was the start point for all designed paths, which are located at the door and (b) the schematic diagram of the experimental setup for the meeting room.
(a)(b)Table 2
The results of the indoor experiments.
Path indexDesigned scenarioDesigned path and distance symbol (#1 location-#2 location)Real distance (m)Estimation error of typical method (m)Estimation error of proposed method (m)1The second participant entered from the door, and then walked to seat A#1 I⟶I⟶I#2 O⟶M1⟶Ad1 (I-O)5.79−4.49−1.14d2 (I-M1)3.11−1.92−0.64d3 (I-A)0.830.092.152The second participant entered from the door, and then walked to seat B#1 I⟶I⟶I#2 O⟶M2⟶Bd1 (I-O)5.79−4.49−0.73d2 (I-M2)3.86−2.35−0.69d3 (I-B)1.61−0.761.083The second participant entered from the door, and then walked to seat C#1 I⟶I⟶I#2 O⟶M3⟶Cd1 (I-O)5.79−4.49−1.79d2 (I-M3)4.35−3.14−1.33d3 (I-C)2.69−1.480.884The second participant entered from the door, and then walked to seat D#1 I⟶I⟶I#2 O⟶M4⟶Dd1 (I-O)5.79−4.49−1.88d2 (I-M4)4.33−3.14−1.33d3 (I-D)3.39−2.180.225The second participant entered from the door, and then walked to seat E#1 I⟶I⟶I#2 O⟶M5⟶Ed1 (I-O)5.79−4.49−1.74d2 (I-M5)4.09−2.510.16d3 (I-E)2.79−1.750.476The second participant entered from the door, and then walked to seat F#1 I⟶I⟶I#2 O⟶M5⟶Fd1 (I-O)5.79−4.49−1.24d2 (I-M5)4.09−2.51−0.06d3 (I-F)1.80−0.901.237The second participant entered from the door, and then walked to seat G#1 I⟶I⟶I#2 O⟶M5⟶Gd1 (I-O)5.79−4.49−0.39d2 (I-M5)4.09−2.51−0.16d3 (I-G)0.93−0.261.868The second participant entered from the door, and then walked to seat H#1 I⟶I⟶I#2 O⟶M6⟶Hd1 (I-O)5.79−4.49−2.12d2 (I-M6)5.55−4.05−0.83d3 (I-H)5.81−3.880.47Similarly, as in the outdoor experiment, the distance between two smartphones was estimated by using the RSSI-only method and the proposed method, respectively. Then, we measured the real distance to evaluate the performance of these two methods. The real distance, the estimation errors of the RSSI-only method, and the proposed method are listed in Table2.We can see that the estimation results of the RSSI-only method were poor when the parametersA and n used the fixed value. The mean value was −2.88 m, the RMSE was 3.24 m, the MAE was 2.89 m, and the maximum error was 4.49 m. The proposed method was able to effectively reduce the estimation error. The mean was −0.31 m, the RMSE was 1.21 m, the MAE was 1.02 m, and the maximum error was 2.15 m. The paired-samples t-test results indicated that there was a significant difference between the two methods, P value <0.00001.


## 4. Conclusions

This paper presents a novel optimization method to estimate the distance between smart devices based on RSSI and PDR data by using particle swarm optimization. The PDR may provide a high accuracy of walking distance and direction. Moreover, the parameters of the log-distance path loss model optimized by PSO are used to dynamically fit the complex electromagnetic environment. The performance of the method is tested in outdoor and indoor environments. The results show better accuracy of distance estimation than the RSSI-only method and demonstrate its high feasibility and low complexity. Therefore, the proposed method can be further integrated into the positioning systems for wireless sensor networks and proximity alert apps for COVID-19 contact tracing. We hope that more researchers or research institutions will be interested in further testing the effectiveness of this method.



---

*Source: 7711901-2023-02-09.xml*