# A Novel Device-Free Counting Method Based on Channel Status Information
## 3 Crowd Counting Based on CSI
### Data Preprocessing  
Although standard wireless network cards provide RSSI information, the RSSI is only a rough estimate of the wireless channel, and it does not involve a specific number of antennas and subcarriers. Nowadays, some common IEEE 802.11n standard commercial wireless network cards have begun to emerge, which could provide detailed amplitude and phase information on different subcarriers in the form of CSI. The CSI is a type of physical layer information on the subcarrier scale, referring to the channel characteristics of a communication link. This type of information describes how the signal passes through the air from transmitter to receiver, and reflects the fading factor of signal on each transmission path, environmental degradation, signal scattering, and power attenuation with distance, etc.  
In the narrow-band flat fading channel, the OFDM system in the frequency domain is modelled as  
\[y=Hx+N, \tag{1}\]  
where \(y\), \(x\), \(H\) and \(N\) are respectively denoted as the receive vector, the transmit vector, the channel matrix and the additive white Gaussian noise (AWGN) vector.  
Next, the CSI message, which represents the channel response of multiple subcarriers, is divided into 30 groups. Hence, the CSI value with \(N=30\) groups collected at the receive that can be represented as  
\[\begin{split} H(f_{i})&=\|H(f_{i})\|e^{isint\{ \angle H(f_{i})\}},\\ i&\in[1,30],\end{split} \tag{2}\]  
where \(H(f_{i})\) is the CSI at the subcarrier with the carrier frequency \(f_{i}\), \(\angle H(f_{i})\) denotes its amplitude value and \(\|H(f_{i})\|\) denotes its phase value.  
Figure 1: System architecture.  
Environmental factors (such as temperature, lighting and room settings) might appear with outliers in the CSI measurements, and these outliers would affect the detection performance to some extent. Thus, the measurements of amplitude and phase of CSI will be the basic input for our method, which would be through a wavelet transform denoising process beforehand. The wavelet transform denoising removes the observation value with larger deviations and meanwhile restore original signals as much as possible.  
Given the original signal \(C_{\varphi}\), \(\varphi(t)\) constitutes the fundamental wavelet, i.e., if \(\varphi(t)\) meets Equation (3)  
\[C_{\varphi}=2\pi\int_{-\infty}^{+\infty}\frac{\varphi(w)^{2}}{|w|}dw<\infty, \tag{3}\]  
then the continuous wavelet transform \(f(t)\) can be written as  
\[\begin{split} W_{f}(a,b)&=\frac{1}{\sqrt{C_{ \varphi}}}-\frac{1}{\sqrt{|a|}}\int_{-\infty}^{+\infty}f(t)\overline{\varphi} (\frac{t-b}{a})dt,\\ a,b&\in R,a\
eq 0,\end{split} \tag{4}\]  
where \(\varphi\) denotes the conjugate of \(\varphi\), and \(R\) represents a real number set.  
The associated inverse transformation formula \(f(t)\) can be written as  
\[f(t)=\frac{1}{\sqrt{C_{\varphi}}}\int_{-\infty}^{+\infty}db\int_{-\infty}^{+ \infty}W_{f}(a,b)|a|^{-\frac{1}{2}}\varphi(\frac{t-b}{a})\frac{da}{a^{2}}. \tag{5}\]  
In the following, Figure 2 illustrates the original CSI amplitude and phase as well as the filtered signal, respectively. Among them, Symlet is a discrete wavelet function, which can reduce signal phase distortion to a certain extent. In this paper, the dataset is discrete and the data volume is relatively small. In addition, to ensure the integrity and readability of denoising CSI data, system wavelet is selected and wavelet scale is set to 2 in this work. From Figure 2, it is observed that the graph curve becomes smoother after the signal is filtered by the wavelet, and the frequent random fluctuations are filtered out. Thus, wavelet denoising can effectively filter out interference signals. It can be also revealed that the denoised signal retains the basic characteristics of the original one as well.