A Frequency Modulation Fingerprint-Based Positioning Algorithm for Indoor Mobile Localization of Photoelectric Modules

Optoelectronic modules have a wide range of applications in the field of wireless communication. However, the function of mobile localization has not been realized in optoelectronic modules. In this paper, an indoor positioning algorithm, which was based on frequency modulation (FM) signals, was realized in optoelectronic modules. Firstly, FM monitoring receiver DB4004 was used to collect FM signals; Secondly, FM signals were preprocessed and analyzed to build a FM dataset. Finally, weighted centroid k-nearest neighbors (WC-KNN) precise positioning algorithm was proposed to obtain the position information of the photoelectric module. Experimental results showed that the median location error of the WC-KNN algorithm can reach 0.8 m and additional hardware equipment was not required. The research results provided the feasibility for the practical application of equipment based on optoelectronic devices in various fields.


INTRODUCTION
With the rapid development of optoelectronic technologies in recent years, various optoelectronic devices were widely used in indoor mobile robots [1], Internet of Things [2] and other industries. And they were related to professional fields, such as visual analysis [3] and display technology [4]. Optoelectronic technologies are a basic technology in the current industrial application fields. Because of exponential growth in the use of optoelectronic modules, it is necessary to deploy thousands of intelligent terminals which can integrate with optoelectronic modules in indoor applications [5]. Especially, the location information of these modules is a basic information for fault detection and other various application services in a mobile application environment [6]. It is the core data for supporting specific applications. So, the research of indoor positioning algorithm model has a great significance [7].
In recent years, global positioning system (GPS) technology had been a mainstream choice for global positioning systems [8]. Assisted global positioning system (A-GPS) technology had the advantages of high speed and high accuracy in outdoor positioning applications [9]. However, it showed obvious shortcomings in indoor positioning. A-GPS localization required multiple network communications with a server, which took up a lot of communication resources. Especially, A-GPS localization was vulnerable to network congestion in areas where mobile phones were used intensively. In addition, Wi-Fi positioning was a more popular positioning technology in the application of indoor positioning [10]. Wi-Fi positioning accuracy could reach a meter level, but Wi-Fi signals had a short wavelength, severe transmission attenuation, which could limit the effective positioning range. Moreover, the Wi-Fi signals have not been deployed in many areas. So, FM signals were proposed for indoor positioning. Compared with A-GPS positioning and Wi-Fi positioning, there was no need to communicate with the server. Network congestion problems were avoided when FM signals were used to position [11]. What's more, FM signals had a long wavelength, a long transmission distance, and it was less affected by multipath effects. It could form a better stability and robustness in a complex indoor environment [12]. In addition, FM signals based stations were widely available [13]. So, no additional hardware equipment was required. It reduced the cost of popularization greatly.
In this paper, a fingerprint location algorithm WC-KNN based on FM signals was proposed to solve the indoor location of photoelectric modules. And a practical fingerprint positioning model was proposed by simulation analysis. The model only used a public FM transmission information and floorplans to predict the distribution of RSS. So, it can achieve a high-precision positioning.

ALGORITHM PRINCIPLE DESCRIPTION
The positioning process can be divided into two stages, offline and online phase [14]. In the offline phase, the positioning area is discretized, the received signal strength (RSS) information of each discrete point is collected. Then, the RSS feature vector of each discrete point is extracted as a fingerprint information. Finally, a location fingerprint library is constructed based on feature vectors of all discrete points [15]. In the online calculation process, the matching algorithm WC-KNN is used to find the point with the highest RSS feature similarity in the location fingerprint dataset as an estimated location.

Offline Phase
The main work of the offline phase can be divided into two points. Firstly, the appropriate reference points (RPs) density for the positioning area are selected after selecting experimental environment, and the continuous positioning area is discretized. Then, the RSS signals of each channel in the FM broadcast are collected and entered into the dataset by a special testing equipment [16]. Secondly, the collected RSS information is preprocessed, outliers are eliminated, and the processed data for feature extraction are used to build a location fingerprint dataset, which is shown in Eq. 1.

RSSI rq
RSSI r1 , RSSI r2 , ..., RSSI rp , r 1, 2, ..., R, q 1, 2, .., Q RSSI rq is a R×Q matrix which contains collected RSS information. According to Eq. 2, the average value of measured values in each FM channel is calculated and recorded as the reference data of a RP.

Online Phase
In the fingerprint-based localization stage, deterministic and probabilistic methods are used to estimate the position mainly. Three different algorithms are compared and analyzed. The first algorithm is the nearest neighbor algorithm (NN) [17,18]. The position of the nearest RP to the unknown node is regarded as the estimated position. The nearest RP is decided with the shortest distance from an unknown point. This distance calculation is based on the Manhattan distance or Euclidean distance between the observed fingerprint and the fingerprint recorded in the database. The second algorithm is K nearest neighbor method (KNN) [19,20]. The basic principle of the algorithm is that the fingerprint r i , i 1, 2, ..., L in the fingerprint library and the fingerprint r collected online are both the mean value of each FM broadcast signal sample. During the execution process, the Euclidean distance between r and the fingerprint RP i stored in the fingerprint library are solved, and it is sorted from small to large [21]. Then, K coordinate positions l i corresponding to RP i with the smallest Euclidean distance are selected for weighted calculation, which is showed in Eq. 3. Finally, the weighted coordinate positions are the coordinate positions of the terminal.
r argmin Where, r [r 1 , r 2 , ..., r k ] T represents the fingerprints dataset at K RPs with the smallest Euclidean distance. The relative coordinate position dataset is l [l 1 , l 2 , ..., l k ] T . Then the coordinate position is estimated to be l by the KNN algorithm, which is shown in Eq. 4.
The position estimation l of WC-KNN algorithm is optimized by Eq. 5.
Where w i 1 ς+ r i −r , ς is a constant approximately zero. From Eq. 5, it can be seen that WC-KNN algorithm is a special case of the weighting factor in the KNN algorithm to remove the mean value.
In order to improve the estimation accuracy, more RPs are set when collecting data when data is collected. The dense distance between RPs often leads to close proximity of fingerprint data in neighboring RPs, which forms a fuzzy judgment for the traditional KNN algorithm. So, the positioning accurate is affected ultimately. So, the graphic area enclosed between RPs is reduced in order to avoid overfitting and fuzzy judgment. Centroid method is proposed to optimize the algorithm model as follows.
An intelligent terminal A has its real coordinates in a 2D experimental environment. The coordinates of RP i are ( x i , y i ). The RSSI p , i 1, 2, ..., p received from point A is calculated for each RP according to Eq. 5. And the K RPs are selected with the highest geometric spatial correlation. In this paper, the distance d n is used to represent the geometric spatial correlation. The d n is obtained in Eq. 6.
Frontiers in Physics | www.frontiersin.org January 2021 | Volume 8 | Article 619363 The area which is composed of selected RPs is considered, the coordinates of centroid O b is (x Ob , y Ob ), which is obtained in Eq. 7.
Then, the distance d Ob between the centroid O b and A is obtained in Eq. 8.
Where, the coordinates of RP i are ( x i , y i ) . The relationship between d Ob and d n is obtained in Eq. 9.
Therefore, coordinates (x k , y k ) of K RPs are obtained, and the distance d n between them and the intelligent terminal A are calculated. And coordinates of the space centroid O b enclosed by the selected RP and the distance between O b and A can be obtained by Eq. 7 and Eq. 9. Eq. 9 is simplified further, Eq. 10 can be obtained. Where, d ij indicates the distance between RP i and RP j . Without loss of generality, it is assumed that the distance between the selected K RPs and the intelligent terminal A satisfies Eq. 11.
Substitute Eq. 11 into Eq. 10, F 1 and F 2 can be obtained in Eq. 12.
Eq. 10 and Eq. 12 are combined, the conclusion can be drawn in Eq. 13.
Where, d N is distance between RP and the intelligent terminal A.
There is at least one RP in the known K RPs. d N must be greater than the obtained distance d Ob . Therefore, the current centroid O b is used to replace the RP which is farthest from the intelligent terminal A. At this time, the plane enclosed by the new K RPs must be smaller than the plane enclosed by the original K RPs. The area where the intelligent terminal A can be further reduced and the positioning performance is improved by multiple iterations.

EXPERIMENTAL ENVIRONMENT
In this part, experimental environment was configured, experimental process was designed, and FM signals of each channel were collected. The experimental environment was located on a fourth floor of an office building and a layout of the experiment environment was shown in Figure 1. It was a typical indoor office environment, including 12 rooms and corridors. Firstly, we selected a test point (TP) in each room. Then, FM broadcast signals with strong nearby signals were searched by a FM test equipment. Figure 2 was a full-band FM signal RSSI diagram. Each TP could search 15 FM channels (p 15), which could cover an entire FM bandwidth from 88 to 108MHz, as shown in Figure 2. Finally, FM monitoring receiver DB4004 was used to open the FM full-band to sweep FM signals of all frequencies. There were 15 sets of FM programs with frequencies of 89.7-106.9 MHz.

ILLUSTRATIVE EXPERIMENTAL RESULTS
In this part, performance of several algorithms was evaluated, and changes in performance caused by parameter changes were analyzed to verify the effectiveness of the algorithm.
Because our FM-based positioning was two-dimensional positioning, the height of the FM antenna remained a constant in all measurements. Signals were collected three times a day and measured 10 times each time in two weeks. So, scene of human presence was avoided effectively. At the same time, room 308 was selected as a testing platform for fingerprint positioning. Figure 3 showed the indoor environment layout and RPs setting diagram of room 308.
FM fingerprint was generated by MS9801 field intensity meter to collect FM broadcast signal. Because of office furniture, 42 data collection points were set up in one room with a size of 16m × 18m. The collection point size was 3m × 3m. Each FM fingerprint included 15 channels, and each channel collected 10 RSSI samples at a time. In the simulation analysis, interpolation and increased coverage area were used to increase sampling data and provided positioning accuracy. The RPs were expanded to 280, and the size of collection points was 1m × 1m.
A path which was consisted of 100 points was selected as the real path randomly, which was showed as a blue line in Figure 4. And the position information was used to estimate by the algorithm in this chapter as the predicted path, showed in the red line in Figure 4. The predicted location was compared with the actual location, the average positioning error of the system was 0.8 m. The overall positioning results were basically consistent with the real trajectory, although some points had large positioning errors. It indicated that the algorithm could better meet the location service.
WC-KNN algorithm was compared with three different positioning algorithms, which were NN, KNN, and Bayesian algorithms [22], respectively. Figure 5 showed the performance results of the FM positioning system by using all broadcast FM stations in simulation. The median location error Positioning errors were increased by 33%, 55% and 62%, respectively. Obviously, such a small positioning error was due to the effectiveness of fingerprint library modeling. So, the performance of WC-KNN algorithm in indoor positioning had an improved significantly.

INFLUENCE OF PARMETERS ON LOCALIZATION
In order to verify the effectiveness of the algorithm, MATLAB was used to compare the real path and the estimated path. And the average positioning error of algorithms was calculated.
Because the estimation error of the WC-KNN algorithm was greatly affected by factors such as K value, access point (AP) number. Controlling variable method was used to analyze the impact of parameter changes effectively.

The Influence of K Value on Localization
One motion node was selected for algorithm simulation. Figure 6 showed that different K values in the algorithm correspond to different positioning errors. When K < 20, the positioning error dropped rapidly, and it entered the relative convergence stage when K 20. As K increased, the positioning error generally showed a downward trend, then it began to rebound. Finally, it rose after reaching a certain value. The overall positioning performance was the best when the value of K was around 30. When farther points were selected, it would also affect the classification of positioning nodes. And it would lead to the situation of under-fitting, which can lead to a large error in this node.

The Influence of AP Number on Localization
Signals from all FM frequency points were used for positioning calculation. However, wider FM fingerprint data required more time for data collection, and it would also increase the practical cost of a positioning system and the dimension of positioning calculation significantly. In addition, the calculation amount of the algorithm was increase significantly. Therefore, not all FM frequency points could play the same role in the positioning calculation, so it was necessary to find an optimal balance point between the FM fingerprint width (the number of APs) and the positioning accurate. FM signals with 15 different frequency points were received from three different broadcast transmitters. Among them, broadcast transmitter 1 received 6 broadcast signals, broadcast transmitter 2 received 5 broadcast signals, and broadcast transmitter 3 received 4 broadcast signals. The same number of AP fingerprint data was selected from different broadcast transmitting stations. The number of APs were 3, 6, 9, 12, and 15, respectively, showed in Figure 7. The K value was 30. Figure 7 showed that when 9 APs were selected, the positioning error was 2.1 m, which was equivalent to the positioning error of all APs. The analysis results showed that when the FM broadcast AP was effectively selected, not only a lower positioning error could be achieved, but also the fingerprint database involved in the calculation was also reduced. It had the effect of reducing the computational complexity and improving the operating efficiency of system. A large number of test and analysis results showed that an effective selection of FM broadcast AP could reduce the width of the fingerprint by about 40% with less impact on the positioning error.

The Influence of Different Receiving Equipment on Localization
The receiving equipment used for the signal acquisition was a field intensity meter. The resolution of the equipment was FIGURE 6 | When K < 20, the positioning error dropped rapidly, and when K 20, it entered a relative convergence stage. When K 30, the overall positioning performance was the best. When K continued to increase, the classification of positioning nodes was affected.

FIGURE 7 |
The relationship between frequency AP and error. When AP 9, the positioning performance was the best, which was similar to AP 15. When AP 12, positioning error slightly increased because of accidental factors.  0.1 dBm. And FM monitoring receiver DB4004 was used for data acquisition. The resolution of the equipment was 0.01 dBm. As shown in Figure 8. Figure 9 showed that the data was collected by two different resolution receivers. When the WC-KNN algorithm was used, the median positioning error of the FM monitoring was 0.7 m. Compared with the field strength meter, the median positioning error was smaller than 0.1 m. The difference in positioning error between the two was about 0.5 m with 95% confidence. Therefore, the resolution of the receiving device had a greater impact on the indoor positioning error.

CONCLUSION
In this paper, an improved WC-KNN algorithm based on FM signals was proposed as a positioning algorithm. The fingerprint dataset was established according to the geometric layout of the indoor environment. And fluctuation characteristics of signals were quantified and added as a weight to the distance calculation of the positioning algorithm, which solved the fuzzy judgment problem of the traditional KNN algorithm. The FM positioning experimental environment was built in the school laboratory building, and RSS dataset which was corresponded to the physical space was established. The experimental data verified that positioning accuracy was improved by the WC-KNN algorithm compared to the three traditional algorithms. Then, the influence of different parameters on the positioning accuracy was discussed, the effectiveness of the WC-KNN algorithm under different conditions was verified. In the 16 × 18 m positioning area, the average positioning error was 0.8 m, the maximum was 2.3 m, and the positioning error of 90% in the test points was below 2.0 m. The impact of complex indoor environment was reduced effectively and positioning accuracy was improved, which had a certain practical value.