Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CSI collection not working correctly #292

Open
cheneso89 opened this issue May 5, 2023 · 10 comments
Open

CSI collection not working correctly #292

cheneso89 opened this issue May 5, 2023 · 10 comments

Comments

@cheneso89
Copy link

I tried to collect CSI with ASUS RT-AC86U but this is the plot that I got, that's the CSI amplitude (80 Mhz) for each receiving antenna. I couldn't find what's the problem while I'm collecting it.
untitled

@zeroby0
Copy link

zeroby0 commented May 5, 2023

Pilot and Null subcarriers have arbitrarily high csi values and are over shadowing you actual csi data.

Indices for different bandwidths are available here: https://github.com/nexmonster/nexcsi/blob/main/nexcsi/__init__.py#L5

Or you can use the https://github.com/nexmonster/nexcsi and remove the pilots and nulls as decribed in https://github.com/nexmonster/nexcsi#null-and-pilot-subcarriers

@cheneso89
Copy link
Author

cheneso89 commented May 5, 2023

Also removing pilot/null subcarriers it still doesn't work, higher values correspond to more subcarriers values than the number of null/pilot subcarriers. In the zoomed plot I already removed them.

untitled

untitled2

@zeroby0
Copy link

zeroby0 commented May 6, 2023

Er, it doesn't seem the right nulls and pilot values have been removed.

For an 80 MHz channel, these are the indices [0, 1, 2, 3, 4, 5, 25, 53, 89, 117, 127, 128, 129, 139, 167, 203, 231, 251, 252, 253, 254, 255] that must be made 0. Maybe I'm not looking right, but it seems indices 0->5 are non zero in the graphs.

Or maybe your CSI is just like that. Can you post a pcap with 10-20 packets?

@cheneso89
Copy link
Author

the indices seem correct. This is one of my pcap files

lab_trial_2.pcap.zip

@zeroby0
Copy link

zeroby0 commented May 10, 2023

import numpy as np
import matplotlib.pyplot as plt

from nexcsi import decoder


device = "rtac86u" # nexus5, nexus6p, rtac86u
samples = decoder(device).read_pcap('lab_trial_2.pcap')

# Accessing CSI as type complex64
csi = decoder(device).unpack(samples['csi'], zero_nulls=True, zero_pilots=True)


f, (ax1, ax2) = plt.subplots(2, 1)
ax1.plot(np.abs(csi[0])) # Amplitude
ax2.plot(np.angle(csi[0])) # Phase

plt.show()

image

@cheneso89
Copy link
Author

cheneso89 commented May 10, 2023

I already saw this code.. I'm working on Matlab though, with the csireader.m code

@zeroby0
Copy link

zeroby0 commented May 11, 2023

Ah. Then maybe modify it to set these indices to 0. Python array index starts from 0 while matlabs starts from 1, so maybe that's the confusion?

I don't know matlab much, however, so I can't help you with that.

@cheneso89
Copy link
Author

No no I already shifted indices by 1, it doesn't work. I'm going to work with python. Thank you anyway

@jlinktu
Copy link
Member

jlinktu commented Jun 18, 2024

Your question is not related to this issue. Please, don't choose random issues and post your questions there!
Also, tcpdump is not a tool by us. You can find a very detailed description of its usage with a quick online search, e.g.: the tcpdump man page.

@lionlanlan
Copy link

Your question is not related to this issue. Please, don't choose random issues and post your questions there! Also, tcpdump is not a tool by us. You can find a very detailed description of its usage with a quick online search, e.g.: the tcpdump man page.

I am very sorry for my impoliteness.I will delete my comment.Sorry for this again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants