2327-4662 (c) 2019 IEEE. Personal use is permitted, but republication/redistribution requires IEEE permission. See http://www.ieee.org/publications_standards/publications/rights/index.html for more information. This article has been accepted for publication in a future issue of this journal, but has not been fully edited. Content may change prior to final publication. Citation information: DOI 10.1109/JIOT.2019.2950174, IEEE Internet of Things Journal IEEE INTERNET OF THINGS JOURNAL 1 TagSort: Accurate Relative Localization Exploring RFID Phase Spectrum Matching for Internet of Things Jinjiang Lai, Chengwen Luo*, Member, IEEE, Jiawei Wu, Jianqiang Li, Jia Wang, Jie Chen, Gang Feng, Houbing Song, Senior Member, IEEE Abstract—The RFID technologies, which have been widely adopted in different Internet of Things (IoT) applications, are the fundamental building block for achieving smart factories, smart logistics, smart stores, etc. Besides knowing the ID of tags, the relative location information of different tags is of great im- portance since it contains the spatial relationship among different tags, which is essential to many object localization applications beyond the capacity of absolute localization approaches. In this paper, we propose TagSort, a RFID based sorting system which exploits the physical layer information, i.e., the phase of RFID wireless signals to achieve the relative localization of different tags. Several novel filtering and peak detection algorithms are proposed to achieve accurate and robust detection of the order of tags. Extensive evaluation shows promising results (over 95% accuracy) and make TagSort a promising system for future RFID sorting systems, thus enabling a variety of IoT applications and services. Index Terms—Indoor localization; RFID, Phase spectrum, Relative localization I. I NTRODUCTION Over the past decade, Radio Frequency Identification (RFID) technology has been widely adopted in a variety of applications such as asset management, access control, object localization and tracking, etc [1], [2]. Among these applications, RFID based positioning systems have attracted extensive attention mainly due to the reason that it can be easily deployed at large-scale with low cost. It is envisioned that the RFID based positioning systems will continue to gain popularities with the rise of Internet of Things (IoT) [3], [4], [5]. There are a large body of work on RFID-based indoor localization system in the literature [6], [7], [8], [9], [3], [10], [11]. Based on the technologies they used, existing work can be classified into three groups: Received Signal Strength (RSS) based methods [10], [11], arrival of angel (AOA) based methods [12], [13] and phase based method [8]. Despite of these efforts, prior work mainly focus on absolute localization and there is limited work investigating RFID-based relative localization. However, many object localization applications need the relative locations of a set of objects instead of Jinjiang Lai, Chengwen Luo, Jiawei Wu, Jianqiang Li, Gang Feng, Jia Wang, Jie Chen are with the College of Computer Science and Software Engineering, Shenzhen University, China. Houbing Song is with the Department of Electrical, Computer, Software, and Systems Engineering, Embry-Riddle Aeronautical University. *Corresponding author: Chengwen Luo {chengwen@szu.edu.cn} their absolute locations [14]. For example, when looking for misplaced books in a library, we need to get the current relative order of books on the bookshelf instead of knowing their absolute coordinates. Absolute localization approaches cannot be directly applied in relative localization system for two reasons. First, most absolute object schemes [6], [7], [8], [9], [3] use RF signal information for localization, such as signal propagation speed, signal intensity and signal propagation direction. Due to the complex indoor environment and significant multi-path effect, the localization accuracy is hard to remain high. For example, the major advantage of LANDMARC [10] is that it improves the overall accuracy of locating objects by utilizing the concept of reference tags. However, the error due to the dynamics of the environment can hardly be alleviated. Second, in order to achieve high localization accuracy, one has to use high cost hardware and software support (e.g.,USRP), or depend on the scene (e.g., location fingerprint based techniques [15]). Recently, Shangguan et al. [14] proposed the first RFID- based relative localization system by utilizing phase profile. The idea is simple but effective: when we move the RFID reader along one direction, the distance between the reader and tag will first decrease and then increase, and achieve the minimum when the reader is perpendicular above the tag, so is the phase profile. Based on this observation, they de- sign a RFID-based relative localization using spatial-temporal phase profiling. This method, though efficient, still encounters a number of problems in real environments. For example, the feature zone detection method in [14] is susceptible to self-interference and environmental noise. To encounter this problem, in this paper we propose TagSort, a high-accuracy relative localization system exploiting RFID phase spectrum. Different from the current state-of-the-art, TagSort proposes a series of novel signal processing methods to improve the robustness of feature zone detection, so as to improve the overall robustness of the RFID-based relative localization sys- tem. Besides, TagSort further incorporates a dynamic template selection algorithm to address the distance variations during the tag sorting. We implement and evaluate the system, which shows promising results. Our contributions are summarized as follows: • We propose a hybrid feature zone detection and peak detection algorithm to robustly detect the feature zones and peaks which appear in the RF phase profile. Different