# Gait Recognition Algorithm of Coal Mine Personnel Based on LoRa
## 2 Materials and Methods  
### Wireless Sensing Model Based on LoRa  
LoRa is a physical-layer technology for long-range, low-power wireless communication. LoRa encodes the data as chirps whose frequencies vary linearly over time by the chirp spread spectrum (CSS) modulation technique [14]. The complex exponential representation of a linear frequency modulation (LFM) [15] chirp can be represented as:  
\[T_{x}(t)=e^{(j2\pi f_{c}t+j\pi kt^{2})}=\cos\Bigl{(}2\pi f_{c}t+\pi kt^{2} \Bigr{)}+j\cdot sin\Bigl{(}2\pi f_{c}t+\pi kt^{2}\Bigr{)}, \tag{1}\]  
where \(f_{c}\) is the central frequency, \(k=B/T\) is the sweep rate of the chirp, \(B\) is the bandwidth, and \(T\) is the sweep time. The in-phase (I) and quadrature (Q) components of the LFM chirp can be represented as:  
\[I(t)=\cos(\phi(t))=\cos\Bigl{(}2\pi f_{c}t+\pi kt^{2}\Bigr{)}, \tag{2}\]  
\[Q(t)=\sin(\phi(t))=\sin\Bigl{(}2\pi f_{c}t+\pi kt^{2}\Bigr{)}, \tag{3}\]  
where \(\phi(t)\) is the instantaneous phase. The instantaneous frequency is a linear function of time, which can be calculated as \(\frac{1}{2\pi}\frac{d(\phi(t))}{dt}=kt+f_{c}\). Figure 1 shows the frequency domain and time domain waveforms of an LFM signal. Through the time of one cycle (\(-T/2\leq t\leq T/2\)), the frequency varies linearly from \(f_{c}-B/2\) to \(f_{c}+B/2\). As shown in Figure 1b, the corresponding time domain signal is a cosine wave with increasing frequency over time. Due to the full utilization of the whole allocated bandwidth for encoding data, the chirp is more robust against channel noise and multipath and Doppler effects.  
Figure 1: Waveform of a chirp signal. (**a**) Frequency domain signal representation. (**b**) Time domain signal representation.  
As shown in Figure 2, the LoRa signal can be reflected by static objects (such as walls and rocks) and dynamic objects (such as human targets) in the propagation process from a transmitter node to a receiver gateway. Supposing that the signal reaches the receiver through \(N\) different paths, the received signal can be represented as:  
\[R_{x}(t)=e^{i(\pi kt^{2}+\theta_{c}+\theta_{s})}\sum_{n-1}^{N}a_{n}(t)e^{-\beta \pi f_{c}\tau_{n}(t)}, \tag{4}\]  
where \(\theta_{c}=2\pi\Delta ft\) (\(\Delta f=f_{c}-f_{c}^{{}^{\prime}}\)) is the carrier frequency offset (CFO) caused by unsynchronized clocks between the transmitter and receiver, \(\theta_{s}\) is the sampling frequency offset (SFO), \(a_{n}(t)\) is the composite representation of the attenuation factor and initial phase of the \(n^{th}\) path, and \(\tau_{n}(t)\) is the time delay of the \(n^{th}\) path.  
The \(N\) multipaths can be further divided into static and dynamic paths. The static paths include the direct and reflection paths of static objects such as the walls and ground. The dynamic paths include the reflection paths of the moving targets. The static and dynamic vectors in the I-Q vector space are shown in Figure 3. The signal vector length represents the amplitude, and the angle with the I-axis represents the phase. The sum of the static and dynamic vectors is the composite vector, which can be directly extracted from the receiver. When the target is moving, the static vector is unchanged because the static objects keep their original states. Meanwhile, the target movement causes a change in the dynamic path length, and the dynamic vector rotates around the static vector.  
Figure 3: Signal vector representation.  
Figure 2: Sensing scenario.