# WIPP: Wi-Fi Compass for Indoor Passive Positioning with Decimeter Accuracy
## 3 System Description
### Angle of Arrial (AOA) Measurement Estimation  
The most popular algorithm used for AOA estimation is the multiple signal classification (MUSIC) algorithm [22; 23; 33], by which the number of antennas is generally required to be larger than the number of signal paths. Thus, the AOA estimation by using the MUSIC algorithm with a small number of antenna elements in an indoor environment always forms a challenging task. To address the problem mentioned above, we propose a new algorithm for the joint estimation of AOA and TOA measurements based on the fine-grained CSI which is collected by an off-the-shelf Wi-Fi device equipped with only three antennas. The Orthogonal Frequency Division Multiplexing (OFDM) technique adopted by IEEE 802.11n protocol separates the signal channel into multiple orthogonal subcarriers. Since the CSI contains channel information such as amplitude attenuation and phase shift, we use it to construct the channel transfer matrix to describe the channel characteristic of each subcarrier. In the WIPP, we select the Intel5300 NIC to collect the CSI of 30 different subcarriers. Since each AP has three antennas, the CSI with respect to each AP is described as  
\[\mathbf{CSI}=\left[ \begin{array}{ccc}csi_{1,1}&csi_{1,2}&...&csi_{1,30}\\ csi_{2,1}&csi_{2,2}&...&csi_{2,30}\\ csi_{3,1}&csi_{3,2}&...&csi_{3,30}\\ \end{array} \right] \tag{3}\]  
where \(csi_{m,n}\) is a complex number containing the information of amplitude attenuation and phase shift of the \(n\)-th subcarrier with respect to the \(m\)-th antenna. By considering the 30 orthogonal subcarriers, the signal received at three antennas is described as  
\[\mathbf{X}\left(t\right)=\mathbf{AS}\left(t\right)+\mathbf{N}\left(t\right), \tag{4}\]  
Figure 3: Geometrical relations of antenna array. where \(\mathbf{X}\left(t\right)=\left[ \begin{array}{cccccccccccc}x_{1,1}\left(t\right)&x_{2,1 }\left(t\right)&\cdots&x_{1,30}\left(t\right)&x_{2,1}\left(t\right)&x_{2,2}\left( t\right)&\cdots&x_{2,30}\left(t\right)&x_{3,1}\left(t\right)&x_{3,2}\left(t\right)\\ \cdots&x_{3,30}\left(t\right)\end{array} \right]^{\mathrm{T}}\) is a \(1\times 90\) vector of received signal. \(x_{m,n}\left(t\right)\) is the signal with the \(n\)-th frequency received at the \(m\)-th antenna. \(\mathbf{N}\left(t\right)=\left[ \begin{array}{cccccccccccc}n_{1,1}\left(t \right)&n_{1,2}\left(t\right)&\cdots&n_{1,30}\left(t\right)&n_{2,1}\left(t \right)&n_{2,2}\left(t\right)&\cdots\\ n_{2,30}\left(t\right)&n_{3,1}\left(t\right)&n_{3,2}\left(t\right)&\cdots&n_{3,30}\left(t\right)\end{array} \right]^{\mathrm{T}}\) is a \(1\times 90\) noise vector. \(n_{m,n}\left(t\right)\) is the noise with the \(n\)-th frequency received at the \(m\)-th antenna. \(\mathbf{S}\left(t\right)=\left[s_{1}\left(t\right),s_{2}\left(t\right),...,s _{K}\left(t\right)\right]^{\mathrm{T}}\) is the signal vector corresponding to the \(K\) signal paths. \(\mathbf{A}=\left[\mathbf{a}\left(\theta_{1},\tau_{1}\right),\mathbf{a}\left( \theta_{2},\tau_{2}\right),...,\mathbf{a}\left(\theta_{K},\tau_{K}\right)\right]\) is the \(90\times K\) direction matrix. \(\mathbf{a}\left(\theta_{k},\tau_{k}\right)\) is a \(90\times 1\) direction vector which is described as  
\[\mathbf{a}\left(\theta_{k},\tau_{k}\right)=\left[ \begin{array}{cccccccc} \mathbf{a}_{1}\left(\theta_{k},\tau_{k}\right)&\mathbf{a}_{2}\left(\theta_{k}, \tau_{k}\right)&\mathbf{a}_{3}\left(\theta_{k},\tau_{k}\right)\end{array}  \right]^{\mathrm{T}}. \tag{5}\]  
In Equation (5), \(\mathbf{a}_{m}\left(\theta_{k},\tau_{k}\right)=\left[ \begin{array}{cccccccc} a_{m,1}\left(\theta_{k},\tau_{k}\right)&a_{m,1}\left(\theta_{k},\tau_{k}\right)&...&a_{m, 30}\left(\theta_{k},\tau_{k}\right)\end{array} \right]^{\mathrm{T}}\) (\(m=1,2,3\)) is a \(30\times 1\) vector and  
\[a_{m,j}\left(\theta_{k},\tau_{k}\right)=e^{-j2\pi\left[\left(i-1\right) \Delta f\tau_{k}+\left(m-1\right)\frac{d\sin\theta_{k}}{c}\right]} \tag{6}\]  
where \(\Delta f\) is the frequency interval.