forked from wifisensing/PicoScenes-Python-Toolbox
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
22 lines (17 loc) · 607 Bytes
/
main.py
File metadata and controls
22 lines (17 loc) · 607 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"""
Simple usage example
Processing and plotting CSI collected using Picoscenes with a USRP N210.
"""
from picoscenes import Picoscenes
import numpy as np
import matplotlib.pyplot as plt
frames = Picoscenes("rx_by_usrpN210.csi")
frame = frames.raw[0] # Get the first frame in the list
num_tones = frame.get("CSI").get("numTones")
subcarrier_indices = np.array(frame.get("CSI").get("SubcarrierIndex"))
magnitude = np.array(frame.get("CSI").get("Mag"))[:num_tones]
plt.title("Magnitude Demo")
plt.xlabel("subcarrier index")
plt.ylabel("CSI Magnitude")
plt.plot(subcarrier_indices, magnitude)
plt.show()