# TwSense: Highly Robust Through-the-Wall Human Detection Method Based on COTS Wi-Fi Device
## 3 Preliminaries  
### Through-the-Wall CSI Model  
CSI describes how a signal propagates from a transmitter to a receiver in wireless communications. At the same time, CSI is affected by the physical environment (such as reflection, diffraction, and scattering). In a narrow-band flat fading channel with multiple transmit and receive antennas (MIMO), the channel can be modeled as follows:  
\[y=Hx+n \tag{1}\]  
where \(x\) is the transmitting vector; \(y\) is the receiving vector; \(H\) is the channel matrix; and \(n\) is the noise vector.  
Since commercial Wi-Fi devices use Orthogonal Frequency Division Multiplexing (OFDM) systems, CSI has physical layer information with fine-grained characteristics, describing the amplitude and phase information of each subcarrier to express channel characteristics. Specifically expressed as:  
\[H(f,t)=\sum_{i}^{N}\alpha_{i}(t)e^{-j2\pi f_{i}(t)} \tag{2}\]  
where \(\alpha_{i}\) is the amplitude attenuation of the \(i\)th path, \(N\) is the total number of propagation paths, \(\alpha_{i}(t)\) and \(\tau_{i}(t)\) are the complex attenuation factor and flight time of the \(i\)th path, respectively [16].  
When the Wi-Fi signal propagates through-the-wall, it will be affected by the complex structure of the indoor wall, the human body, the ceiling, the floor, the table and chairs, and other objects, resulting in the reflection, scattering, and refraction of the signal. As shown in Figure 2, according to the free space propagation model [17], the propagation model of the Wi-Fi signal in the above environmental influence is:  
\[P_{r}(d)=\frac{P_{t}G_{t}G_{r}\lambda^{2}}{\left(4\pi\right)^{2}d^{2}L} \tag{3}\]  
where \(P_{r}(d)\) is the receiving power, \(G_{r}\) is the receiving antenna gain, \(G_{t}\) is the transmitting antenna gain, \(P_{t}\) is the transmitting power, \(\lambda\) is the wavelength, and \(d\) is the distance from the transmitting end to the receiving end. In a typical indoor environment, considering a series of signals passing through-the-wall and people's motion, the model can be expressed as:  
\[\omega=\frac{\rho\cdot s}{6} \tag{4}\]  
\[P_{r}(d)=\frac{P_{t}G_{t}G_{r}\lambda^{2}}{\left(4\pi\right)^{2}(d^{2}+4d_{r} ^{2}+\eta^{2})L}-L\omega \tag{5}\]  
where \(d_{r}\) is the distance from the reflection point to the direct path, \(\eta\) is the change in path length caused by human motion, \(L\) is the system loss factor, \(\omega\) is the influence of the wall material on the signal, \(\rho\) is the density of the wall, \(s\) is the surface area of the wall, and \(L\omega\) is related to the material of the wall. The thicker the thickness of the wall material and the more complex the structure, the higher the value \(L\omega\), and the greater the attenuation of the signal. For example, if the wall is 15 inches wide concrete, \(L\omega\) = 15 dB, and if the wall is 1.18 feet glass, \(L\omega\) = 3 dB because the glass material is simpler in structure than the concrete wall. The lower the value in Equation (4), the less the glass material affects the signal, and the less signal attenuation will occur. Thus, the received power of \(P_{r}(d)\) will become larger, and the obtained CSI signal characteristics will be more obvious.