update float32 to float64
This commit is contained in:
@@ -11,7 +11,7 @@ class ParadigmRingBuffer:
|
||||
def __init__(self, n_chan, n_points):
|
||||
self.n_chan = n_chan
|
||||
self.n_points = n_points
|
||||
self.buffer = np.zeros((n_chan, n_points), dtype=np.float32)
|
||||
self.buffer = np.zeros((n_chan, n_points), dtype=np.float64)
|
||||
self.currentPtr = 0
|
||||
self.readPtr = 0
|
||||
self.nUpdate = 0
|
||||
|
||||
@@ -18,7 +18,7 @@ class FilterRingBuffer:
|
||||
self.n_chan = n_chan
|
||||
self.n_points = n_points
|
||||
|
||||
self.buffer = np.zeros((n_chan, n_points), dtype=np.float32)
|
||||
self.buffer = np.zeros((n_chan, n_points), dtype=np.float64)
|
||||
self.current_ptr = 0 # 写入指针:指向下一个要写入的位置
|
||||
self.total_samples = 0 # 已写入总点数
|
||||
self.lock = threading.Lock() # 线程安全锁
|
||||
|
||||
@@ -174,7 +174,7 @@ class zmqServer(threading.Thread):
|
||||
return
|
||||
|
||||
# 转置为上位机需要的[50, 通道数]格式
|
||||
filtered_data = filtered_data.T.astype(np.float32)
|
||||
filtered_data = filtered_data.T.astype(np.float64)
|
||||
send_buf = filtered_data.tobytes()
|
||||
algo_log(f"发送滤波数据,长度: {len(send_buf)}字节, filtered_data.shape: {filtered_data.shape}", level="DEBUG")
|
||||
self.data_send_queue.put(send_buf)
|
||||
@@ -292,7 +292,7 @@ class zmqServer(threading.Thread):
|
||||
return
|
||||
|
||||
# 零拷贝解析 + 维度转换
|
||||
data_np = np.frombuffer(data_bytes, dtype=np.float32)
|
||||
data_np = np.frombuffer(data_bytes, dtype=np.float64)
|
||||
data_np = data_np.reshape(self.device_info['frame_points'], self.device_info['channel_nums'])
|
||||
data_np = data_np.T.astype(np.float64)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user