Improving RF Fingerprinting Methods by Means of D 2 D Communication Protocol

Radio Frequency (RF) fingerprinting is widely applied for indoor positioning due to the existing Wi-Fi infrastructure present in most indoor spaces (home, work, leisure, among others) and the widespread usage of smartphones everywhere. It corresponds to a simple idea, the signal signature in a location tends to be stable over the time. Therefore, with the signals received from multiple APs, a unique fingerprint can be created. However, the Wi-Fi signal is affected by many factors which degrade the positioning error range to around a few meters. This paper introduces a collaborative method based on device-to-device (D2D) communication to improve the positioning accuracy using only fingerprinting and the direct communication to nearby devices. The results presented in this paper show that the positioning error can be reduced around 44% by considering D2D communication in the operational stage without adding new infrastructure for fingerprinting or complex resource-consuming filters. Moreover, the presence of very large errors is significantly reduced when the collaborative positioning based on D2D is available.


Introduction and Motivation
With the rapid development of communication technology, more and more electronic equipment is being connected to the internet, which has led to a rise in innovative applications in the smart everything everywhere, such as smart homes, smart cities, and so on.The widespread application of Global Navigation Satellite System (GNSS) technology (such as GPS, Galileo, GLONASS) has solved most of the outdoor positioning problems.However, the localization accuracy sharply declines once the receiver enters a non-line of sight (NLOS) environment.Therefore, indoor positioning systems have been extensively investigated, and intense efforts have been devoted to enhancing the localization performance [1,2].Among the current indoor positioning schemes, for instance, Radio Frequency Identification (RFID), Ultra-WideBand (UWB), Dead reckoning, image-based technology, and ultrasonic which strongly depend on extra devices, the Radio Frequency (RF) fingerprint positioning system has become a very promising and competitive technical solution for its high precision positioning by low-cost [3].
The strategy relies on the idea that every indoor location can be identified by a unique signal feature known as a fingerprint.Typical RF fingerprint (from now on, fingerprint) consists of radio measurements from multiple Access Points (AP), i.e., Received Signal Strengths (RSS) or path-loss measurements to provide a fingerprint of radio conditions at a specific location.The location of a fingerprint can be estimated using the known location of similar fingerprints previously recorded.One of the critical challenges to support such fingerprinting localization is to create and maintain accurate fingerprint databases [4].A site survey is often used to collect fingerprints from a targeted area.However, site surveying is a time-consuming and labor-intensive process.It requires several measurements of each fingerprint to obtain the statistical value of signal strength.Often professional work is needed for efficient site surveying.Moreover, a well-built fingerprint database become outdated as soon as the environment changes.For instance, the redistribution of APs after maintenance might degrade the accuracy of the fingerprint-based positioning system.To solve the problems mentioned above, some new kind of radio map construction techniques have been proposed, including data collection with the help of volunteers, simultaneous localization and mapping, propagation model prediction, RSS prediction based on exist fingerprints, fingerprint construction using passive crowdsourcing data [5], or by means of unsupervised techniques.
The overall accuracy of Wi-Fi based fingerprint positioning is from few meters to around hundred meters [6,7].However, comparing the positioning accuracy of the different methods by using the published results of different studies might not be fair, since researchers are using different evaluation environments, methodologies and test-beds.Although some traditional works report that the accuracy of Wi-Fi based fingerprint positioning is around 2-3 m [8,9], it can reach a higher averaged error when the fingerprint density (including the distance between reference points and/or number of fingerprints per reference point) in the radio map is not dense enough [10] or when external resources (e.g., floor plan, magnetometer, barometer, inertial sensors) are not considered [11][12][13].Thus, the accuracy highly depends on the scenario (building materials, obstacles, presence of people, among others) and on the quality of the generated radio map (deployed anchors/APs, number of independent fingerprints per reference point, distance between reference points, device diversity, among many other features).
Some previous works have identified that the noise present in the radio map and the operational fingerprint is one of the primary sources of the positioning errors [14].The white noise present in the fingerprints in a given location has been usually modeled by a Gaussian distribution centered in the averaged RSS value with a standard deviation around 2-4 dBm depending on the scenario and environment.Although the best distribution tends to be slightly skewed [15], the Gaussian distribution has been well established and widely used in fingerprinting methods.There have been many attempts to minimize this noise, including a more detailed characterization of the RSS values (e.g., by using the Logarithmic Gaussian distance for fingerprint comparison [16]), averaging consecutive fingerprints [17], employing multiple Wi-Fi interfaces to obtain robust averaged fingerprints from independent readings [18], using ensembles as positioning system [19], or applying Gaussian Process Regression Modeling [20], among others.Most of them, requires to increase the computational complexity of the positioning algorithms and, therefore, the energy consumption at the device and/or the remote server side.
In this paper, we propose a collaborative method based on device-to-device (D2D) communication to improve the positioning accuracy.The proposed collaborative method is based on the core idea behind the ensemble, and multiple interfaces approach.The probability of having a large, or very large, positioning errors is generally lower when the prediction is based on multiple devices and/or multiple independent predictions.In a place with multiple mobile units nearby (e.g., smartphones), they can be considered independent interconnected sensors for positioning purposes.Each mobile unit could use fingerprinting to roughly estimate its position and D2D communications with other devices to refine the final position estimation by sharing the roughly estimated positions and calculating the estimated distances between the mobile units.
Green communication, as energy-efficient communication, is of paramount importance nowadays since the environment protection and energy-saving are inevitable trends [21].A comprehensive study of energy-efficient tradeoffs involving green communication and wireless was introduced in [22].Our paper explores the usage of D2D communication to enhance the performance of the indoor positioning systems based on fingerprinting.This approach can be considered simpler and more efficient than those based on multiple-sensor fusion and advanced filtering (Kalman filters and/or Particle filter).Moreover, the positioning accuracy is improved without adding additional infrastructure (namely new Wi-Fi APs or Bluetooth low energy beacons) and, therefore, without increasing the energy consumption of the infrastructure needed for positioning.
The remaining of this paper is organized as follows.Section 2 introduces a review of the works related to fingerprinting, collaborative/cooperative positioning and D2D communications.Section 3 describes the basics of the RF fingerprinting technique, D2D communication aspects, Time of Arrival (TOA) of RF signal and the proposed D2D communication assisted RF fingerprint positioning method.Section 4 is devoted to the experimental setup, performance analysis of the proposed method under different conditions and discussion.Section 5 presents the conclusions and draws the research lines for further work.

Related Work
D2D cooperative localization has received extensive interest from the robotics, optimization, and wireless positioning research communities [23][24][25].The core concept of cooperative localization is the information exchange among users in order to increase their localization accuracy.Cooperative localization was initially considered for addressing the localization problem with limited information about the current position of the mobile unit [26], but this positioning approach can also been extended to those cases where the accuracy is around a few meters, as in Wi-Fi based fingerprinting, in order to obtain more accurate position estimates and reduce positioning ambiguities [27].
Papapostolou et al. [28] showed real-time fingerprint exchange among the users to refine UE's initial location.They achieved up to 43% error reduction for 200 user collaboration, but a collaboration of such a high amount of users might be impractical in some cases or scenarios.For 20 users collaboration, they found 16% mean location error reduction through their cooperative location refinement algorithm.For the experiments, they simulated a radiomap with the IEEE 802.11 channel and the indoor log-distance path loss model in a rectangular area of 80 × 80 m 2 with 5 AP.
Iwase at al. [29] proposed a solution to reduce the accumulative positioning error through cooperative positioning among multiple pedestrians using smartphone and pedestrian dead reckoning.Their proposed method introduces linkage structures to simplify the trajectories of pedestrians.These structures work as a constraint to reduce the number of variables to be estimated.Moreover, they introduced the concept of communications points, where the Wi-Fi ranging error is expected to be low.Therefore, the user's tracks can be correct using this information.They found the positioning accuracy improved as the number of participants in the cooperative positioning operation increased.Two experiments were conduced: the first one was indoors and using real data from smartphones and up to 8 people, the second one corresponded to a large-scale simulation.
Vaghefi et al. [30] used round-trip time measurement for cooperative localization technique in LTE network, according to the performed simulations the higher number of collaborator, the higher positioning accuracy, but increasing number of candidates increases the complexity exponentially.They concluded ten candidates provide a balance between complexity and the performance under a LTE communication and positioning scenario.
Bargshady et al. [31] used particle filter to integrate RSS and TOA of RF signal for improving cooperative localization precise in indoor environment.But they used only three moving objects in their simulation along with eight fixed anchors.They concluded improvised positioning trend stemming from hybrid cooperative mode.
Karlsson et al. [32] showed smartphone based Wi-Fi signal measurements exchange via Bluetooth connection between the users.They used Bluetooth signal strength difference between users to calculate relative distance, which is used to evaluate the probability distribution functions of their states.Two simulation scenarios were carried out with 10 and 100 users.Their proposed method increases the average positioning performance by 28% and 22% respectively for the two cases.
Chen et al. [33] proposed a cooperative localization method to combine the fingerprint-based algorithm and the physical constraint of pairwise physical distances to refine the localization estimates for multiple users simultaneously.They found the number of peers and peers selection have a substantial impact on accuracy performance.The experimental area was a corridor surrounding a rectangular area.They selected 80 reference points in the corridor, where the distances between two adjacent points were around 1.5-3 m.A total of 150 combination of several predefined positions were used to simulate the multiple users condition.The technique to measure the relative distance between two units was based on acoustic ranging, if they were close to each other (less than 3 m).
Cui et al. [34] studied a real-time positioning based on the D2D real-time communication, which will be reliable in future 5G cellular networks.The ranging and positioning performance were evaluated with four impulse radio waveforms.Their proposed method provided sufficient accuracy for the future real-time positioning applications.
Raveneau et al. [35] used D2D collaboration to eliminate redundant fingerprints from a crowdsourced database.According to them, intercommunication among the devices would help to know whether a fingerprint need to be recorded or the database already handled a fingerprint from that location by other devices.
Yin et al. [36] focused on a GNSS/5G integrated positioning methodology with the D2D range and angle measurements.They analyzed the characteristics of a GNSS/5G integrated system and proposed a high-efficiency D2D positioning measure protocol, named crossover multiple-way ranging, which consumes fewer communication resources.Their simulation results show that their proposed integrated positioning methodology outperforms the non-integrated one especially with more mobile terminals and accurate D2D measurements.The evaluation test-bed was in the outdoor area.The real-time kinematic positioning technique was applied to collect GNSS data with a centimeter level accuracy.They used simulated 5G D2D data.
Most of the previous studies were conducted on simulation data or in a laboratory environment.Compare to those our study reflects almost all the practical aspects of the real-world scenario.According to the authors best knowledge, this is a novel work where the D2D communication protocol is used to improve the RF fingerprint positioning method in such a sizable three-dimensional environment.

Material and Methods
This section includes the proposed method and introduces theoretical background concerning the proposal.Section 3.1 shows a brief description of the RF fingerprint positioning method.The D2D communication protocol in Section 3.2 explains the feasibility of using the protocol in the proposed method.Clock synchronization is crucial in TOA-based distance calculation, but it is impractical to have all the devices' synchronized clock in a wireless network.Section 3.3 shows the technique to calculate the TOA-based distance despite asynchronous clocks.The proposed method is explained in Section 3.4.

RF Fingerprint Positioning
RF fingerprint positioning refers to database matching or correlation method where UE's position can be estimated by comparing UE's RF fingerprint with a database previously recorded.Each reference (or training) fingerprint in the database is associated to a known location, which commonly corresponds to a local coordinate (X, Y), or a global coordinate (latitude, longitude), or a label (e.g., Main Corridor).Generally, the fingerprint database is built by site surveying, crowdsourcing or by other means.Different distance measurement metrics, e.g., Jaccard, Manhattan, Minkowski, etc., can be used to determine the signal distance between training and testing fingerprint [37,38].Figure 1 depicts the general concept of RF fingerprint positioning method.
We have used Euclidean distance throughout the research since it is the most commonly used distance measure used in the current literature.If P and Q are two RSS vectors of test and training fingerprint respectively, the signal distance between them can be calculated as follows: Here n is the length of the RSS vectors.Generally, the signal distance between the test fingerprint and all the training fingerprints are calculated.The test fingerprint's coordinate is estimated by computing the coordinates of the k reference/training fingerprints reporting the shortest signal distance.In the most simple case, the coordinate corresponding to the reference fingerprint reporting the lowest signal distance.

D2D Communication Aspects
D2D communication has been specified in 3GPP LTE Release 12, that enables direct communication between nearby devices to handle particular applications such as proximity services (ProSe), content sharing, multi-party gaming, etc [39].It is an exciting and innovative feature of next-generation cellular networks.By exploiting D2D communication, it is possible to enhance throughput, spectrum utilization and energy efficiency of the cellular network.To address future network challenges of dynamic environment adaptability, and productive use of available resources in 5G, D2D communication is considered as a potential tool.Concerning spectrum usage, D2D communication is primarily classified into two types, e.g., inband and outband.In inband D2D communication, cellular communication and D2D communication use the same spectrum licensed to the network operator, whereas outband D2D communication uses unlicensed spectrum (e.g., the free 2.4 GHz ISM band) where cellular communication does not occur [39].Use of outband eliminates the interference between D2D communication and network users.In terms of control, outband technology is divided into two categories, controlled and autonomous.In control mode, the radio interface is controlled by the cellular network while in autonomous mode, control of D2D communication belongs to the end users.The basic architecture of the 3GPP D2D communication architecture is shown in Figure 2. A device that wants to establish D2D communication needs to contact the ProSe function through PC3 logical interface to obtain permission.After the authorization completed, the device can start the discovery process.From a user's perspective, there are two types of peer discovery techniques, Evolved Packet Core (EPC)-level discovery and direct discovery.At direct discovery, a device would search other devices with ProSe capability in their proximity using the PC5 interface.When two (or more) ProSe-enabled devices have discovered each other, they can start direct communication over the direct link between them.From a network perspective, peer discovery can be controlled hardly or softly by the base station [40].The interface between the EPC and the ProSe function is called PC4.Generally, a D2D link connects a device to another following in a single-hop communication.A multi-hop network composed of D2D connections is also possible.In a multihop D2D network, the central devices act as relays between two devices.In 5G, cell size will be smaller, and the density of the devices will be higher, 150 devices per cell are assumed in 3GPP for evaluating D2D discovery [41].As a result, less inter-device distance is expected.Small inter-device distance increases the probability of Line of Sight (LOS) communication among devices that results in a better TOA-based ranging accuracy [42].Without any relay, the effective D2D communication range is expected to be around 30 m [43].
Due to the distributed structure of control and mobile devices being computationally poor to apply complex encryption mechanisms and other security technologies, D2D communication can be vulnerable to malicious attacks.Ramirez [44] mentioned three major security and privacy problems, these are ubiquitous data collection, unexpected uses of data, and heightened security risks.Many researchers [45,46] have studied RF fingerprint based wireless security system.Zhang et al. [47] proposed a D2D communication security authentication process based on RF fingerprint identification.The advantage of using fingerprint for security purpose is that fingerprint computes the inherent hardware differences of the transmitter for identification, so this method cannot be completely copied.Their simulation results show that when Signal to Noise Ratio (SNR) is higher than 8 dB, the device recognition rate is 100%.RF fingerprint can be used for positioning and security purpose simultaneously.

TOA Based Distance Determination
Generally, the time required for a signal to travel from one node to another is used to estimate the distance between the nodes.According to our proposed method, a device would request another device to exchange their position information, TOA of the same communication can be utilized to measure the distance between them.A brief process of two-way time of arrival is illustrated in Figure 3. Two-way time of arrival is a ranging protocol [48], based on the reception of timestamp packets distance between two devices can be estimated in the absence of time synchronization.Assuming the propagation delays of the request and response frames are the same, the TOA and physical distance between the two devices can be calculated as follows: Here c is the speed of light.Akiyama et al. [49] proposed a method using a smartphone to measure the TOA, employ modulated light with a signal for the time-of-flight short measurement, they achieved positioning error of less than 10 mm.However, in an indoor environment, most connections between devices are NLOS as the LOS paths are blocked by wall, ceiling, or furniture.The LOS path is often mixed with multiple time-delayed NLOS paths.NLOS can degrade the D2D ranging since they have significant positive biases which make the measured pair-wise distances much larger than their actual values [50].Some studies have focused on distinguishing NLOS connections from LOS connections.An identification technique based on maximum likelihood estimation is described in [51].By exploring physical layer information 95% LOS was identified in [52].Cui et al. [34] showed how to detected actual TOA from an NLOS / multipath channel from received signal energy.According to them in a multipath channel with a low signal to noise ratio, some low energy level value may appear before the maximum energy value.By setting a threshold value, actual TOA can be determined as shown in Figure 4.

Description of the Proposed Method: D2D Communication Assisted RF Fingerprint Positioning
A D2D communication underlying cellular network is considered as a key technique to alleviate the exponential growth of user demands for high data rates, low power consumption, and spectrum efficiency.In D2D communication, two devices under the proximity to each other can communicate directly without passing through the Evolved Node B (eNB) (described in Section 3.2).Through direct communication, a device would be able to exchange information with other devices, e.g., location, quality of service, observe radio condition, etc. Information obtained from D2D communication can be used to verify the location of the User Equipment (UE) to mitigate the erroneous position information received from the fingerprinting method.Figure 5 shows the D2D communication assisted fingerprint positioning method that we propose in this work.Let's assume that, device A needs to know its position.The eNB can provide device A's position based on device A's fingerprint.Due to numerous factors that affect the strength of a radio signal, e.g., multi-path propagation, obstruction, and temperature, the provided position information can be inaccurate.Device A can ask another device B about B's position, B can respond to A with B's position information obtained from eNB.From their communication, device A would be able to calculate the physical distance between them by two procedures.Firstly, by signal's time of arrival method (D TOA ) secondly, from their coordinate, that they received from eNB (D f ingerprint ).If these two values are the same or very close, then it can be supposed that the obtained position information from the fingerprinting method is correct as the outcome of the fingerprint positioning is verified by another method.This process can be repeated several times after a short time interval ∆T.
Out of the several measurements i = 1, 2, ..., n device A can select fingerprint positioning response from the eNB containing minimum error indicator (δ) to increase the positioning confidence.If device A is unable to make a conclusive decision from the process, it should be satisfied with the position information received from eNB. Figure 6 shows the flowchart of the proposed method.
In Figure 6, a UE with unknown position requests eNB for its location information, at the same time it requests another device to send that device's position.From these two devices multiple inter-communication, UE can calculate error indicator (δ) several times according to Equation (4).By accepting minimum δ containing response from eNB, UE can fine-tune its location information.The main idea of our proposed method is to verify the fingerprint positioning response by TOA-based distance in order to rectify the erroneous response of eNB.To increase the confidence level of positioning the verification process (or communication with other devices) is repeated several times within a short period, this process creates the advantage to select the best positioning response.Generally, the motion of the human in an indoor environment is languid, so the change of position in a few milliseconds does not put an observable effect.The number cooperation with other devices depends on the user, each measurement increases the positioning calculation complexity (see Section 4.6); therefore the amount of cooperation (δ calculation) should be kept low.We initialized the δ cordiality, τ = 3 in the proposed Algorithm 1.Our algorithm works as follow:  Step 1: UE with unknown location information sends a request to the eNB to know it's location.

3:
Step 2: The eNB responses UE's request and send UE's location according to the fingerprinting method (see Section 3.1).

4:
Step 3: UE sends a request to another nearby device to know other device's location.

5:
Step 4: Other device responses UE's request and send it's location information to the UE (Other devices obtain their location from the eNB according to step 1-2).

6:
Step 5: UE calculates the physical distance between UE and another device by two different procedures, and calculates δ.
Step 5.1: Calculate distance by coordinate information obtained from the system through RF fingerprinting.
Step 5.2: Calculate distance from TOA measurement (here TOA has been emulated by true physical distance).
Step 5.3: Calculate δ. 7: end while 8: Fingerprint positioning response from the eNB containing the minimum δ value is selected as UE's position.
Collected fingerprints from the targeted area generally stored in the server located at under the control of eNB.For D2D direct communication, responsibility data management and security belong to the participated device, and this topic is under intensive research [53,54].According to our proposed method, only position information of other device is needed to be passed through the D2D communication link.Such a small amount of information can easily be fit within 1 kilo bits packet including address, header, encryption etc.To prevent the exploitation of the data devices should communicate with other secured devices, with whom confidentiality, integrity, and privacy are maintained under a common agreement.

Experiment and Results
This section introduces the evaluation setup, including the database description and shows the main results derived from the evaluation of the proposed method and the effects of the D2D distance, motion direction, amount of D2D measurements, among others.

Database Description
In this research article, we have used the Wi-Fi crowdsourced fingerprint database created by a research group from Tampere University of Technology (TUT) [13].The database and the benchmarking software are distributed under the open-source MIT license and can be found on the EU Zenodo repository [55].The measurements were taken in a five-floor building in Tampere (23.85580 • N, 61.44585 • E), Finland.The five-floor building has a footprint of about 22,570 m 2 (208 m × 108 m).Total 4648 fingerprints were collected which were then split uniformly randomly 15% for the training and 85% for the test purpose.Volunteer users installed the android application on their devices and reported the correct location (based on a manual input on the map) to the server.The server stored the location reported by the user, the time stamp, the device model, the MAC addresses of the heard access points and the RSS from each AP.A local coordinate system e.g., (x, y, z) = (123.45,14.71, 0) was used instead of the global WGS84 commonly used in other applications.During the measurements, a total of 991 AP were heard, the exact position of the APs was not known.Figure 7 shows the fingerprint database.According to the benchmark result provided by the TUT research group, the mean 2D and 3D positioning errors of this database were in the order of 8-10 m in the best cases.They made it deliberately challenging by keeping the training data very low, only 15% (i.e., 0.03 fingerprints/m 2 ).The fingerprints locations were recorded manually and accurately, so the physical distance between fingerprints (in other senses, devices) according to the coordinate value are true.To the best of the authors' knowledge, this database or any other standard fingerprint database available on the internet does not contain TOA information among the fingerprints.We have emulated true physical distance among the fingerprints as TOA-based distance.

D2D Communication Assisted RF Fingerprint Positioning
From the test database, 1860 test fingerprints were chosen to evaluate the proposed method, since all of them are not suitable for the experiment carried out in this work.Training database remained unaltered, containing 697 fingerprints as in Zenodo repository.From several communications with a secondary device (see Section 3.4) minimum δ containing coordinate were selected as the test fingerprint's position according to the proposed method.On the other hand, the traditional k-NN method has been applied to compute the same test fingerprint's coordinate to compare the effectiveness of the proposed method.If the UE (the primary device that needs to know the position) is stationary, then it can not get the benefit from the proposed method to select the best result out of several options since it would experience the same positioning information all the time.UE needs to change its positioning, but the other secondary devices can either be in motion or stationary.Figure 8 shows the comparison between our proposed method and the traditional fingerprint positioning method.This comparison is based on the empirical Cumulative Distribution Function (CDF) of the 3D positioning error highlighting the median error (50%) and the spherical error (95%) as suggested by the ISO18305:2018 standard for real-time locating systems [56], and the third quartile (75%) as suggested by the EvAAL framework [57].For this experiment, we considered two scenarios for the behavior of the secondary devices: Motion and Stationary.Physical distance among the devices was chosen randomly.CDF of 3D positioning error in Figure 8 shows that compared to the traditional positioning method, our proposed method provides a significant amount of better accuracy.The mean 3D positioning accuracy through traditional method is 8.68 m, that is similar to the results provided in [13].Our proposed method managed to rectify the error and significantly reduce the mean 3D error.The results indicate that the proposed method provided better results if the other secondary devices are stationary, with a mean 3D error of 5.34 m.Nonetheless, our proposed method also provides good results, with a 5.59 m mean positioning accuracy, when the primary device exchanges information with devices which are in motion.It is worth to highlight that the proposed method prevents very large positioning errors.With the traditional method, almost 10% of operational samples have a positioning error higher than 20 m, whereas the presence of such kind of errors is marginal when D2D communications are considered.

D2D Distance Effect
To observe the effect of physical distance among the devices, in the proposed method three distance ranges were set-up: (1) 1 to 10 m; (2) 11 to 20 m, and (3) 21 to 30 m.In both scenarios, motion and stationary, the physical distance between UE and other devices did not put a significant impact.Figure 9 shows that, regardless of the distance range (denoted by d) among the devices, the positioning accuracy remains almost the same.Based on the outcomes of Figures 8 and 9, it can be stated that the accuracy level improves significantly if the RF fingerprint positioning information is verified with a true value.Moreover, some features of the reference device (distance, motion/stationary, etc.) do not affect the D2D collaborative positioning.

Effect of Motion Direction
In an open space, it is highly likely that during the movement a user changes her/his direction.Since the motion did not affect the positioning accuracy in the previous experiment, it indicates that the moving direction might not have a significant effect on the proposed method.Effect of the change of direction has been investigated in this experiment.Since different test fingerprint has different position and orientation, it is impractical to maintain common axis reference for angle calculation.However, since the database contains local coordinate, we used the origin point (XY = [0, 0]), UE coordinate, and other devices coordinate to make a triangle and calculate the angle of motion.In Figure 10 it can be seen that 351 test fingerprint (FP) took assistance from such devices which changed their course between 0 • to 30 • angular direction resulted in a mean 6.12 m error.
307 test fingerprints communicated with other devices which were moving from 30 • to 60 • angle caused 5.59 m mean error.403 test fingerprints communicated with other devices which were moving from 60 • to 90 • angle caused 5.42 m mean error.276 test fingerprints communicated with other devices which were moving from 90 • to 120 • angle caused 5.28 m mean error.223 test fingerprints communicated with other devices which were moving from 120 • to 150 • angle caused 5.84 m mean error.290 test fingerprints communicated with other devices which were moving from 150 • to 180 • angle caused 5.37 m mean error.From all the segments in Figure 10 it can be seen that the mean positioning error is very close to the overall mean positioning error of the system, no particular characteristic is observable due to the change of movement direction.However, the highest difference in mean error is between the devices moving from 0 • to 30 • (6.12 m) and the devices moving from 90 • to 120 • (5.28 m).

Amount of Measurements
D2D communication assisted positioning performances mentioned above are based on three measurements, that means a device communicated with another device for three times.With the purpose to check if the accuracy results are affected by the number of measurements considered, a test considering up to seven measurements was carried out.Results are shown in Figure 11.
From Figure 11 it can be seen that four and five times measurement provides better accuracy than that of baseline three times measurement.Six and seven times measurement between UE and other devices provide even better accuracy.However, the computational load increases as the number of considered references are included.There should be a trade-off between positioning accuracy and the number of measurement to keep the calculation complexity and energy consumption as low as possible.

Processing Time vs. Performance
Compare to the traditional fingerprint positioning, D2D collaborative positioning takes much longer processing time.The additional time is spent to communicate with other devices, acquiring positioning information for own and other devices, and processing delay.The more cooperation, the more processing time.Our laboratory computer was running on windows 8.1 operating system with Intel core i-5 processor having 2.30 GHz clock speed and 8 GB RAM.Positioning program was coded in Matlab 8.4 software.Figure 12 shows the relation between performance and processing time.According to the traditional fingerprint method the recorded mean processing time was 103 millisecond (ms) per test fingerprint, that resulted in 8.68 m mean positioning error.On the contrary, when the proposed method was applied, positioning error decreased but processing time raised over 500 ms per test fingerprint.From Figure 12 it can be seen that processing time raised around 520 ms but positioning error decreases to 559 cm (or 5.59 m) when UE starts to communicate with other devices at least 3 times.Ascending trend of processing time and descending trend of positioning error can be seen in Figure 12.A decision regarding optimal resource management can be made based on this type of plotting.

Accuracy Limit
All the experiments in this paper were carried out over a public dataset which was collected by means of crowdsourcing.In contrast to professional deployments with a dense radio map (small grid and many training fingerprints), the density of training fingerprints in the selected database was not so high only 0.03 fingerprints/m 2 .This low density might have contributed to degrading the positioning accuracy.An additional experiment was carried out to compare the accuracy of the proposed D2D method (best case) with respect to the maximum possible accuracy for the database.This maximum accuracy is computed as the physical distance of the test fingerprint location with respect the nearest training fingerprint's location in the real-world (not RSS-space). Figure 13 shows the comparison between the maximum accuracy limit of the database and the best-achieved accuracy through the proposed method.
The best mean 3D positioning accuracy through the proposed method is 4.83 m while the maximum mean accuracy limit for the database is 1.34 m.Apart from the unavoidable error, our proposed method offers mean 3.50 m level accuracy for such a vast and complex indoor environment which has strong merit.

Error Indicator
We further investigated the relationship between positioning error and error indicator δ (see Equation ( 4)).The results of this analysis are shown in Table 1.No measurement was found containing a value of δ equal to 0. From Table 1 it can be seen that when the value of δ increases, positioning error also increases.Therefore, δ can be used as an indicator, when UE experience high δ value it should keep communicating with other devices in order to have better positioning result.

Successful Floor Detection
Finally, we checked the successful floor detection rate.In Figure 14 it can be seen compare to the traditional method, our proposed method shows slightly better correct floor detection rate with 94.46%.Although the absolute increase of performance (as successful floor detection rate) has been just 1.45% with respect to the traditional method, the relative floor detection error has been reduced in a 20% (from 6.99% to 5.45%).While all the benchmark results for correct floor detection rate were in between 85% to 92% in the previous study [13].

Conclusions
This paper mainly focused on the advantage of using D2D communication features in the RF fingerprint positioning method.Experiments were done on a dedicated RF fingerprint database where the measurement was very accurate and reflected all most all the real world aspects.Since the database does not contain TOA information we had to emulate that by true physical distance, and that has been supported by the proper literature.The main contribution of this paper is to invent a procedure to verify the RF fingerprint positioning information with true value in order to eliminate noisy answer from the system.Through the proposed method about 44% better mean 3D positioning accuracy was achieved.Positioning accuracy for the different D2D communication scenario was evaluated.It has been observed that motion and distance among the devices do not hamper the proposed idea.Moreover, according to the presented results, it seems that the motion direction has not a huge impact on the system accuracy.However, by increasing the amount of measurement better accuracy can be achieved, i.e., better results can be obtained by using more measurements between the two devices.Although increasing the number of measurements from three to seven reduces the positioning error in around a 13% (from 5.59 m to 4.83 m), this increase is at the expense of increasing the computational burden around a 40% (from 520 ms to 720 ms).If the accuracy and the computational burden are balanced, the optimal number of measurements is between 3 and 4.
Apart from TOA, the true physical distance among the devices can be measured by sound, infrared light, camera flash, the signal strength of D2D communication, etc.In the future, we shall try to transfer the calculation burden to the eNB side.Instead of D2D distance, we will explore the UE-eNB true distance, which can also be used to verify the RF fingerprint positioning output.Finally, as further work, we will consider to include power consumption restrictions in the indoor positioning systems due to the rising interest in developing more energy-efficient protocols and algorithms to reduce their economic and environmental impact and promote Green Communications.

Figure 4 .
Figure 4. TOA estimation based on the received signal energy.

Figure 7 .
Figure 7. Visual representation of the reference fingerprints location.Fingerprints are colored according to the elevation (floor level).

Figure 8 .
Figure 8. CDF of the positioning errors provided by the proposed method based on D2D communications (motion and stationary scenario for the secondary devices) and traditional method based on k-NN.

D2D: 1 ≥D2D: 1 ≥Figure 9 .
Figure 9.Effect of physical distance among the devices in the proposed method shown as the CDF of the positioning errors.

Figure 10 .
Figure 10.Positioning accuracy based on other devices' moving direction.

Figure 11 .
Figure 11.Effect of the increase on the amount of measurements in the proposed method shown as the CDF of the positioning errors.

Figure 12 .
Figure 12.Processing time vs. performance (Instead of meter, positioning error has been expressed in centimeter unit to make the figure more sensible where two scale -time and performance-come closer to each other.).

Figure 13 .
Figure 13.The accuracy limit in the proposed method shown as the CDF of the positioning errors.

Figure 14 .
Figure 14.Floor detection rate (%) of the traditional fingerprinting and D2D-based proposed methods.

Table 1 .
Relationship between error indicator and positioning error.