Research Article

Device-Free Human Activity Recognition Based on Dual-Channel Transformer Using WiFi Signals

Algorithm 1

The pseudocode of preprocessing module.
Input: The raw CSI data .
   The element in represents the CSI data of subcarrier that received by spatial stream.
Output: Temporal features , frequency features .
 1: Extracting the moving average of CSI amplitude. , where is the length of sliding window.
 2: Utilizing a six-order Butterworth low-pass filter along the second dimension of to remove high-frequency noise.
 3: Calculating the activity indicator for based on Equation (5) and finding the peak index of activity indicator .
 4: Extracting the CSI segment from , in which and represents the length of CSI segment.
 5: Taking as the output of temporal CSI features .
 6: Doing PCA for .
 7: Calculating the Doppler spectrum of based on STFT, in which and represents the number of FFT points in STFT.
 8: Discarding the frequency bins above 30 Hz in . Then obtaining the output of frequency features , where is the number of frequency bins below 30 Hz.
 9: return and