用python实现CSI幅值和相位信息的可视化
数据集
主程序
import matplotlib.pyplot as plt
from gezhongmatlab import *
from matplotlib import font_manager
#设置使用的字体,此处使用的是微软雅黑
my_font = font_manager.FontProperties(fname='C:\Windows\Fonts\MSYH.TTC')
path = r"run_lh_1.dat"
bf = read_bf_file(path)
csi_list = list(map(get_scale_csi,bf))
csi_np = (np.array(csi_list))
csi_amp = np.abs(csi_np)
csi_pha=np.angle(csi_np)
np.set_printoptions(threshold=np.inf)
fig = plt.figure()
plt.subplot(1,2,1)
plt.plot(csi_amp[:, 0, 0, 0])
plt.title('幅值提取',fontproperties = my_font)
plt.xlabel('subcarrier')
plt.ylabel('幅值',fontproperties = my_font)
plt.subplot(1,2,2)
plt.plot(csi_pha[100,0,0,:])
plt.title('相位提取',fontproperties = my_font)
plt.xlabel('subcarrier')
plt.ylabel('相位',fontproperties = my_font)
plt.show()
这里需要参考我的另一篇文章
用python提取CSI幅值信息
运行截图: