Kalman filter, Gaussian filter, simple average for CSI data preprocessing

Table of contents

I. Introduction

2. Data collection

3. Kalman filter algorithm

1. What is the Kalman algorithm

2. The general realization process of Kalman

3. The core calculation formula of the Kalman filter algorithm

4. Data processing 

Fourth, Gaussian filtering 

5. Simple average


I. Introduction

Since the WiFi signal strength is affected by multipath effects and noise, it will lead to problems such as low positioning accuracy and unstable performance. Compared with RSSI, channel status information (CSI) can effectively avoid the adverse effects of multipath effects on positioning results. Therefore, the value of CSI is used as the characteristic value of positioning to establish the location fingerprint database of Radio Map. The position of the point to be measured can be estimated by matching k groups of nearest fingerprint database data through weighted proximity algorithm.

b7742026b51b438fbdaa3560f83c9923.png

2. Data collection

Without going into too much explanation at this stage, how to collect and read the collected csi data is also a difficult point. The indoor positioning method based on channel status information (CSI) uses Orthogonal Frequency Division Multiplexing (OFDM) technology to divide the communication channel into multiple independent sub-channels with different frequencies. The physical layer of each subchannel collects CSI values ​​as fingerprint measurements. This article uses a desktop computer equipped with an Intel5300NIC network card to conduct experiments, setting several sample points, each sample point collects several data packets, and each data packet has 2*3*30 pieces of data (2 sending antennas, 3 receiving antennas ).

3. Kalman filter algorithm

1. What is the Kalman algorithm

Kalman filtering is an algorithm that uses the linear system state equation to optimally estimate the system state through the input and output observation data of the system. Since the observation data includes the influence of noise and interference in the system, the optimal estimation can also be regarded as a filtering process. The Kalman filter algorithm makes a correction between the estimated and observed values.

2. The general realization process of Kalman

Kalman's implementation process: use the last optimal result to predict the current value, and use the observed value to correct the current value to obtain the optimal result.

3. The core calculation formula of the Kalman filter algorithm

This article is based on the following formula, using MATLAB for data processing

9994a4e1a5fc42169f2a0d3d9565db08.png

4. Data processing 

The CSI data collected at each point has 2*3*30*1500 amplitude information. We use the 1500 single-dimensional amplitude values ​​of the first transmitting antenna and the first receiving antenna to perform Kalman filtering. The MATLAB code is as follows:

close all
clc
r1=xlsread('1.xlsx',1,'A1:A1500' ); %读取采集的csi值
csi_length = length(r1);%获取数据的长度
Z=r1; %获取观测量 
A=1; %状态转移矩阵
X(1)=15; %目标状态向量
H=1; %观测矩阵
P(1)=100;   %第一步预测的状态协方差矩阵
R=10e-4; %观测噪声方差
Q=10e-4; %噪声协方差
%有些变量会随迭代次数发生改变,所以给这些变量预先分配内存
X_=zeros(1,csi_length);
P_=zeros(1,csi_length);
K=zeros(1,csi_length);
 for t=2:csi_length
   %预测
    X_(t)=A*X(t-1);   %状态方程
    P_(t)=A*P(t-1)*A'+Q; %预测的协方差
    %更新校准
    K(t)=P_(t)*H'/(H*P_(t)*H'+R); %卡尔曼增益
    X(t)=X_(t)+K(t)*(Z(t)-H*X_(t)); %状态更新方程
    P(t)=(1-K(t)*H)*P_(t); %协方差更新方程
end
%绘图
x1=1:csi_length;
hold on
plot(x1,Z,'b-',x1,X,'r-');    % 红色线最优化估算结果滤波后的值,%蓝色线表示观测值
legend('观测值','滤波后的值','Location','northwest');
xlabel('子载波(f)');ylabel('幅值(dB)');
title('卡尔曼滤波');
set(gca,'Ylim',[5,25]);
hold off

The effect of single-dimensional Kalman filtering is as follows: 

c4164fb050114a298085d611387ba3c7.png

Fourth, Gaussian filtering 

Gaussian filtering is a linear smoothing filter, which is suitable for eliminating Gaussian noise. We can use Gaussian low-pass filtering algorithm to process high-frequency noise. The effect of Gaussian filtering is shown in the figure below: 

5. Simple average

We know that the FIFS system simply averages the amplitudes measured on multiple antennas to obtain fingerprints, so we can also use this method for data preprocessing.

Creation is not easy, respect for originality, because there are direct plagiarism by bloggers, so many articles have been deleted, I hope everyone understands. If you are interested in indoor CSI fingerprint positioning, you can read the following article: csi fingerprint positioning for indoor positioning The WLAN protocol applies technologies such as multiple-input multiple-output (MI-MO) and orthogonal frequency division multiplexing (Orthogonal Frequency Division Multiplexing, OFDM), so that the channel characteristics between WiFi transceiver devices can be The physical layer estimates and stores them in the form of channel status information (CSI). . ... https://blog.csdn.net/qq_53860947/article/details/126180830

CSI fingerprint preprocessing (median, mean, Hampel, wavelet filter ) It is necessary to perform outlier processing on the data to ensure the stability of the data, and at the same time reduce the impact of human activities and sudden interference in the environment on CSI. The following will briefly discuss the processing of CSI amplitude data by several filters that come with MATLAB , some upgraded filtering procedures are left to your own thinking. https://blog.csdn.net/qq_53860947/article/details/130467451
CSI indoor fingerprint positioning - CSI data description_csi data set_Digital production Xiaoheiwa's blog-CSDN blog We modify the device driver of the NIC, To read the CSI value recorded in the hardware in the form of CSI when each data packet is received, and generate a dat file containing CSI information. , that is, the corresponding amplitude and phase. Of course, the phase obtained by the angle function is a phase with errors, and unwinding + linear transformation is required to obtain the real phase. The value of csi is a complex matrix of n*m*30, n represents the number of transmitting antennas, m represents the number of receiving antennas, and 30 is the number of subcarriers. 2. Use MATLAB to parse the dat file and display 1615*1 cell arrays. These cell arrays contain 1615 1*1 structures. Each structure represents all the information of a data packet, including the channel state information element. https://blog.csdn.net/qq_53860947/article/details/126449801

CSI Indoor Fingerprint Positioning——Explanation of Related Communication Terms Each subchannel uses independent subcarriers, and these subcarriers are mutually orthogonal. To put it simply, it is to send an impulse signal at the sending end and respond at the receiving end. Due to multipath delay extension and Doppler shift, different receiving ends will have different channel impulse responses, and different locations will also have different path causes different channel impulse responses). In layman's terms, it is the transmission speed of data, for example: 100M broadband, the bandwidth is 100Mbps, 1 byte (byte) corresponds to 8 bits (bit), so 100M broadband is equivalent to 12.5MB/s network. https://blog.csdn.net/qq_53860947/article/details/127716277

Guess you like

Origin blog.csdn.net/qq_53860947/article/details/126175335