基于Wi-Fi指纹匹配的室内定位方法(附代码)

文章介绍了Wi-Fi指纹匹配作为主流室内定位技术的工作原理,包括Wi-Fi信号的RSSI数据采集和处理,以及离线信号采集和在线位置定位两个阶段。通过建立Wi-Fi信号特征与位置的映射关系,实现室内定位。提到了确定性和概率性两种在线匹配算法,并列出了如KNN、SVM等方法。评估定位性能的指标包括定位误差、平均定位误差和CDF。文章还提供了相关实验代码供读者实践。
摘要由CSDN通过智能技术生成

引言

室内定位技术已广泛应用于商场导航智能家居人员搜救等领域,具有不可估量的商业价值和非常广阔的应用前景。全球导航卫星系统(GNSS)可以为室外定位提供良好的定位精度,然而在室内环境下卫星信号的衰减使得室内的位置信息获取困难,从而难以满足室内定位的需求。因此,如何实现室内环境下满足需求的定位服务成为了国内外研究的热点。在本文中,将介绍主流的室内定位技术——Wi-Fi指纹匹配定位

Wi-Fi技术概述

Wi Fi即无线保真技术(Wireless Fidelity),其遵循IEEE 802.11系列通信协议。Wi-Fi技术通过提供无线局域网接口解决了移动终端和有线网络的连接,可以极大方便人们的生活。Wi-Fi技术具有覆盖范围广,实现成本低,信息传输快等优点,通过搜索室内环
境中的无线网络节点来进行人员定位、目标监控及跟踪等功能。

在无线局域网络中,部署好的AP能够以固定发射功率发送信号,接收设备可以通过周期性扫描得到射频信号携带的数据信息,数据信息主要包括AP节点的名字,硬件的MAC地址以及信号对应的RSSI(接收信号强度指标,Received Signal Strength Indicator)数据,可以用扫描采集到的这些信息来进行室内定位。

Wi-Fi指纹定位原理

Wi-Fi指纹定位是通过建立空间中Wi-Fi信号的特征与物理位置的映射关系来实现定位。在室内环境下,Wi-Fi信号传播过程经过直射、反射以及折射后形成与环境有关的信号特征,在室内不同的位置信号强度各不相同,如下图所示。每个位置都能接收到来自不同AP的信号RSSI。
在这里插入图片描述

因此,根据Wi-Fi信号强度数值不同的分布情况,通过采集各个位置坐标的信号,经过相应处理并进行特征提取,然后对特征数据进行训练并与其位置坐标之间形成映射以此来构建指纹数据库,在进行位置定位时只需要将实时采集数据和指纹数据库中的指纹特征进行匹配,即可估计出待测点的位置。如下图所示,Wi-Fi指纹定位算法流程包括离线信号采集和在线位置定位两个阶段。
指纹定位原理
(1)离线(Offline)信号采集阶段:首先在定位区域内选取一些固定位置参考点,然后采集固定位置参考点能采集到AP的MAC地址对应的RSSI数据,预处理RSSI数据后,最后利用固定位置参考点的坐标,采集到AP的BSSID以及对应的RSSI数据构建指纹数据库。
(2)在线(Online)位置定位阶段:在相同的室内环境中采集待测点的RSSI数据,形成在线位置指纹,并将该指纹和指纹数据库中的指纹进行对比,通过选择的匹配算法从而得到待测点的位置坐标。

Wi-Fi定位方法

传统的在线匹配算法包括确定性的方法(deterministic)概率性的方法(probabilistic)

(1)确定性的算法使用相似性指标来区分在线信号测量和指纹数据,然后将目标定位在信号空间中最接近的指纹位,。欧氏距离、余弦相似度等指标已被用于信号比较。常用的方法包括:KNN(K近邻)、WKNN(加权K近邻)、SVM(支持向量机)、RF(随机森林)等。
(2)概率算法是基于目标信号测量和存储的指纹之间的统计推理,使用一个训练集,这些算法以最大的可能性找到目标的位置。常用的方法包括:贝叶斯网络、期望最大化、高斯过程等。

(上述方法较多,本文就不在赘述)

定位性能评价指标

评价室内定位算法性能时,常用的指标包括包括定位误差、平均定位误差、累计分布函数(Cumulative Distribution Function CDF)等等。
(1)定位误差
定位误差表示的是待测点实际位置和定位算法预测位置之间的欧式距离,在指纹位置定位中欧式距离公式如下:
在这里插入图片描述
(2)平均定位误差
平均定位误差是对𝑛次定位误差结果求取算术平均值,能够表征定位过程中的准确性。平均定位误差的计算公式如下:
在这里插入图片描述
(3)累积分布函数(CDF)
累积分布函数能够刻画出定位误差分布在某一个范围内的概率大小,公式如下:
在这里插入图片描述
累计分布函数曲线中横坐标代表定位误差,纵坐标表示当前定位误差下定位的准确率。由定义可知当曲线收敛的速度越快,定位算法的性能就越好,同时定位误差也相对较小。

实验代码

附上基于Wi-Fi指纹匹配的室内定位代码,里面已经包含了数据和相关算法,朋友们可以自行尝试哦~
Wi-Fi定位代码

参考文献
[1] S. He and S. . -H. G. Chan, “Wi-Fi Fingerprint-Based Indoor Positioning: Recent Advances and Comparisons,” in IEEE Communications Surveys & Tutorials, vol. 18, no. 1, pp. 466-490, Firstquarter 2016, doi: 10.1109/COMST.2015.2464084.

  • 5
    点赞
  • 73
    收藏
    觉得还不错? 一键收藏
  • 8
    评论
室内定位算法,有助于研究者认清研究方向,给定位算法一个准确的描述,是很好的参考教材。the possibility for the user to be notified by visible and Waveformof Distance audible warnings using buzzer and led ar to Very close to al 1903 Tme「 samples Fig 4 Distance measurement using the RSSi signal The system is used to determine the distance between Fig. 2. Tag4M Data Acquisition System tags and 2, 3, 4 or more APs. The tag scans after the aps ⅣV. EXPERIMENTS and sends the rssi values for each ap to the ap which is associated The system presented above can be used for objects or In order to read the corresponding rSsi values of all people localization in an indoor enviro found access points, a""operation is implemented at Let's suppose a building where several objects are Tag4M level. The time to scan is smaller than few distributed all over milliseconds, because the tag doesnt associate with the all For a better understanding of the system, it is showed an APs. These values are sent to a pC where the localization experiment where the objects are placed only at one floor. algorithm is implemented in LabVIFW20 10 (see Fig. 5) Each of these objects has attached a tag. The devices are Table I presents a scan operation result. In this case used to determine the location of the objects in the four APs(which are placed in the floor building)named building and the distance between tags and APs. To Hawk, Helicopter, Tag4M and WitagServer are detected measure the distance, the RSSI is processed. This method The corresponding rSSi values(in dBm) measured by the is not very accurate and is strong depended to the Tag4M are reported for every AP environment, but is very easy to implement with the TABLE 1. A SEQUENCE OF RESULTS FOR THE SCANOPERATION The Fig 3 presents the experiment environment for one EXFCUTED ON THE TAG4M DEVICE oor where the colored circles represents the APs and the rectangles represents the objects intended to be located This floor is divided in six rooms separated by walls RSSI Scan results: 4 Time Ssid Ch ad-Iloc Sec wps mac Address erp WMM SSI Supported Rates(Mbits, Mandatory) Crypto Suites CW Max/min AP SCAN. llawk. -57 dBm AP SCAN, Helicopter, -50 dBm, AP SCAN, Tag4M.-68 dBm AP SCAN. WitagServer. -45 dBm The Rssi values are converted to distance values using formula(1) The value of the received signal strength is a function of the transmitted power and the distance between the Fig 3. The Experiment Environment sender and the receiver. The received signal strength will decrease when the distance increases as the following First step in finding the location is distance equation shows [23] measurement using the RSSI signal. The experiment for computing the distance is presented in Fig. 4. The RSSI(IOn- logo+A)(1) experimental precisions of measurements are less than 5 meters Where: lal propagation constant al d propagation exponent. d represents the distance from sender, A represents the received signal strength at a distance of one meter worn even by people. The system runs on batterie w sSID having a characteristic life time of a couple of years and 回H offers a platform for sensor measurements. Thus, the system can use any existent infrastructure, with significant decrease of implementation costs REFERENCES [1] H. Liu, H. Darabi, P. Banerjee and J. Liu, ""Survey of wireless Distance 2 Tn] aRch Indoor Positioning Techniques and SystemS", IEEE TRANSACTIONS ON SYSTEMS. MAN. AND CYBERNETICS-PART C: APPLICATIONS AND REVIEWS VOL 37, NO 6, NOVEMBER 2007, pp. 1067-10801 Distance 3[] [2 Want, A. Hopper, V. FalcaO, J. Gibbons, "The Active Budge 4MDastDct v Location System, ACM Transactions on Information Systems vol. 10, no l, January 1992, pp 91-102. Fig. 5. Block Diagram of the localization program [3] Firefly Motion Tracking System User's guide", vcrsion 2.2 December 1999 http://www.gesturecentral.com/firefly/fireflyuserguide.pdf The application compute the distances between the Wi- [4] Northen Digilal Inc. Website, Oplotrak PROseries, 2011 Fi Tags placed on targets and the APs placed in indoor http:/www.ndigital.com/industrial/optotrakproseries-family.php [5] E. Aitenbichler, M. Mhlhuser, An /R Local Positioning System for environment. For this case, three APs are enough but the Smart Items and Devices Proc. 23rd IEEE Internationa number of Aps can be increased for obtaining more Conference on Distributed Computing Systems Workshops accurate position estimation. The distances between the TWSAWC03), 2003 Wi-fiTagsandeachAparerepresentedascirclesasit[6]topaz,2004,http:/www.tadlys.co.il/pAges/productcontent.asp?igi bald=2 can be seen in Fig. 6, having the centre in the AP locations [7 A. Kotanen, M. Hannikainen, H. Leppakoski, and T. D which have previously known coordinates. The target's Hamalaincn, E.cperiments on local positioning with Bluetoothin position is given by the point at the intersection of the Proc. IEEE Int Conf. Inf. Technol. Comput. Commun., Apr 2003 three circles PP.297-303 [8 J. Hallberg, M. Nilsson, and k. Synnes, "Positioning with Bluetooth"in Proc. Ieee 10th Int Conf. Telecommun. Mar. 2003 ol.2,pp.954958 9 Active bat website. 2008 http:/www.cl.cam.ac.uk/research!dtg/attarchive/bat/ [10] Hazas, M, Hopper, A, "A Novel Brucdbund Ultrasonic Locution System for Improved Indoor Positioning IEEE Transactions on mobile Computing. Vol 5, No 5, May 2006 [11 N B Priyantha, The Cricket Indoor Location System", PhD thes MIT.2005 2]SonitorSystemWebsite2011,http://www.sonitor.com/ [13] Minami M, Fukuju Y, Hirasawa K, Yokoyama S, Mizumachi M Aoyama T ,"Dolphin. A practical approach for implementing a fully distributed indoor ultrasonic positioning system", Ubicomp, 2004, 347-365 Fig. 6. Front Panel of the localization program 14]J. Ilightower, R. Want, and G. borriello, SpotON: An indoor 3D cation sensing technology hased on RF signal strength"Univ The simplicity and cost efficiency of the rssi based Washington, Seattle, Tech Rep UW CSE 2000-02-02, Feb. 2000 localization make the proposed system a desired candidate 15]L. M. Ni, Y. Liu, Y. C. Lau, and A. P. Patil,"LANDMARC: Indoor location sensing using active RFID Wireless Netw., vol 10, no 6 for specific applications like tracking and positioning svstems hP.701-70.N0v.200 Zebra Technologies Corporation eb sit http://www.7ebra.com/id/zebra/na/en/index/products/location/isoie c 24730 2html V. CONCLUSION [17 P. Bahl and V. Padmanabhan, "RADAR: An in-building rf based user location and tracking system, Proc. IEEE INFOCOM, voL 2 In this paper, an indoor localization system based on March200,pp.775784 ultra-low power Wi-Fi technology and designed to 18Ekahau2011,http://www.ekahau.com: [19] T. King, S. Kopf, T. Haenselmann, C. Lubberger and w determine location of objects in a closed environment is Effelsberg, "COMPASS: A Probabilistic Indoor Positioning System proposed gILo rOC In the first part of this paper a survey of existing indoor Workshop on Wireless Network Testbeds, Experimental evaluation and Cllaracterization (WiNTECID), Los Angeles, CA, USA positioning systems was made In the second part was presented the way in which an [20] Convert sensor data to web pages using a Cloud Instrument, june object can be localized by using access points and Tag 4M 2011.http://www.tag4m.com devices which may read the rssi values [21Tag4mDatasheet2010,http://test.tag4m.com/wp- content/uploads/20/03/Tag4M Prod Datasheet Revised3. pdf The importance of the proposed system lies in ultra-low [22] Aamodt, K.(2006). CC2431 Location Engine, Application Note power and Wi-Fi transmission capabilities that are An042,fromhttp://focus.tii.co.ip/ip/lit/an/swra095/swra095.pdf embedded in a very small package, why they are suitable 320
基于 Wi-Fi 指纹室内定位系统的机器学习算法是一种利用无线网络信号强度进行定位方法。它通过收集一定区域内的 Wi-Fi 信号强度信息,构建一个指纹数据库,然后根据用户当前接收到的 Wi-Fi 信号强度,与数据库中的指纹进行比对,最终确定用户的位置。 该算法的实现涉及以下几个步骤: 1. 数据收集:首先需要在室内环境中收集Wi-Fi信号强度的数据。这可以通过在不同位置放置 Wi-Fi 接收器或移动设备,通过扫描周围的 Wi-Fi网络,并记录每个位置的信号强度信息。 2. 数据预处理:收集到的原始数据可能存在噪声或冗余信息,需要进行预处理。预处理的过程包括去除异常值、滤波平滑处理等。 3. 特征提取:从预处理的数据中提取可用于定位的特征。一种常用的方法是使用统计特征,如平均值、标准差、最大值等。 4. 建立指纹数据库:将提取的特征和相应的位置信息组成指纹对,并将其存储在数据库中。数据库中的每条记录代表一个位置和与之对应的 Wi-Fi 信号强度指纹。 5. 定位算法:当需要进行定位时,系统将收集当前位置的 Wi-Fi 信号强度信息,并与指纹数据库中的指纹进行比对。比对的过程可以使用机器学习算法,如K最近邻(KNN)算法、支持向量机(SVM)等。根据比对结果,确定最有可能的位置。 6. 定位结果评估:对定位结果进行评估,可以使用误差距离、准确率等指标来衡量算法的性能。 总体而言,基于 Wi-Fi 指纹室内定位系统的机器学习算法通过学习和识别不同位置的 Wi-Fi 信号强度模式,来实现室内位置的准确定位。这种算法可以在无需额外设备的情况下,为用户提供精准的室内定位服务,具有较好的应用前景。
评论 8
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值