Skip to content

Herrtian/PicoscenesToolbox

Repository files navigation

PicoscenesToolbox

The official Python toolbox for parsing the PicoScenes .csi files.

Highlights

  • Support Linux, macOS and windows
  • Easy to use
  • Faster parsing than the MATLAB implementation
  • High scalability
  • The official toolbox for parsing .csi

Preparation steps on Windows 10 or 11

  1. Install TDM-GCC-64 (choose MinGW-w64 based version, version 10.3+);
  2. Set Compiler to MinGW64 using mingw64ccompiler
pip install git+https://github.com/imba-tjd/mingw64ccompiler
python -m mingw64ccompiler install_specs  # Run once
python -m mingw64ccompiler install        # Works with venv

Install

  1. Git clone this repository with --recursive option.
git clone https://github.com/Herrtian/PicoscenesToolbox.git --recursive
  1. install python and dependency
sudo apt update
sudo apt install python3
sudo apt install python3-pip
  • If you are Chinese user, you can change pip source to accelerate download speed.
pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/
  • install dependency
pip3 install -r requirements.txt 
  1. Build the program
python3 setup.py build_ext --inplace

Quick start

rx_by_usrpN210.csi is a sample binary csi file created by Picoscenes,now we will use it to create a chart.

# main.py 

from picoscenes import  Picoscenes
import numpy as np
import matplotlib.pyplot as plt

i = 0  # stands for the first frame of csi frames

frames = Picoscenes("rx_by_usrpN210.csi")
numTones = frames.raw[i].get("CSI").get("numTones")
SubcarrierIndex = np.array(frames.raw[i].get("CSI").get("SubcarrierIndex"))
Mag = np.array(frames.raw[i].get("CSI").get("Mag"))[:numTones]

plt.title(" Magnitude Demo")
plt.xlabel("x axis subcarryindex ")
plt.ylabel("y axis Magnitude")
plt.plot(SubcarrierIndex, Mag)
plt.show()

main.py is included in the working dir.

This programm shows the first frame of rx_by_usrpN210.csi ,and draws the picture whose x-ray stands for SubcarrierIndex and y-ray stands for Magnitude.

run the file

python3 main.py

If you run the programm successfully, you will get the result like this :

Wiki && Docs

If you want to know more details about PicoscenesToolbox , you can seek ./docs and wiki

Mistakes && Issues

If you have some questions on PicoscenesToolbox, please make me know and submit issues what you met.

Welcome to give this programm a star or fork.

Reference Links

  • PicoScenes: A powerful Wi-Fi sensing platform middleware for a wide range of hardware.
  • csiread: A fast channel state information parser for Intel, Atheros, Nexmon and ESP32 in Python.

License

The code in this project is licensed under MIT license. That means if you are building project by this programm, I would greatly appreciate if you could cite this repository.

About

An official tool to parsing picosecenes files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published