accuracy of 92%[32].WiFall used anomaly detection al- there is no moving object around,the magnitude of CSI re- gorithm on CSI values to detect falling [12].PinLoc gathered mains relatively constant.However,a moving human can location dependent CSI value distributions to localize a tar- significantly distort the CSI magnitude because human bodies get with accuracy of several centimeters [23].MRW used are good reflectors of wireless signals.When a human moves. CSI or Received Signal Strength (RSS)values to monitor the wireless signal reflected by his body will go through a dif- the presence of human movement behind a concrete wall [4] ferent path with different length,as illustrated in Figure 1(a). CARM used CSI-speed model to extract human movement speeds from CSI signal [31].However,these speed features Governed by the principle of superposition of waves,signal are still not accurate enough for gait pattern recognition.In reflected by human may add constructively or destructively comparison,we perform time-frequency analysis on CSI val- with WiFi signals traveled through other paths,e.g.,the Line- ues to obtain spectrograms,and then to measure human walk- Of-Sight (LOS)path.Whether these WiFi signals are added ing metrics,such as gait cycle time,torso and leg speed,and constructively or destructively is determined by the relative footstep length from the spectrograms.Note that there are phase differences between these signals [26].The phase of schemes that use special hardware(such as USRP [20]and the signal changes by 2 when the length change of the sig- directional antennas [13,30])to get fine-grained measure- nal path is equal to the signal wavelength.Whenever the hu- ments from WiFi signals:in comparison,we only use COTS man moves by half of the wavelength,the path length of the WiFi devices. human reflected signal will change by the amount of the sig- nal wavelength.Consequently,we will observe a full cycle of In recent work parallel with ours,Zeng et al.built a system magnitude changes in CSI values according to the principle called WiWho that also uses WiFi CSI signals to recognize of superposition of waves.The factor of 2 in the path length human gaits [34].In WiWho,the human subject was asked to change is due to the round trip path travelled by the reflected walk on a path with a distance of I meter parallel to the Line- WiFi signal.The signal wavelength A for 5 GHz WiFi signal Of-Sight (LOS)path between the WiFi sender and receiver. band is 5.15~5.79 cm.This implies that we can detect small The recognition accuracy of WiWho is 92%to 80%for 2 to 6 movements of a few centimeters by observing the magnitude human subjects.Compared to WiWho,WifiU uses advanced changes of CSI values.For a walking human who moves at signal processing algorithms to extract CSI variations so that the speed of 1 meter per second,we observe 34~38 cycles of it can recognize gaits at a distance of more than 6 meters to magnitude fluctuations in CSI values,given the wavelength of the LOS path.Moreover,WifiU extracts more elaborated gait 5.15~5.79 cm,as each cycle represents the person moves by features from CSI signals the distance of half-wavelength.This provides a very detailed WIFI SIGNAL PROCESSING measurement of the human walking speed. In this section,we first collect CSI measurements from WiFi However,the CSI measurements obtained from commercial signals using COTS WiFi devices.Second,we use the Prin- WiFi cards contain noises from various sources such as in- cipal Component Analysis (PCA)technique to extract the terference coming from nearby devices,transmission power principal components from the correlated CSI measurements adaptation at the sender,and imperfect clock synchronization so that the uncorrelated noises in different subcarriers are re- [101.Figure 2(a)shows the magnitude of a raw CSI stream duced.Third,we use Short Time Fourier Transform(STFT) (Stream A)captured while a human is walking around.Al- to convert PCA components into spectrograms. Fourth though we can observe the fluctuations in CSI values caused we apply frequency domain denoising algorithms(such as by the moving human subject,these fluctuations are irregu- noise floor subtraction,spectrogram superimposition,and 2- lar due to environmental noises.Thus,we must denoise CSI dimensional filtering)to further enhance the spectrogram. measurements before we extract human gait information. CSI Data Collection WifiU collects CSI measurements on the receiving end of a Existing CSI denoising schemes,such as low-pass filters [30] WiFi link between two WiFi devices.For each pair of a send- do not work well for our purpose because CSI streams con- ing antenna and a receiving antenna,we obtain CSI values tain high-level impulse and burst noises.Figure 2(a)shows an from 30 OFDM subcarriers used by 802.11n [14].Thus,we example CSI stream with impulse noises at the time of 10.55 get 2 x 3 x 30=180 CSI values for each received 802.11n seconds as pointed by an arrow.Figure 2(b)shows the low- frame when the sender has 2 antennas and the receiver has pass filtering result of CSI Stream A after passing through 3 antennas.The sequence of CSI values for each subcar- a Butterworth filter with a cutoff frequency at 150 Hz.We rier for a given pair of sending/receiving antenna is called can still observe small residual fluctuations,as pointed by a CSI stream.As our system sends 2.500 WiFi frames per an arrow,after low-pass filtering,due to the wide bandwidth second,we collected 2,500 CSI values for each of the 180 of impulse noises.Figure 2(b)plots another CSI Stream B. CSI streams in one second.We removed the impact of Car- which is measured on the same sender/receiver antenna pair rier Frequency Offset(CFO)by using only the amplitude of but with a subcarrier frequency about 10 MHz higher than the CSI values while ignoring the CSI phase,as described in that of CSI Stream A.Zooming into the waveform segments our earlier work [31. separated by the four vertical reference lines,we observe that the "valleys"for Stream B always appear earlier than that of Denoising CSI Measurements Stream A.This indicates that variations in CSI streams have The CSI values describe how the phase and magnitude of the different phases.Different CSI streams often have differ- wireless signal change when the signal travels from the send- ent phases because they differ in their subcarrier frequency ing antenna to the receiving antenna over a subcarrier.Whenaccuracy of 92% [32]. WiFall used anomaly detection algorithm on CSI values to detect falling [12]. PinLoc gathered location dependent CSI value distributions to localize a target with accuracy of several centimeters [23]. MRW used CSI or Received Signal Strength (RSS) values to monitor the presence of human movement behind a concrete wall [4]. CARM used CSI-speed model to extract human movement speeds from CSI signal [31]. However, these speed features are still not accurate enough for gait pattern recognition. In comparison, we perform time-frequency analysis on CSI values to obtain spectrograms, and then to measure human walking metrics, such as gait cycle time, torso and leg speed, and footstep length from the spectrograms. Note that there are schemes that use special hardware (such as USRP [20] and directional antennas [13, 30]) to get fine-grained measurements from WiFi signals; in comparison, we only use COTS WiFi devices. In recent work parallel with ours, Zeng et al. built a system called WiWho that also uses WiFi CSI signals to recognize human gaits [34]. In WiWho, the human subject was asked to walk on a path with a distance of 1 meter parallel to the LineOf-Sight (LOS) path between the WiFi sender and receiver. The recognition accuracy of WiWho is 92% to 80% for 2 to 6 human subjects. Compared to WiWho, WifiU uses advanced signal processing algorithms to extract CSI variations so that it can recognize gaits at a distance of more than 6 meters to the LOS path. Moreover, WifiU extracts more elaborated gait features from CSI signals. WIFI SIGNAL PROCESSING In this section, we first collect CSI measurements from WiFi signals using COTS WiFi devices. Second, we use the Principal Component Analysis (PCA) technique to extract the principal components from the correlated CSI measurements so that the uncorrelated noises in different subcarriers are reduced. Third, we use Short Time Fourier Transform (STFT) to convert PCA components into spectrograms. Fourth, we apply frequency domain denoising algorithms (such as noise floor subtraction, spectrogram superimposition, and 2- dimensional filtering) to further enhance the spectrogram. CSI Data Collection WifiU collects CSI measurements on the receiving end of a WiFi link between two WiFi devices. For each pair of a sending antenna and a receiving antenna, we obtain CSI values from 30 OFDM subcarriers used by 802.11n [14]. Thus, we get 2 × 3 × 30 = 180 CSI values for each received 802.11n frame when the sender has 2 antennas and the receiver has 3 antennas. The sequence of CSI values for each subcarrier for a given pair of sending/receiving antenna is called a CSI stream. As our system sends 2,500 WiFi frames per second, we collected 2,500 CSI values for each of the 180 CSI streams in one second. We removed the impact of Carrier Frequency Offset (CFO) by using only the amplitude of the CSI values while ignoring the CSI phase, as described in our earlier work [31]. Denoising CSI Measurements The CSI values describe how the phase and magnitude of the wireless signal change when the signal travels from the sending antenna to the receiving antenna over a subcarrier. When there is no moving object around, the magnitude of CSI remains relatively constant. However, a moving human can significantly distort the CSI magnitude because human bodies are good reflectors of wireless signals. When a human moves, the wireless signal reflected by his body will go through a different path with different length, as illustrated in Figure 1(a). Governed by the principle of superposition of waves, signal reflected by human may add constructively or destructively with WiFi signals traveled through other paths, e.g., the LineOf-Sight (LOS) path. Whether these WiFi signals are added constructively or destructively is determined by the relative phase differences between these signals [26]. The phase of the signal changes by 2π when the length change of the signal path is equal to the signal wavelength. Whenever the human moves by half of the wavelength, the path length of the human reflected signal will change by the amount of the signal wavelength. Consequently, we will observe a full cycle of magnitude changes in CSI values according to the principle of superposition of waves. The factor of 2 in the path length change is due to the round trip path travelled by the reflected WiFi signal. The signal wavelength λ for 5 GHz WiFi signal band is 5.15∼5.79 cm. This implies that we can detect small movements of a few centimeters by observing the magnitude changes of CSI values. For a walking human who moves at the speed of 1 meter per second, we observe 34∼38 cycles of magnitude fluctuations in CSI values, given the wavelength of 5.15∼5.79 cm, as each cycle represents the person moves by the distance of half-wavelength. This provides a very detailed measurement of the human walking speed. However, the CSI measurements obtained from commercial WiFi cards contain noises from various sources such as interference coming from nearby devices, transmission power adaptation at the sender, and imperfect clock synchronization [10]. Figure 2(a) shows the magnitude of a raw CSI stream (Stream A) captured while a human is walking around. Although we can observe the fluctuations in CSI values caused by the moving human subject, these fluctuations are irregular due to environmental noises. Thus, we must denoise CSI measurements before we extract human gait information. Existing CSI denoising schemes, such as low-pass filters [30], do not work well for our purpose because CSI streams contain high-level impulse and burst noises. Figure 2(a) shows an example CSI stream with impulse noises at the time of 10.55 seconds as pointed by an arrow. Figure 2(b) shows the lowpass filtering result of CSI Stream A after passing through a Butterworth filter with a cutoff frequency at 150 Hz. We can still observe small residual fluctuations, as pointed by an arrow, after low-pass filtering, due to the wide bandwidth of impulse noises. Figure 2(b) plots another CSI Stream B, which is measured on the same sender/receiver antenna pair but with a subcarrier frequency about 10 MHz higher than that of CSI Stream A. Zooming into the waveform segments separated by the four vertical reference lines, we observe that the “valleys” for Stream B always appear earlier than that of Stream A. This indicates that variations in CSI streams have different phases. Different CSI streams often have different phases because they differ in their subcarrier frequency