# Wi-Senser: Contactless Head Movement Detection during Sleep Utilizing WiFi Signals
## 3 System Design
### Carrier Selection  
Due to different center frequencies/wavelengths of different subcarriers, the sensitivity of CSI amplitude fluctuations of different subcarriers to human head motion changes varies. Specifically, Figure 7b shows the CSI amplitude changes of each subcarrier with human head motion after data processing. It can be observed that human head motion has a smaller impact on the CSI amplitude changes of subcarriers with lower carrier numbers (i.e., subcarriers 1-10), indicating that these subcarriers are less sensitive to human head motion changes. However, human head motion has a greater impact on the CSI amplitude changes of subcarriers with higher carrier numbers (i.e., subcarriers 15-30), indicating that these subcarriers are more sensitive to human head motion changes. Therefore, before performing human head motion detection, Wi-Senser needs to select the optimal subcarrier with the highest sensitivity to human head motion changes from the CSI subcarriers after data processing. To achieve this goal, Wi-Senser first defines a sensitivity metric to quantify the sensitivity of CSI amplitude changes of different subcarriers to human head motion changes. Specifically, given any processed CSI amplitude sequence \(C^{i}=\left\{c_{1}^{i},\ldots,c_{n}^{i}\right\}\), where \(i\) is the ordinal of subcarrier and \(n\) is the sample length, the sensitivity of \(C^{i}\) to human motion can be calculated as:  
\[Q_{(1,n)}^{i}=(1-\theta)\times sd^{i}+\theta\times kt^{i} \tag{12}\]  
\[sd^{i}=\sqrt{\frac{\sum_{j=1}^{n}\left(c_{j}^{i}-\frac{c}{c}\right)^{2}}{n}} \tag{13}\]  
\[kt^{i}=\frac{\frac{1}{n}\sum_{j=1}^{n}\left(c_{j}^{i}-\frac{c}{c}\right)^{4}}{ \left(\frac{1}{n}\sum_{j=1}^{n}\left(c_{j}^{i}-\frac{c}{c}\right)^{2}\right)^{ 2}}-3 \tag{14}\]  
where \(sd^{i}\) and \(kt^{i}\) are the standard deviation and kurtosis of \(C^{i}\), respectively, and \(\theta\in[0,1]\) is a weighting factor. This is unlike reference [24], which only utilizes the variance of the CSI amplitude sequence to quantify the sensitivity of different subcarriers to human motion. However, both human movement and non-motion interference can cause large changes in the variance of CSI amplitude, and it is difficult for variance measurement to effectively identify whether the fluctuation of CSI amplitude (that is, large variance value) in a certain period of time is caused by human motion or by non-motion interference. Therefore, as shown in Equation (12), Wi-Senser introduces a joint sensitivity metric of the standard deviation and kurtosis of the CSI amplitude sequence for the first time. The reason for introducing this joint metric is twofold: first, the kurtosis metric can measure the sharpness of CSI amplitude fluctuations, and since the CSI amplitude fluctuations caused  
Figure 7: CSI amplitude changes under human head motion. (**a**) Original CSI amplitude changes; (**b**) CSI amplitude changes after data processing. by human motion are sharper, this metric can better capture the CSI amplitude fluctuations that reflect human motion changes; second, compared with variance metrics, standard deviation metrics are more robust to CSI amplitude fluctuations. Figure 8 shows the sensitivity calculation results of different subcarriers under different sensitivity metrics. It can be observed that the optimal subcarrier selected by the traditional method (i.e., variance metric) is subcarrier 28, while the optimal subcarrier selected by Wi-Senser (i.e., joint metric) is subcarrier 17. Figure 9 further shows the optimal subcarrier selected under different sensitivity metrics (i.e., subcarrier 28 and subcarrier 17). It can be clearly observed that, as shown in Figure 9a, although subcarrier 28 can fully record human head motion changes (i.e., the green triangle in the figure), it also introduces more spike signals unrelated to human head motion (i.e., the red triangle in the figure), which may lead to false detection.