39:6·N.Yu et al Path A Path B th 4 Wall Fig.2.Scenarios with multiple paths where a is the ratio of the path length change to the movement distance.For example,we have a =2 for the scenario in Figure 2.Thus,we can measure the movement distance with an accuracy of a few centimeters Furthermore,we can determine the movement direction by looking at the sign of Ad. 3.2 Practical Issues We need to consider three practical issues before we can fit the above theoretical model into the real CSI measurements. Static Multipath between Transmitter and Receiver:In indoor environments,the wireless signal will be reflected by surrounding objects such as walls,furniture,or doors.In case that the reflectors are static,e.g,path A and C in Figure 2,we can treat the combination of these static paths as a single static component.Consider the case that there are n paths in total,where the nth path is the dynamic path and other paths are static paths. Eq.(1)can be rewritten as: Hf,)-∑a,e0+f,e n-1 (3) i=1 dynamic component static component Because the signal strength ai(f,t)and path length li(t)of static component are constant in Eq.(3),all static multipaths can be treated as a single path with the corresponding I/Q vector as the sum of vectors for all static paths. Dynamic Multipath through Moving Reflector:The signal reflected by the moving reflector could also travel through multiple paths,such as paths B and D in Figure 2.In this case,all these paths will have time- varying path lengths when the reflector moves.These time-varying paths will generate multiple time-varying components in the received signal strength.In practice,these components do not significantly affect the mea- surement accuracy,since the received reflecting signal strength is dominated by the direct reflection path,e.g, path B in Figure 2.Human hands have small areas and the signals reflected by hands are weaker than the signal traveled through the static multipaths.Therefore,if the signal is reflected for more than once,e.g.,by both the hand and wall as in path D,the signal strength will be further attenuated.These multipath components will be small compared to the direct reflection path so that we can ignore them.As we will show in our experiments,the measurement error of QGesture only slightly increases when there are strong dynamic multipaths,e.g.,when pushing close to a wall. Noises in CSI Measurements:Commercial CSI measurements contain various types of noises [29,34].The phase of CSI measurements is especially noisy due to the existence of Carrier Frequency Offset(CFO)and Sam- pling Frequency Offsets(SFO).The hand movement only changes the phase of the CSI by a small amount,e.g, in Figure 3.Therefore,without the accurate phase information,we can only gain a rough distance measurement Proceedings of the ACM on Human-Computer Interaction,Vol.1,No.4,Article 39.Publication date:March 2018
39:6 • N. Yu et al. Path A Path B Wall Path C Path D d Fig. 2. Scenarios with multiple paths. where a is the ratio of the path length change to the movement distance. For example, we have a = 2 for the scenario in Figure 2. Thus, we can measure the movement distance with an accuracy of a few centimeters. Furthermore, we can determine the movement direction by looking at the sign of ∆φ. 3.2 Practical Issues We need to consider three practical issues before we can fit the above theoretical model into the real CSI measurements. Static Multipath between Transmitter and Receiver: In indoor environments, the wireless signal will be reflected by surrounding objects such as walls, furniture, or doors. In case that the reflectors are static, e.g., path A and C in Figure 2, we can treat the combination of these static paths as a single static component. Consider the case that there are n paths in total, where the n th path is the dynamic path and other paths are static paths. Eq. (1) can be rewritten as: H(f ,t) = ∑n−1 i=1 ai (f ,t)e −j2πli (t ) λ | {z } static component +an (f ,t)e −j2πln (t ) λ | {z } dynamic component . (3) Because the signal strength ai (f ,t) and path length li (t) of static component are constant in Eq. (3), all static multipaths can be treated as a single path with the corresponding I/Q vector as the sum of vectors for all static paths. Dynamic Multipath through Moving Reflector: The signal reflected by the moving reflector could also travel through multiple paths, such as paths B and D in Figure 2. In this case, all these paths will have timevarying path lengths when the reflector moves. These time-varying paths will generate multiple time-varying components in the received signal strength. In practice, these components do not significantly affect the measurement accuracy, since the received reflecting signal strength is dominated by the direct reflection path, e.g., path B in Figure 2. Human hands have small areas and the signals reflected by hands are weaker than the signal traveled through the static multipaths. Therefore, if the signal is reflected for more than once, e.g., by both the hand and wall as in path D, the signal strength will be further attenuated. These multipath components will be small compared to the direct reflection path so that we can ignore them. As we will show in our experiments, the measurement error of QGesture only slightly increases when there are strong dynamic multipaths, e.g., when pushing close to a wall. Noises in CSI Measurements: Commercial CSI measurements contain various types of noises [29, 34]. The phase of CSI measurements is especially noisy due to the existence of Carrier Frequency Offset (CFO) and Sampling Frequency Offsets (SFO). The hand movement only changes the phase of the CSI by a small amount, e.g., θ1 in Figure 3. Therefore, without the accurate phase information, we can only gain a rough distance measurement Proceedings of the ACM on Human-Computer Interaction, Vol. 1, No. 4, Article 39. Publication date: March 2018
QGesture:Quantifying Gesture Distance and Direction with WiFi Signals.39:7 、CFO Subcarrier 1 Path B Subcarrier 2 Path A 8, Fig.3.I/Q Phasor Representation. using the CSI magnitude as in [29],where the movement direction information has been lost.Furthermore,the magnitude of CSI measurements are also noisy due to the measurement errors.So,we need to first remove the phase and magnitude noises in CSI measurements before applying our theoretical model. 3.3 CSI Noise Sources There are three types of noises in CSI measurements.The first two are phase noises and the last one is mag- nitude noise. Carrier Frequency Offset(CFO):Due to the small frequency differences in the carrier at the transmitter and receiver,the received CSIH'(f.t)contains an extra phase shift as H(ft)=eH(f.t).where f is the CFO between the sender and the receiver [27,29,34].As IEEE 802.11n standard allows the CFO between the transmitter and receiver to be as large as 100 kHz,the CFO introduces large phase uncertainties in CSI measurements.For example,when the CSI is measured at a rate of 4,000 frames per second,the phase change caused by CFO could be 50m between the two consecutive frames that are separated by a small time interval t of just 0.25 ms.Thus,the phase change caused by CFO is much larger than the phase changes caused by the movements,which changes by less than 1 radian during hand movements,as shown in Figure 3.Even a small measurement error in the time interval between consecutive frames will lead to a large phase offset,which makes the phase of CSI appear random. Sampling Frequency Offset(SFO)and Packet Boundary Detection(PBD)Error:These two error sources have similar effects which add another phase offset on the CSIas H"(f,t)=eH(f,t),where k is the index of OFDM subcarrier and o is the phase offset [34].Unlike the phase offset caused by CFO,which accumulates over time,the phase offsets of SFO and PBD have a linear relationship over different OFDM subcarriers.Moreover, the SFO/PBD offset has different slopes of on different frames. Magnitude Variations:Due to the variations in transmission power and environmental noises,the magni- tude of the CSI measurements also has large variations.These magnitude variations often have high energy impulses that could bury the small magnitude changes caused by hand movements[29]. 3.4 Denoising CSI Measurements We denoise CSI measurements using two steps: 1.Phase Correction:As discussed in Section 3.3,there are CFO,SFO and PBD phase offsets in CSI measure- ments.Fortunately,CSI values are simultaneously measured on 30 OFDM subcarriers for each antenna pair of the transmitter/receiver.For a transmitter with 2 antennas and a receiver with 3 antennas,we obtain 2x3x30 =180 CSI values for each WiFi frame.We can utilize the redundancy in CSI measurements to perform phase correction. Proceedings of the ACM on Human-Computer Interaction,Vol.1,No.4,Article 39.Publication date:March 2018
QGesture: Quantifying Gesture Distance and Direction with WiFi Signals • 39:7 I Q Subcarrier 1 Path B Path A Subcarrier 2 θ1 θ2 CFO Fig. 3. I/Q Phasor Representation. using the CSI magnitude as in [29], where the movement direction information has been lost. Furthermore, the magnitude of CSI measurements are also noisy due to the measurement errors. So, we need to first remove the phase and magnitude noises in CSI measurements before applying our theoretical model. 3.3 CSI Noise Sources There are three types of noises in CSI measurements. The first two are phase noises and the last one is magnitude noise. Carrier Frequency Offset (CFO):. Due to the small frequency differences in the carrier at the transmitter and receiver, the received CSI H ′ (f ,t) contains an extra phase shift as H ′ (f ,t) = e −j2π δ f tH(f ,t), where δ f is the CFO between the sender and the receiver [27, 29, 34]. As IEEE 802.11n standard allows the CFO between the transmitter and receiver to be as large as 100 kHz, the CFO introduces large phase uncertainties in CSI measurements. For example, when the CSI is measured at a rate of 4,000 frames per second, the phase change caused by CFO could be 50π between the two consecutive frames that are separated by a small time interval t of just 0.25 ms. Thus, the phase change caused by CFO is much larger than the phase changes caused by the movements, which changes by less than 1 radian during hand movements, as shown in Figure 3. Even a small measurement error in the time interval between consecutive frames will lead to a large phase offset, which makes the phase of CSI appear random. Sampling Frequency Offset (SFO) and Packet Boundary Detection (PBD) Error: These two error sources have similar effects which add another phase offset on the CSI asH ′′(f ,t) = e −j2πkϕH ′ (f ,t), where k is the index of OFDM subcarrier and ϕ is the phase offset [34]. Unlike the phase offset caused by CFO, which accumulates over time, the phase offsets of SFO and PBD have a linear relationship over different OFDM subcarriers. Moreover, the SFO/PBD offset has different slopes of ϕ on different frames. Magnitude Variations: Due to the variations in transmission power and environmental noises, the magnitude of the CSI measurements also has large variations. These magnitude variations often have high energy impulses that could bury the small magnitude changes caused by hand movements [29]. 3.4 Denoising CSI Measurements We denoise CSI measurements using two steps: 1. Phase Correction: As discussed in Section 3.3, there are CFO, SFO and PBD phase offsets in CSI measurements. Fortunately, CSI values are simultaneously measured on 30 OFDM subcarriers for each antenna pair of the transmitter/receiver. For a transmitter with 2 antennas and a receiver with 3 antennas, we obtain 2×3×30 = 180 CSI values for each WiFi frame. We can utilize the redundancy in CSI measurements to perform phase correction. Proceedings of the ACM on Human-Computer Interaction, Vol. 1, No. 4, Article 39. Publication date: March 2018
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