## 4 Experimental Design
### Data Pre-Processing  
Antenna pair selection. The dataset used in this study was retrieved from one antenna transmitting wireless signals and three receiving signal antennas. Due to the changes in CSI frequency, the internal environment of the device, and the impact of antenna location; the varied antenna signal sensitivity to the environment can cause each receiving antenna to perform differently in gaining the best antenna data. Thus, the \(S/N\) was deployed in this study. Signal-to-noise ratio (\(S/N\)) refers to the ratio of signal-to-noise in electronic devices to measure the parameter of audio imbalance in players. Hence, the \(S/N\) was used as a parameter indicator to measure different antenna signals. As displayed in Figure 2, the \(S/N\) was obtained by processing raw data, whereby the \(S/N\) of antenna 2 was higher than the \(S/N\) of the other two antennas. Thus, data from antenna 2 were selected for the next processing. Interpolation. In wireless signal transmission, there are issues related to non-line-of-sight connections indoors and missing packets after the signal is received by the receiver upon going through the wall. To reduce the signal interference issue caused by the above reasons and to obtain CSI data with the same packet length, linear interpolation algorithm  
Figure 1: Overview of the Wi-NN system. Figure 2: Signal-to-noise ratio of different antennas. was used. Linear interpolation refers to a method that is used to connect the line segments of two known quantities in determining the unknown quantity between the known quantities. The original CSI data served as the input variable, while the interpolated mean value was determined by two known points without affecting the fluctuation of sub-data. Figure 3 present the comparison graphs before and after processing. Outlier removal. After interpolation, the data obtained seemed to possess a uniform packet length that greatly facilitated in the subsequent processing. However, due to the signal in the transmission process, the reflection of the internal electronics of the device, and the mutual interference between the receiving antennas; some data points with errors were visible to the naked eye. For such interference, the Hampel algorithm was used to remove outliers. For each subcarrier of the input, this study attained the effect of removing outliers by selecting three sample points before and after a sample point, and replacing the sample with the median value if the value of that sample exceeds the median deviation, as shown below. For sample data \(x\), taking the data on each side of the data with a sliding window length of 2, the median value within the window can be expressed as follows:  
\[\overline{x}=median\ (x_{i-L},x_{i-L+1,\ldots},x_{i}\ldots,x_{i+L-1},x_{i}) \tag{3}\]  
The scale of the median absolute deviation is estimated as given below:  
\[y_{i}=1.4826\times median\ (|x_{i-L}-\overline{x}_{i}|,\ldots,|x_{i+L}-\overline{x}_{ i}|) \tag{4}\]  
The inserted data are expressed as follows:  
\[\delta=\left\{ \begin{array}{ll}x_{i},&\quad\quad\left|\begin{array}{ll}x_{ i}-\overline{x}_{i}\ |\leq 3y_{i}\\ x_{i}-\overline{x}_{i}\ |>3y_{i}\end{array}\right.\end{array} \right. \tag{5}\]  
From Equation (5), it can be concluded that if the value in the window exceeds thrice the absolute deviation from the median, it is considered as an outlier and replaced by the median of the window. If it is less than thrice the absolute deviation from the median, it is not considered as an error point at time. Figure 4 displays the results after processing with Hampel algorithm, in which some noise points were removed. Filtering and denoising. After outlier removal, due to multipath, other objects interference resulted in noise in the CSI time series, which contained a huge amount of high frequency noise. In order to extract the best gesture characteristics, the data were denoised. To enable real-time recognition and classification of the experimenter's gestures, good time complexity of the denoising algorithm was required.