# Improving RF Fingerprinting Methods by Means of D2D Communication Protocol
## 3 Material and Methods
### 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_{fingerprint}\)). 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 \(\Delta\)T.  
Figure 4: TOA estimation based on the received signal energy. Figure 5: D2D communication assisted RF fingerprint positioning method. \[\delta_{i}=|D_{TOA_{i}}-D_{fingerprint_{i}}| \tag{4}\]  
Out of the several measurements \(i=1,2,...,n\) device \(A\) can select fingerprint positioning response from the eNB containing minimum error indicator (\(\delta\)) 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 (\(\delta\)) several times according to Equation (4). By accepting minimum \(\delta\) 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 (\(\delta\) calculation) should be kept low. We initialized the \(\delta\) cordiality, \(\tau=3\) in the proposed Algorithm 1. Our algorithm works as follow:  
Figure 6: Flowchart of the proposed method. Collected fingerprints from the targeted area generally stored in the server located at under the control of eNB.