Skip to main content

csiread PyPI

A fast channel state information parser for Intel, Atheros, Nexmon, ESP32 and PicoScenes in Python.

real-time plotting

real-time plotting

Introduction

Various CSI Tools only provide Matlab API parsing CSI data files. Those who want to process CSI with Python have to install Matlab to convert .dat to .mat. This process is redundant and inefficient. Therefore, Python API is recommended. Unfortunately, the API implemented in pure Python is inefficient. With this in mind, I implemented csiread in Cython(Pybind11 may be another great choice). The table below shows the performance of different implementations. They were all tested with 40k packets on the same computer.

Function Matlab Python3+Numpy csiread file size
Nexmon.read:bcm4339 3.2309s 0.2739s 0.0703s 44.0MB
Nexmon.read:bcm4358 3.5987s 23.0025s 0.1227s 44.0MB
Atheros.read 3.3081s 14.6021s 0.0956s 76.3MB
Intel.read 1.6102s 7.6624s 0.0479s 21.0MB
Intel.get_total_rss 0.1786s 0.0030s 0.0030s
Intel.get_scaled_csi 0.5497s 0.1225s 0.0376s/0.0278s
Intel.get_scaled_csi_sm 5.0097s 0.3627s 0.0778s/0.0465s

This tool is not only the translation of the Matlab API, but also a CSI toolbox. I added some utilities, real-time visualization and algorithms code in the examples folder. These would be useful for Python-based CSI researchers.

Install

pip3 install csiread

Quickstart

import csiread

# Linux 802.11n CSI Tool
csifile = "../material/5300/dataset/sample_0x1_ap.dat"
csidata = csiread.Intel(csifile, nrxnum=3, ntxnum=2, pl_size=10)
csidata.read()
csi = csidata.get_scaled_csi()
print(csidata.csi.shape)

# Atheros CSI Tool
csifile = "../material/atheros/dataset/ath_csi_1.dat"
csidata = csiread.Atheros(csifile, nrxnum=3, ntxnum=2, pl_size=10, tones=56)
csidata.read(endian='little')
print(csidata.csi.shape)

# nexmon_csi
csifile = "../material/nexmon/dataset/example.pcap"
csidata = csiread.Nexmon(csifile, chip='4358', bw=80)
csidata.read()
print(csidata.csi.shape)

# ESP32-CSI-Tool
csifile = "../material/esp32/dataset/example_csi.csv"
csidata = csiread.ESP32(csifile, csi_only=True)
csidata.read()
print(csidata.csi.shape)

# PicoScenes
csifile = "../material/picoscenes/dataset/rx_by_iwl5300.csi"
csidata = csiread.Picoscenes(csifile, {'CSI': [30, 3, 2], 'MPDU': 1522})
csidata.read()
csidata.check()
print(csidata.raw['CSI']['CSI'].shape)

examples are the best usage instructions. The API documentation can be found in docstring of file core.py, so we won't repeat them here.

Build from source

cd csiread
pip3 install -r requirements.txt
python3 setup.py sdist bdist_wheel
pip3 install -U dist/csiread*.whl

* is a shell wildcard. After running python3 setup.py sdist bdist_wheel,there will be a wheel file like csiread-1.3.4-cp36-cp36m-win_amd64.whl in the dist folder. Replace csiread*.whl with it.

csiread is written in Cython, Cython requires a C compiler to be present on the system. You can refer to Installing Cython for more details. If you don't want to install a C compiler, just fork the project and push a tag to the latest commit. Then wheel files can be found in Github-Actions-Python package-Artifacts: csiread_dist

Design

csiread provides 7 classes: Intel, Atheros, Nexmon, AtherosPull10, NexmonPull46, ESP32 and Picoscenes. Each class has 4 key methods: read(), seek(), pmsg() and display() which are used for reading a file, reading a file from a specific position, real-time parsing and viewing the contents of a packet respectively. csiread.utils provides some common functions.

Nexmon CSI

  • csiread.Nexmon is based on the commit of nexmon_csi(Aug 29, 2020): ba99ce12a6a42d7e4ec75e6f8ace8f610ed2eb60
  • csiread.NexmonPull256 is the same as csiread.NexmonPull46. It works with the latest master branch (Dec 11, 2021): c037576b7035619e2716229c7622f4e8c511635f
  • The Nexmon.group is experimental, it may be incorrect due to core and spatial. core and spatial are ZERO or not recorded correctly in some files. I don't know how to solve it.

ESP32-CSI-Tool

  • pandas.read_csv and csiread.ESP32 have the similar performance, but pandas.read_csv is much more flexible.

PicoScenes

The support for Picoscenes is an experimental feature. PicoScenes is still under active development, csiread cannot be updated synchronously.

  • csidata.raw is a structured array in numpy and stores the parsed result.
  • Mag and Phase fileds have been removed, use np.abs and np.angle instead.
  • Call check() method after read(), Then set pl_size according to the report.
  • Edge padding are applied to raw["xxx"]["SubcarrierIndex"] for plotting.
  • The method pmsg has been implemented, but not yet ready.
  • Accessing CSI like csidata.CSI.CSI is only available after calling read method.
  • 5-10 times faster than before
  • parseCSIMVM(...) in _picoscenes.pyx may be incorrect.

csiread.Picoscenes is based on the PicoScenes MATLAB Toolbox(PMT)(Last modified at 2022-01-21).

Release files for csiread 1.4.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for csiread 1.4.1
File Size Uploaded
csiread-1.4.1.tar.gz 168.0 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for csiread 1.4.1
File
csiread-1.4.1-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
csiread-1.4.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details
csiread-1.4.1-cp313-cp313-macosx_10_13_universal2.whl CPython 3.13 CPython 3.13 macOS 10.13+ universal2 (ARM64, x86-64) Details
csiread-1.4.1-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
csiread-1.4.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details
csiread-1.4.1-cp312-cp312-macosx_10_13_universal2.whl CPython 3.12 CPython 3.12 macOS 10.13+ universal2 (ARM64, x86-64) Details
csiread-1.4.1-cp311-cp311-win_amd64.whl CPython 3.11 CPython 3.11 Windows x86-64 Details
csiread-1.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details
csiread-1.4.1-cp311-cp311-macosx_10_9_universal2.whl CPython 3.11 CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64) Details
csiread-1.4.1-cp310-cp310-win_amd64.whl CPython 3.10 CPython 3.10 Windows x86-64 Details
csiread-1.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details
csiread-1.4.1-cp310-cp310-macosx_10_9_universal2.whl CPython 3.10 CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64) Details
csiread-1.4.1-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
csiread-1.4.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details
csiread-1.4.1-cp39-cp39-macosx_10_9_universal2.whl CPython 3.9 CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64) Details
csiread-1.4.1-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details
csiread-1.4.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.17+ x86-64 Details
csiread-1.4.1-cp38-cp38-macosx_11_0_universal2.whl CPython 3.8 CPython 3.8 macOS 11.0+ universal2 (ARM64, x86-64) Details

Total release size: 7.5 MB

Release files / csiread-1.4.1.tar.gz

Download URL csiread-1.4.1.tar.gz
Size 168.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5159c81d160c4fa581acc58944bf29d34d712f40721469125a8573bd0f5bbcb7
BLAKE2b-256 checksum
How to use checksums
084c94f9d0d788548e6fffbed0491ea7dbc1e83864491e37101c1a2d7cdc9ef4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / csiread-1.4.1-cp313-cp313-win_amd64.whl

Download URL csiread-1.4.1-cp313-cp313-win_amd64.whl
Size 268.1 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
45b06eb453725d5122347451e1e2150b90583c63ee003540abf54465983a3791
BLAKE2b-256 checksum
How to use checksums
26a4a1eb613b51dd1205f6de58b48ae73b819c780fbada80462e72a16c857258
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / csiread-1.4.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL csiread-1.4.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 363.6 kB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
66d709f51818c50ef35aff89728bc28b7ea30b123ffe071aca9d0d4be3101d35
BLAKE2b-256 checksum
How to use checksums
c345add1fa6aa4f93f06e14b5f03faad16b40bf47c756684f3cadb9398fc410f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / csiread-1.4.1-cp313-cp313-macosx_10_13_universal2.whl

Download URL csiread-1.4.1-cp313-cp313-macosx_10_13_universal2.whl
Size 554.0 kB
Tags CPython 3.13 macOS 10.13+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
554937422a91a1fc78aaad220f2816ab821508e23ff47282ac3c4fb72a058f49
BLAKE2b-256 checksum
How to use checksums
52f7a0efc6b1ad52d638b4b317a903422a568466287bee16abd779bad001150d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / csiread-1.4.1-cp312-cp312-win_amd64.whl

Download URL csiread-1.4.1-cp312-cp312-win_amd64.whl
Size 268.5 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
87036d52613b673ba0b8ea53910b1033af9a873f0d853a4d0f97036cfe9bafaf
BLAKE2b-256 checksum
How to use checksums
ad3be36b8754129be81f669b59312696d49e8d6bb351c5f49e66409f2c0a4a95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / csiread-1.4.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL csiread-1.4.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 364.7 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
21b71d571c4d706bd6d9210be3ec9a3dad901458e81b714c05b29d8eb8a83ba5
BLAKE2b-256 checksum
How to use checksums
8c259f100c9ce9bb6c8674500a10e9dbe604bf9adc00ea1ab932802522239c70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / csiread-1.4.1-cp312-cp312-macosx_10_13_universal2.whl

Download URL csiread-1.4.1-cp312-cp312-macosx_10_13_universal2.whl
Size 559.2 kB
Tags CPython 3.12 macOS 10.13+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
bc9734630c174fb634c4edc4bf2daf06e48fb97baf0db09360d0a42245b5d6dc
BLAKE2b-256 checksum
How to use checksums
c98ac640daaacb2a933a9680afe6e45cabaac386bb7ec29a5f406c8961eaea50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / csiread-1.4.1-cp311-cp311-win_amd64.whl

Download URL csiread-1.4.1-cp311-cp311-win_amd64.whl
Size 273.8 kB
Tags CPython 3.11 Windows x86-64
SHA-256 checksum
How to use checksums
b7a8ab285f39ab9b7d32afcb52fc4dbef4b68540ae1e14edc9ad1d2fa9b7a94c
BLAKE2b-256 checksum
How to use checksums
474f3694008acfd31b7b6d82cc47864d6ecdfc05607cf5911425b2d865e6266c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / csiread-1.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL csiread-1.4.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 378.8 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
0499946134e703b422c4d9cc51f998338dfbf544a2b73ea96c8deef95e5e458b
BLAKE2b-256 checksum
How to use checksums
d14e30c282a732ae7c144887465600643938bb1b9ebe852495d1a629175f1078
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / csiread-1.4.1-cp311-cp311-macosx_10_9_universal2.whl

Download URL csiread-1.4.1-cp311-cp311-macosx_10_9_universal2.whl
Size 560.2 kB
Tags CPython 3.11 macOS 10.9+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
5247d2c21b3f6eb15e36b2e57b308116b0c9991ac765ca5040085f889c7e378b
BLAKE2b-256 checksum
How to use checksums
f716b7ab650fe1de554a5f49081ae439634b1aaadfcc4db6bd82ce4be8e4d02d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / csiread-1.4.1-cp310-cp310-win_amd64.whl

Download URL csiread-1.4.1-cp310-cp310-win_amd64.whl
Size 272.7 kB
Tags CPython 3.10 Windows x86-64
SHA-256 checksum
How to use checksums
603234077183ceba592a3176c9a75c0758f961688d9362eab12f07af095cdc64
BLAKE2b-256 checksum
How to use checksums
6db14e028b526d3f926e8a50fe0ac4bc86a75f905cdf00999729176fac68ff5e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / csiread-1.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL csiread-1.4.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 378.3 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
1cc09bc47f2126ba46dff84c419f59037b0aaebc76e2486599032a6a59866178
BLAKE2b-256 checksum
How to use checksums
862ba9a7657617d20c4699f17b704c75cde36d3b12122a29949411523415c94f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / csiread-1.4.1-cp310-cp310-macosx_10_9_universal2.whl

Download URL csiread-1.4.1-cp310-cp310-macosx_10_9_universal2.whl
Size 559.1 kB
Tags CPython 3.10 macOS 10.9+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
2915b2e5250bcd86a2ca6fb60f42d3c74e6a4d67a5f7aab4ae23d65741a81b91
BLAKE2b-256 checksum
How to use checksums
fbdabee2cc062cd34fad42bd143d2e542b01241c09c4bb9a6e7dea700ab34126
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / csiread-1.4.1-cp39-cp39-win_amd64.whl

Download URL csiread-1.4.1-cp39-cp39-win_amd64.whl
Size 310.7 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
e71402eb064f8376414bbff5a6858789e0b54845f844d9cf1b13ee1dff1441c8
BLAKE2b-256 checksum
How to use checksums
bc94d749065d044211d302c2c6b3503c25a9bd0ba693c6f904c78ee4c3d73cad
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / csiread-1.4.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL csiread-1.4.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 379.2 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
1a1dc1c1e40c74dfea518c5faaf02058274da724b228a004ca99d33c15ad9617
BLAKE2b-256 checksum
How to use checksums
e0294d196455c665de327cd0a1f5e979c112ea851512311f8e3a4a0418a0a29f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / csiread-1.4.1-cp39-cp39-macosx_10_9_universal2.whl

Download URL csiread-1.4.1-cp39-cp39-macosx_10_9_universal2.whl
Size 561.2 kB
Tags CPython 3.9 macOS 10.9+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
f44bf15438097df2d7c0ff29f6833d30cc5e34ade128ad4f0fa1830b256f92f9
BLAKE2b-256 checksum
How to use checksums
f08c7863e81e94a11c816a35f27292b5b58c6484c6244c4c1169590393199cb7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / csiread-1.4.1-cp38-cp38-win_amd64.whl

Download URL csiread-1.4.1-cp38-cp38-win_amd64.whl
Size 311.8 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
d32f2f97da0db030d467668bb9b2ea4094ea871eaec78d644ab5bc3852736e9f
BLAKE2b-256 checksum
How to use checksums
fece291b7a140a744475b1c7dbe2075fe6e2b281fd90df98953927709a20e252
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / csiread-1.4.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL csiread-1.4.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 384.6 kB
Tags CPython 3.8 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
d5d036096ef54b7140345fef8aa965d7690030dbd7adbd53463586dfb0b69160
BLAKE2b-256 checksum
How to use checksums
7b9c0eaa12a6ca6dc33807a74680e8d70987197f8af1995cadf5071667d587d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / csiread-1.4.1-cp38-cp38-macosx_11_0_universal2.whl

Download URL csiread-1.4.1-cp38-cp38-macosx_11_0_universal2.whl
Size 558.2 kB
Tags CPython 3.8 macOS 11.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
fda9619c35111c646c6c4cfcf22732167b718736f067be6b199bb946b07e45c7
BLAKE2b-256 checksum
How to use checksums
42847f6fd30b158547e4088ee5c0461bc20a6de622b86275f84b6fe8776aff30
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release history Release notifications | RSS feed

This release

1.4.1 This release

19 release files

1.4.0

16 release files

1.3.6

16 release files

1.3.5

16 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page