update float32 to float64

This commit is contained in:
2026-06-08 15:47:25 +08:00
parent ac0de93e31
commit 31d91d6cc7
6 changed files with 10 additions and 10 deletions

View File

@@ -18,7 +18,7 @@ PKT_INTERVAL = N_SAMPLES_PER_PKT / FS
def build_packet(global_sample_idx):
"""
生成一包 [5, 66] 的 float32 数据
生成一包 [5, 66] 的 float64 数据
:param global_sample_idx: 当前包第一个采样点在全局序列中的索引 (从 0 开始)
:return: np.ndarray shape [5, 66]
"""
@@ -31,13 +31,13 @@ def build_packet(global_sample_idx):
eeg = np.tile(eeg, (1, 64)) # [5, 64]
# Ch64: 标签值通道,初始化为 0
event = np.zeros((N_SAMPLES_PER_PKT, 1), dtype=np.float32)
event = np.zeros((N_SAMPLES_PER_PKT, 1), dtype=np.float64)
# Ch65: 标签序号通道,初始化为 0
label_idx = np.zeros((N_SAMPLES_PER_PKT, 1), dtype=np.float32)
label_idx = np.zeros((N_SAMPLES_PER_PKT, 1), dtype=np.float64)
# 拼成 [5, 66]
packet = np.concatenate([eeg, event, label_idx], axis=1).astype(np.float32)
packet = np.concatenate([eeg, event, label_idx], axis=1).astype(np.float64)
return packet