39:8·N.Yu et al. 0.6 ●-t.0ms 【2ms 0.4 ★tm1mg t-2ms ★ 10 02 0 15 02 20 0.4 25 -0. 20 -10 0 10 20 30 30 -20 .10 0 10 20 30 OFDM Subcarriers OFDM Subcarriers (a)Raw CSI phase. (b)Denoised CSI phase. Fig.4.The effect of phase correction on frames at different time instances We first remove the highly dynamical phase offset introduced by CFO.To estimate the value of CFO,we first observe that the phase of CSI measurements is mainly determined by three factors:CFO,SFO/PBD,and hand movements.As shown in [27],the phase offset of SFO and PBD is zero on the subcarrier with an index of k=0.Therefore,the phase of subcarrier 0 for each antenna pair only contains the phase of CFO and the impact of hand movements.However,removing the phase of a randomly selected antenna pair could distort the small phase changes caused by hand movements.To preserve the impact of hand movements,we observe that the phase changes caused by the hand movement on different subcarriers are different as shown in Section 5.5.Consider the two subcarriers in Figure 3.Although the magnitudes of the dynamic components are similar for the two subcarriers,the phase change 02 in subcarrier 2 is much smaller because the magnitude of static component for subcarrier 2 is much larger than that for subcarrier 1.In real CSI measurements,we observe that there are subcarriers where the magnitude of static components is more than ten times higher than that of the dynamic component as shown in Section 5.5.In such cases,the phase change caused by hand movements(e.g., 02 in subcarrier 2)in these subcarriers is smaller than 0.1 rad,which is an ignorable offset in other subcarriers (e.g.in subcarrier 1).Therefore,we can pick the CSI phase in subcarrier 0 of one antenna pair that has the largest magnitude of static components to serve as CFO reference.Based on these observations,we remove the CFO offset as follows.We first estimate the magnitude of the static component by taking long-term average on the CSI magnitude of each antenna pair.We then select the antenna pair with the largest CSI magnitude as the reference.Since the CSI is not measured on subcarrier 0,we interpolate the phase of subcarrier-1 and 1 to get CSI phase of subcarrier 0 of the selected antenna pair,which serves as CFO reference.We then subtract the calculated CFO in the phase of all subcarriers of other antenna pairs. After removing the CFO,we correct the SFO/PBD offset,-2mko,for the remaining subcarriers based on a standard algorithm [17].Note that the slope o is different for every WiFi frame.Therefore,we perform a linear regression on the 30 subcarriers of each antenna pair to estimate the slope We then remove the SFO/PBD for each subcarrier using the estimated Figure 4 shows the CSI phase for one antenna pair before and after the phase correction.We observe the raw CSI phase changes significantly over a short duration of 1 ms as shown in Figure 4(a).The phase of the same subcarrier can differ by an amount of and the slope of is also different at different time instances.The corrected phase in Figure 4(b)is more consistent over time.Furthermore,we can observe the small phase changes over different subcarriers after phase correction. 2.Magnitude Correction:After phase correction,we reduce the magnitude noise using oversampling.We measure the CSI value at a high sampling rate of 2,500 samples per second.Note that normal human movements introduce CSI magnitude variations with frequencies in the range of 1~100 Hz [29].Therefore,we can use a low Proceedings of the ACM on Human-Computer Interaction,Vol.1,No.4,Article 39.Publication date:March 2018.39:8 • N. Yu et al. -30 -20 -10 0 10 20 30 OFDM Subcarriers -25 -20 -15 -10 -5 0 Raw CSI Phase (Radian) t = 0 ms t = 1 ms t = 2 ms (a) Raw CSI phase. -30 -20 -10 0 10 20 30 OFDM Subcarriers -0.6 -0.4 -0.2 0 0.2 0.4 0.6 Corrected Phase (Radian) t = 0 ms t = 1 ms t = 2 ms (b) Denoised CSI phase. Fig. 4. The effect of phase correction on frames at different time instances. We first remove the highly dynamical phase offset introduced by CFO. To estimate the value of CFO, we first observe that the phase of CSI measurements is mainly determined by three factors: CFO, SFO/PBD, and hand movements. As shown in [27], the phase offset of SFO and PBD is zero on the subcarrier with an index of k = 0. Therefore, the phase of subcarrier 0 for each antenna pair only contains the phase of CFO and the impact of hand movements. However, removing the phase of a randomly selected antenna pair could distort the small phase changes caused by hand movements. To preserve the impact of hand movements, we observe that the phase changes caused by the hand movement on different subcarriers are different as shown in Section 5.5. Consider the two subcarriers in Figure 3. Although the magnitudes of the dynamic components are similar for the two subcarriers, the phase change θ2 in subcarrier 2 is much smaller because the magnitude of static component for subcarrier 2 is much larger than that for subcarrier 1. In real CSI measurements, we observe that there are subcarriers where the magnitude of static components is more than ten times higher than that of the dynamic component as shown in Section 5.5. In such cases, the phase change caused by hand movements (e.g., θ2 in subcarrier 2) in these subcarriers is smaller than 0.1 rad, which is an ignorable offset in other subcarriers (e.g., θ1 in subcarrier 1). Therefore, we can pick the CSI phase in subcarrier 0 of one antenna pair that has the largest magnitude of static components to serve as CFO reference. Based on these observations, we remove the CFO offset as follows. We first estimate the magnitude of the static component by taking long-term average on the CSI magnitude of each antenna pair. We then select the antenna pair with the largest CSI magnitude as the reference. Since the CSI is not measured on subcarrier 0, we interpolate the phase of subcarrier -1 and 1 to get CSI phase of subcarrier 0 of the selected antenna pair, which serves as CFO reference. We then subtract the calculated CFO in the phase of all subcarriers of other antenna pairs. After removing the CFO, we correct the SFO/PBD offset, −2πkϕ, for the remaining subcarriers based on a standard algorithm [17]. Note that the slope ϕ is different for every WiFi frame. Therefore, we perform a linear regression on the 30 subcarriers of each antenna pair to estimate the slope ϕ. We then remove the SFO/PBD for each subcarrier using the estimated ϕ. Figure 4 shows the CSI phase for one antenna pair before and after the phase correction. We observe the raw CSI phase changes significantly over a short duration of 1 ms as shown in Figure 4(a). The phase of the same subcarrier can differ by an amount of π and the slope of ϕ is also different at different time instances. The corrected phase in Figure 4(b) is more consistent over time. Furthermore, we can observe the small phase changes over different subcarriers after phase correction. 2. Magnitude Correction: After phase correction, we reduce the magnitude noise using oversampling. We measure the CSI value at a high sampling rate of 2,500 samples per second. Note that normal human movements introduce CSI magnitude variations with frequencies in the range of 1∼100 Hz [29]. Therefore, we can use a low Proceedings of the ACM on Human-Computer Interaction, Vol. 1, No. 4, Article 39. Publication date: March 2018