This is my main function:
from CSIKit.filters.passband import lowpass
from CSIKit.filters.statistical import running_mean
from CSIKit.util.filters import hampel
from CSIKit.reader.readers.read_pico import PicoScenesBeamformReader
from CSIKit.tools.batch_graph import BatchGraph
from CSIKit.util import csitools
import numpy as np
my_reader = PicoScenesBeamformReader()
csi_data = my_reader.read_file("./data/rx_usrp_240316_144918.csi", scaled=True)
csi_matrix, no_frames, no_subcarriers = csitools.get_CSI(csi_data, metric="amplitude")
# CSI matrix is now returned as (no_frames, no_subcarriers, no_rx_ant, no_tx_ant).
# First we'll select the first Rx/Tx antenna pairing.
csi_matrix_first = csi_matrix[:, :, 0, 0]
# Then we'll squeeze it to remove the singleton dimensions.
csi_matrix_squeezed = np.squeeze(csi_matrix_first)
# This example assumes CSI data is sampled at ~100Hz.
# In this example, we apply (sequentially):
# - a lowpass filter to isolate frequencies below 10Hz (order = 5)
# - a hampel filter to reduce high frequency noise (window size = 10, significance = 3)
# - a running mean filter for smoothing (window size = 10)
for x in range(no_frames):
csi_matrix_squeezed[x] = lowpass(csi_matrix_squeezed[x], 10, 100, 5)
csi_matrix_squeezed[x] = hampel(csi_matrix_squeezed[x], 10, 3)
csi_matrix_squeezed[x] = running_mean(csi_matrix_squeezed[x], 10)
BatchGraph.plot_heatmap(csi_matrix_squeezed, `csi_data.timestamps)
Running the routine code directly given by the author results in an error:
File "C:\ProgramData\anaconda3\envs\data_process\lib\site-packages\CSIKit\reader\readers\pico\ModularPicoScenesFrame.py", line 27, in parse_header
self.log_exception("Unsupported frame version")
AttributeError: 'ModularPicoScenesFrame' object has no attribute 'log_exception'

No error is reported in this step after commenting the following code, but a new error has occurred:


When I debug, I find that the variable offset becomes a particularly large number after the second loop, resulting in the subsequent buffer array index out of range resulting in an error, but since I am only a Python beginner, I am not sure how to solve this problem.
In the get_block section of the read_pico.py file, the offset is normal the first time the for loop is performed:

The second time the for loop is performed, offset becomes a large number, causing the array to exceed the index:

The data for processing was obtained on the Ubuntu server using the x310 with PicoScenes software and can be opened using the PicoScenes toolbox on MATLAB. If you can provide relevant help or ideas, I would appreciate it.
This is my main function:
Running the routine code directly given by the author results in an error:
File "C:\ProgramData\anaconda3\envs\data_process\lib\site-packages\CSIKit\reader\readers\pico\ModularPicoScenesFrame.py", line 27, in parse_header
self.log_exception("Unsupported frame version")
AttributeError: 'ModularPicoScenesFrame' object has no attribute 'log_exception'
No error is reported in this step after commenting the following code, but a new error has occurred:
When I debug, I find that the variable
offsetbecomes a particularly large number after the second loop, resulting in the subsequent buffer array index out of range resulting in an error, but since I am only a Python beginner, I am not sure how to solve this problem.In the
get_blocksection of theread_pico.pyfile, theoffsetis normal the first time the for loop is performed:The second time the for loop is performed,
offsetbecomes a large number, causing the array to exceed the index:The data for processing was obtained on the Ubuntu server using the x310 with PicoScenes software and can be opened using the PicoScenes toolbox on MATLAB. If you can provide relevant help or ideas, I would appreciate it.