1. Introduction
The demand for accurate indoor positioning systems has witnessed a significant rise in recent years. While traditional Global Navigation Satellite System (GNSS) technology has revolutionized outdoor navigation, it falls short when it comes to providing precise positioning information within indoor environments. This limitation has spurred the development of WiFi indoor positioning, a technology that utilizes WiFi signals to enable accurate localization and navigation within buildings.
In recent years, with the mass penetration of wireless networks, there have been more opportunities for the much-needed location-based services to be realized [
1]. Internet of Things (IoT) technology [
2,
3] is continuously improving which brings stronger drivers for the development of indoor positioning. In indoor scenarios, CSI defined by the IEEE 802.11 WiFi protocol is a better reflection of CSI [
4] than received signal strength information. Therefore, CSI data are beginning to be used by academics for WiFi indoor localization.
The AoA, AoD, and ToF required for indoor positioning can be estimated by traditional algorithms [
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19]. The MUSIC algorithm [
2] relies on a computationally intensive grid search for parameter estimation. High-accuracy estimates take a long time to obtain. For example, SpotFi [
6], a median positioning accuracy of 40cm can be achieved in an office environment using the 2D MUSIC algorithm. However, this method has some disadvantages: the 2D MUSIC algorithm takes a lot of computational time. The estimation performance deteriorates in low snapshot situations and at a low SNR [
20,
21,
22]. Soltanaghaei [
8] combines the TDoA estimation and the AoA estimation of multipath CSI signals. A single AP localization is achieved. It relies on a sufficient number of multipaths while ignoring multiple reflected paths. This makes this system ineffective in complex indoor environments. The M3 [
11] system was proposed, which uses the super-resolution algorithm SAGE to jointly estimate the AOA, AOD, and relative ToF. The algorithm succeeded in achieving a centimeter-level localization accuracy. However, incorrect multipath numbers can lead to large errors in the parameter estimation results at a low SNR. RoArray [
13] transforms the AoA estimation into a sparse recovery problem. This method is able to produce sharp and sparse AoA spectra. Direct path identification is achieved by jointly estimating the ToF and AoA for all paths. However, the long computation time makes it difficult to meet the requirements of real-time localization. The above method has a poor estimation performance and high computational burden at a low SNR.
Some algorithm implementations require modifications to the hardware settings. This makes WiFi array localization difficult to implement on commercial NICs. Chronos [
14] is a single AP positioning system. It achieves a decimeter-level location accuracy by combining the ToA and AoA estimations. However, it requires modifications to existing WiFi protocols and increases the bandwidth of the CSI signal through frequency hopping. This means that it is difficult to implement on actual commercial APs. Yang [
15] uses a two-dimensional matrix pencil (2D-MMP) approach to achieve a fast estimation of the AoA and ToF with a decimeter-level accuracy. However, the algorithm must meet at least four receiving antennas, which requires modification of the receiving equipment. This is not applicable in the current situation where most commercial network interface cards (NICs) have only three receive antennas. Moreover, the estimation performance is poor at a low SNR.
The above articles all use matrix analysis. Because of the multi-dimensional structural nature of multi-packet CSI data, scholars have started to use tensor analysis to extract multi-dimensional structural information to improve algorithm performance [
23]. Zhao et al. [
24] proposed a tensor-based localization algorithm that makes full use of the multipath component of the CSI to achieve decimeter-level localization by fusing the arrival time difference and AoA information of each MPC. Gong [
25] formulates the location parameter estimation problem as a Tensor Decomposition problem. The received signal is decomposed into three steering vectors, the AoA, AoD, and ToF, by a pre-processing step. Only one AP is used for localization. Both of the above algorithms use one steering vector of the Tensor Decomposition to estimate a parameter. HOSVD [
26,
27,
28,
29,
30] can make full use of the multi-dimensional structure of the CSI tensor. The HOSVD has higher estimation accuracy at a low SNR with low snapshots; therefore, HOSVD is used to process the tensor.
In this paper, an algorithm for a WiFi array localization system based on HOSVD is presented. This algorithm wants to solve two problems. The first one allows the algorithm to have a better performance for estimation in complex environments. The second one is to solve the problem of estimation efficiency of the algorithm so that the algorithm can have a shorter estimation time. First, CSI data are reconstructed as a new measurement matrix by borrowing subcarriers. The multi-packet data are stored in a tensor to capture the multi-dimensional structure. Then, a tensor that is as small as possible is obtained by tensor compression techniques and preserves most of the valid information of the signal. Next, the signal subspace can be obtained by HOSVD, and the AoA can be obtained by means of the RD-MUSIC method. Finally, the coordinates of the target can be obtained by triangulating the AoAs of the three AP points. We list the main contributions of the proposed method as follows:
- (1)
The multi-dimensional structure of the multi-packet CSI data is stored in the tensor, which improves the accuracy of the target estimation. The method implements AoA estimation for WiFi indoor positioning on a tensor domain.
- (2)
Reduced computational complexity. To store the same amount of multi-packet CSI data, we constructed a tensor with a smaller dimension than the ones constructed by other algorithms.
- (3)
Further reduction in computational complexity. As the tensor stores a large amount of CSI data, tensor compression techniques are used to reduce computational complexity and retain most of the valid information of the signal. With the Lagrange multiplier method, the AoA and ToF are decoupled, which further reduces the dimension of the peak search. Both methods ensure accuracy and reduce the complexity of the calculation.
The notations used in this paper are defined in
Table 1.
2. Data Model
The initial matrix of the collected CSI data is first presented in order to better introduce the data processing of the proposed algorithm. Consider an AP with
M identical antenna Uniform Linear Array (ULA) arrays spaced at half of a wavelength. The transmitter uses a single antenna to transmit an orthogonal frequency division multiplexing (OFDM) signal with
N subcarriers. The
n-th subcarrier frequency is
, and the continuous subcarrier spacing is
. There are
L channels in the room, and
I CSI packets are collected at a time. The
i-th CSI packet can be expressed as
where
is the data received at the
M-th antenna and the
N-th subcarrier. The measured value of CSI at the AP point at the
m-th antenna in the
i-th packet of the
n-th subcarrier can be expressed as
where
f and
d are the central frequency and the spacing between consecutive antennas;
c and
are the speed of light and the complex fading of the
l-th path, respectively.
and
are the AoA and ToF of the
l-th path, and
is the Gaussian noise. It was observed through the composition of Equation (
2) that there are parameters of interest to us within the CSI matrix, such as the AoA and ToF.
The phase shift AoA function for the
l-th propagation path of the
i-th packet can be expressed as:
and the AoA steering vector can be expressed as
Thus, the array manifold pattern for the AoA of the
i-th packet can be expressed as
Similarly, the complex exponent of the phase shift introduced between adjacent subcarriers can be expressed as
The steering vector for the ToF of the
i-th packet can be expressed as
In the subsequent process, Equations (
4) and (
7) will be mathematically computed to solve the problem of receiving antennas resources. The array manifold pattern for the ToF of the
i-th packet can be expressed as
Then, the signal
of the i-th packet can be expressed as
where
and
are the signal matrix and noise matrix of the
i-th packet, respectively.
5. Simulation and Experimentation
In order to verify the proposed method, simulation experiments and practical experiments are performed in this section.
In this experiment, we do not make hardware changes and only use commercial NICs and routers for the experiment. We choose the 5G band that has a bandwidth of 40 MHZ, and this choice will have a better estimation performance than using a 20 MHZ bandwidth.
5.1. Verification of Algorithm Efficiency
The first part is an ablation experiment with tensor compression and RD-MUSIC to verify the effectiveness of both computation methods. The second part is a simulation experiment of the HOSVD algorithm under different conditions. The first aspect is to test the ability of the HOSVD algorithm to estimate different multipath targets. The second aspect is to test the effect of different snapshots on the estimation accuracy of the HOSVD algorithm. The number of times a sensor makes an adoption is called a snapshot. The more samples taken, the better the estimate will be. The third aspect is to test the estimation capability of the HOSVD algorithm with different SNRs. The ratio of signal power to noise power is defined as the SNR, and a ratio higher than 1:1 (SNR > 0dB) means that there is more signal than noise.
According to
Table 2, we used the parameters of the chart and conducted simulation experiments using different snapshots. Simulation experiments are performed to estimate the AoA and ToF for each of the five targets. In this simulation experiment, the following four cases are performed separately:
A: Tensor compression and dimensionality RD-MUSIC are not performed.
B: Tensor compression is performed, but no dimensionality RD-MUSIC is performed.
C: Tensor compression is not performed, but dimensionality RD-MUSIC is performed.
D: Both tensor compression and dimensionality RD-MUSIC are performed.
According to
Table 3, first is the comparison of Case A and Case B. After tensor compression is performed, the computation time does not increase significantly due to the increase in the number of packets. This is because it is a dimensionality reduction process on the data dimension. Then, there is a comparison between Case A and Case B. After RD-MUSIC is performed, the computation time increases dramatically with the increase in data packets. However, with the same number of packets, the computation time of Case C is significantly smaller than that of Case A. This is because RD-MUSIC is making a two-dimensional traversal search reduced to a one-dimensional traversal search. Last is the comparison between Case A and Case D. With both tensor compression and RD-MUSIC, the computation time can be reduced significantly and does not increase with the increase in the number of packets.
According to
Table 2, we used the parameters of the chart and conducted simulation experiments using 150 snapshots. The tested AoA and ToF are (−68.4°, 4.0 ×
ns), (−33.1°, 1.8 ×
ns), (10.1°, 2.8 ×
ns), (40.3°, 7.2 ×
ns), and (59.8°, 5.8 ×
ns) with an SNR = −5 dB, and the effect is shown in
Figure 5.
As
Figure 5 shows, there are three, four, and five obvious and accurate spectral peaks on the spectral peak graph, respectively, when the multipath number L = 3, L = 4, and L = 5. This can prove that the HOSVD method can successfully and accurately estimate the angle when L ≤ 5. We used the parameters of
Table 2 and conducted simulation experiments using different snapshots. The tested AoA and ToF are (−68.4°, 4.0 ×
ns), (−33.1°, 1.8 ×
ns), (10.1°, 2.8 ×
ns), (40.3°, 7.2 ×
ns), and (59.8°, 5.8 ×
ns) with an SNR = −5 dB, and the effect is shown in
Figure 6.
As
Figure 6 shows, only one of the four multipath targets can be estimated when the snapshots = 15. There are four multipath targets that can be estimated completely and accurately when the number of snapshots increases to 150. This can prove that multi-packet fusion can improve the accuracy of estimating the number of targets and the accuracy of the target angle. When the number of snapshots increases from 150 to 300, it can be seen from the peak grap that the increase in the number of snapshots has a positive gain on the estimation accuracy. However, the gain is smaller when the number of snapshots increases to a certain extent. We used the parameters of
Table 2 and conducted simulation experiments using 150 snapshots. The tested AoA and ToF are (−68.4°, 4.0 ×
ns), (−33.1°, 1.8 ×
ns), (10.1°, 2.8 ×
ns), (40.3°, 7.2 ×
ns), and (59.8°, 5.8 ×
ns) with different SNRs, and the results are shown in
Figure 7.
As
Figure 7 shows, with the increase in the SNR, the estimation accuracy results of the proposed algorithm are continuously improved. When the SNR = −10 dB, the HOSVD method still has the ability to estimate the target angle. When the SNR = −5 dB, the algorithm can accurately estimate the angle of five multipath targets.
5.2. Comparison of Algorithm Simulation
According to
Table 2, for HOSVD and Music, the Tensor Decomposition algorithm estimated the AoA and ToF with 150 snapshots. The tested AoA and ToF are
°,
ns),
°
ns),
°
ns),
°
ns), and
°
ns) with an SNR = −5 dB, and the spectral peak plots are as follows.
From
Figure 8, we can see that Tensor Decomposition cannot accurately estimate the five multipath targets with the low SNR, and the spectral peaks are not sharp enough to make the accuracy high. HOSVD and MUSIC can still accurately estimate the number of the five multipath targets and have a high accuracy with the low SNR. However, the spectral peaks searched by the MUSIC algorithm are not sharp, which can prove that the HOSVD method is more suitable for indoor complex environments.
We perform 500 Monte Carlo experiments on HOSVD, the Tensor Decomposition algorithm, and the MUSIC algorithm respectively to calculate the Root Mean Squared Error (RMSE) [
24,
25] for estimating five different target angles with different SNRs. Monte Carlo experiments are performed using the parameters within
Table 2. The tested AoA and ToF are
°,
ns),
°
ns),
°
ns),
°
ns),
°
ns). The SNR is set to −5 dB to 20 dB. The expression of the RMSE can be expressed as
where
is the
l-th true DOA.
is the angle on the
l-th path measured by the
p-th Monte Carlo experiment. For example, the error between the estimated AoA and the correct AoA for each loop was recorded when using an algorithm with SNR = −5 dB. The errors obtained under this loop were squared and summed to obtain a sum of errors. Finally, the sum of errors is divided by the number of loops and the total number of targets to obtain the value of RMSE for this algorithm with an SNR = −5 dB. From
Figure 8c, the Tensor Decomposition algorithm [
24] cannot estimate the exact target number with an SNR = −5 dB. The method of the spectral peak search used in the text is abandoned, and the method of phase extraction is chosen for estimation.
As seen from
Figure 9, HOSVD has a lower RMSE than the MUSIC algorithm and the Tensor Decomposition algorithm for all SNRs. This shows that HOSVD has a theoretically better performance in complex environments with a low SNR.
5.3. Experiments
After verification of the simulation experiments, we now perform field tests. The receiver is a computer with an intel 5300 (Manufacturer: Shenzhen Fenvi Technology Co. The city and country of source of the equipment are: Shenzhen and China, respectively.) NIC, operating system version unbuntu 14.04, and the intel 5300 NIC has three ULA antennas. The transmitter is a Xiaomi router with 2 × 2G antennas and 2 × 5G antennas; we mainly choose the 5G antenna as the transmitting antenna.
We first installed the CSI tool on the desktop computer’s unbuntu system. As seen from
Figure 10, the desktop computer is equipped with an intel 5300 NIC, and an external antenna with SMA cable is used as the receiving end to facilitate the collection of CSI data. The Xiaomi 4a router is the transmitter. We set the router in the 161 band of the 5G signal with a center frequency of 5.805 GHZ and a bandwidth of 40 MHZ. We connect the router wirelessly with a computer and open two terminals, one to start the CSI tool and the other to continue data interaction with the router, thus enabling data collection.All data processing in the experiments was performed using MATLAB R2021a.
As
Figure 11 shows, the tensor
stores multi-packet CSI data, but one of the dimensions of the tensor
is smaller than the multipath number
L. The new tensor
needs to be reconstructed again by Equation (
10). Then, each dimension of the tensor
is larger than
L. Decomposition of this large tensor
with HOSVD takes a long time. In this case, the tensor can be compressed by means of a compression matrix. With this method, it is possible to preserve most of the information of the signal and also to keep the tensor as small as possible. On the other hand, the intel 5300 NIC is not sufficient for ToF resolution and cannot be used to estimate the distance from the transmitter to the receiver. Therefore, only the AoA needs to be estimated. We use the RD-MUSIC method to estimate the required AoA, which can change the time-consuming two-dimensional spectral peak search into a one-dimensional spectral peak search and reduce the computation time significantly.
5.4. Experimental Testing in Different Scenarios
We chose the equipment mentioned in the previous section to conduct localization experiments on the playground and laboratory. First, we conduct the positioning experiment on the playground. The experimental area is an open area of 6 m × 8 m. The experimental equipment is placed as follows in
Figure 12.
As shown in
Figure 12, three AP points are placed, where the red point is the test point, and data are collected 10 times on each test point, each time for 150 packets. After performing data processing with different algorithms, we chose the HOSVD algorithm, Tensor Decomposition algorithm [
24], MoLA algorithm [
19], and SpotFi algorithm [
6] for comparison. The Cumulative Distribution Function (CDF) plot of the overall error of the AoA is obtained as follows in
Figure 13.
According to
Figure 13, considering the estimation error at a ratio of 0.667, it can be seen that the HOSVD algorithm, Tensor Decomposition algorithm, MoLA algorithm, and SpotFi algorithm can achieve AoA estimation errors of 3.25°, 4.57°, 6.87°, and 7.45°. The HOSVD algorithm has better estimation performances at test locations with a high SNR. There is no significant multipath signal in the spatial playground; therefore, the collected CSI data will only contain a direct path angle. The calculated angles deviate slightly from the true angles, which proves that the measured data and the algorithms are convincing. The CDF of the distance gap between the calculated position and the true test point position for triangulation using Equation (
35) are plotted as follows in
Figure 14.
According to
Figure 14, localization experiments were carried out on the playground. The HOSVD, the Tensor Decomposition algorithm, the MoLA algorithm, and the SpotFi algorithm could achieve localization errors of 0.39 m, 0.50 m, 0.72 m, and 0.85 m. The second experimental location is the laboratory, which has many tables and pieces of equipment, so the multipath effect is evident here. The distribution scheme of experimental AP points and test points is in
Figure 15.
As shown in
Figure 15, there are three AP points set up in the laboratory. The red dots are the test points, and there are 23 test points in total. At each test point, 10 sets of data are collected; each set contains 150 packets of data. The heights of the receiver and transmitter are at the same level. The true position and orientation of the ground was confirmed by using a building protractor and the geometric relationship between the transmitter and receiver. In the experiments, the proposed algorithm was compared with the Tensor Decomposition algorithm [
24], the MoLA algorithm [
19], and the SpotFi algorithm [
6] to evaluate the parameter estimation accuracy and localization accuracy. Firstly, the overall AoA accuracy and localization accuracy of the different algorithms are evaluated in the same scenario. Secondly, we compare the program execution times. Everything is the same in each experiment except that the algorithms were different.
In the experiment, 10 sets of CSI data are collected from the same AP point. The true angle of this AP point to the receiver was 33.3°. The AoA results are obtained by calculating these 10 sets of CSI data by the HOSVD, Tensor Decomposition, MoLA, and SpotFi algorithms, respectively. The results are shown in
Table 4. According to
Table 4, the HOSVD and Tensor Decomposition algorithms still retain certain robustnesses in the complex laboratory environment, and the average angle errors of the 10 measurements are 5.38° and 7.6°, respectively. The MoLA and SpotFi algorithms are single snapshot two-dimensional algorithms with poor robustnesses in complex environments, and the average angle errors of the 10 measurements are 10.38° and 17.88°, respectively. The MoLA algorithm employs source estimation and I-MUSIC to decorrelate the signal as much as possible and improve the accuracy of the estimation. According to
Table 4, the HOSVD algorithm exhibits a better accuracy of the estimation, which also indicates that the estimation accuracy in complex environments can be improved by tensor storage of multi-packet data.
According to
Figure 16, considering the estimation error when the ratio is 0.667, it can be seen that the AoA estimation accuracies of the HOSVD algorithm, Tensor Decomposition algorithm, MoLA algorithm, and SpotFi algorithm can reach 5.81°, 7.62°, 12.33°, and 17.12°, respectively, which proves that HOSVD has the best angle estimation in the complex laboratory indoor conditions. The CDF diagram of the distance between the true position and the calculated position with triangulation in Equation (
35) is shown in
Figure 17.
The results of the localization experiments conducted in the laboratory can be seen in
Figure 17. The HOSVD algorithm, Tensor Decomposition algorithm, MoLA algorithm, and SpotFi algorithm can achieve localization errors of 0.68 m, 0.89 m, 1.21 m, and 1.33 m, considering an estimation error at a ratio of 0.667. The laboratory environment is more complex. MoLA and SpotFi use single packet estimation, resulting in a larger overall estimation error. Both the Tensor Decomposition algorithm and HOSVD use packet fusion, leading to a smaller overall estimation error. The final results show that HOSVD performs better in terms of its estimation performance with a low SNR.
5.5. Calculation Time
The short calculation time of the angle estimate benefits real-time localization. The HOSVD algorithm, Tensor Decomposition algorithm [
24], MoLA algorithm [
19], and SpotFi algorithm [
6], respectively, perform angle estimations for different numbers of packets. The specific computation times are shown in
Table 5.
According to
Table 5, on the one hand, the increase in packets does not cause a significant time change to HOSVD due to the tensor compression technology. The time spent by the Tensor Decomposition algorithm is mainly for the 2D spectrum peak search. MoLA and SpotFi need to perform a spectral peak search on each packet, which takes a lot of time. The tensor constructed in this paper is also smaller in dimension than the one constructed by the Tensor Decomposition algorithm. As a result, the proposed algorithm takes the least amount of time when faced with large amounts of data. In addition, the computation time does not change rapidly as the amount of data grows.