CSI 名为,channel state information, 一种表达信号传递路径特性的数据,可以使用CSI_tool搜集,而使用TRRS可以用于检测位置
具体环境搭配,数据搜集参考以下方式:http://dhalperi.github.io/linux-80211n-csitool/installation.html
这里记录一个计算两个CSI数据的TRRS的方法,具体算法详细可见论文
Wu Z H, Han Y, Chen Y, et al. A time-reversal paradigm for indoor positioning system[J]. IEEE Transactions on Vehicular Technology, 2015, 64(4): 1331-1339.
给出MATLAB的参考代码:
function n=TR_resonating_strength(h1,h2,x)
% this function is used to compute the TRRS
% h1 and h2 are n*1 vector
% in CSI_tool n=30 for there are 30 carriers
% x usually is 1
h2_conj=conj(h2);
a=length(h2);
g2=zeros(a,1);
sum_h1=0;
sum_g2=0;
for i=1:a
g2(i)=h2_conj(31-i);
end
sum_h1=dot(h1,h1);
sum_g2=dot(g2,g2);
numerator=abs(max(conv(h1,g2)));
numerator=numerator^2;
n=numerator/(sum_h1*sum_g2);
n=(sqrt(n))^x*100;