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