# Location Adaptive Motion Recognition Based on Wi-Fi Feature Enhancement
## 3 Enhanced Wi-Fi Features Based on Human Body Speed Distribution
### Human Body Location Based on Improved Multi-Signal Classification Algorithm  
Wi-Fi technology uses several different subcarriers to transmit signals, which are modulated on different subcarriers to achieve the purpose of parallel transmission. The subcarriers are superimposed during propagation and accepted by the receiver antenna. The key of the MUSIC algorithm is to calculate the phase shift caused by the distance among antennas to estimate AOA (angle of arrival). However, this method requires many antennas, and the estimation accuracy will be greatly reduced when applied to human body location scenes due to the multi-path effect. To make phase differences more obvious and improve the resolution of AOA, we introduce ToF to the MUSIC algorithm. The signals from L signal resources are accepted by receiving array consisting of M antennas. For one signal, different subcarriers arrive at one receiving antenna with the same incident angle \(\varphi\). Because of the different frequencies, the generated original phase shift formula is as follows  
\[\Omega=\frac{2\pi(\mathrm{L}-1)\mathrm{d}(f_{1}-f_{2})\cos(\varphi)}{c} \tag{1}\]  
where \(f_{1}\) and \(f_{2}\) are the frequency of two subcarriers and \(c\) is the speed of light. Due to Wi-Fi's narrow bandwidth signal, the subcarriers' frequency is close. Since light travels very fast, the phase difference is not significant enough to be involved. After adding ToF, the phase shift formula becomes  
\[\Omega=2\pi(f_{1}-f_{2})\tau \tag{2}\]  
where \(\tau\) is the time of flight. Through importing a new parameter, the distinction of the phase shift is strengthened. Furthermore, the spatial spectral function is expressed as:  
\[P_{mu}(\varphi,\theta,\tau)=\frac{1}{a^{H}(\varphi,\theta,\tau)UU^{H}a(\varphi,\theta,\tau)} \tag{3}\]  
According to the spatial spectrum function, traversing all azimuth \(\varphi\), pitch \(\theta\), and ToF \(\tau\) at certain intervals, we can find out the number of maxima and the corresponding azimuth and pitch and then deduce the position of the human body in reverse. By the signal's angle of arrival, the source azimuth can be uniquely determined.  
The introduction of ToF will lead to the time offset in random sampling, and we leverage the multiple linear regression method to solve the phase noise. STO (Sampling Time Offset) and SFO (Sampling Frequency Offset) equivalently influence the transmitting or receiving antennas. The extra delay is constant in the transmission path of different antennas with the same sampling, but inconsistent phase errors are generated in different sampling packets. The offset introduced by SFO to all paths appears as a linear frequency term. Namely, STO offset \(\tau_{sto}\) leads to \(2\pi\Delta f(k-1)\tau_{sto}\) phase offset in the k-th subcarrier, and \(\Delta f\) is the frequency interval between carriers.  
For each CSI measurement, the offset is removed by removing the linear fitting of the spread phase shift on all antenna subcarriers. Assuming that \(\psi(i,j,k)\) is the CSI phase of the \(k\)-th subcarrier transmitted by the \(j\)-th transmitting antenna and received by the \(i\)-th receiving antenna, the best linear fitting can be obtained as follows:  
\[\hat{\tau}_{\mathrm{sto}}=\arg\min_{\beta_{1}}\sum_{N,M}^{i,j=1}\sum_{K}^{k=1 }(\psi(i,j,k)+2\pi\Delta f(k-1)\beta_{1}+\beta_{2})^{2} \tag{4}\]  
where \(\beta_{1}\) is the common slope of receiving phase response antennas and \(\beta_{2}\) is offset. The corrected CSI phase is  
\[\hat{\psi}(i,j,k)=\psi(i,j,k)-2\pi\Delta f(k-1)\hat{\tau}_{sto} \tag{5}\]  
Finally, the AoA of the reflected signal can be obtained from CSI information, and the position information of the human body can be obtained from the arrival angle of the human body signal [38; 39; 40].