Savitzky-Golay 滤波器参数,用于可视化相应的速度剖面

Savitzky-Golay Filter parameters for visualizing corresponding velocity profile

提问人:I Paul Roy 提问时间:11/1/2023 更新时间:11/1/2023 访问量:21

问:

我有一些凝视位置数据(以像素为单位),我使用具有第一差分法的 Savitzky-Golay 滤波器对其进行了平滑处理。我打算可视化这个眼睛数据的速度,以便对眼睛数据进行进一步的扫视分析。这是我的以下代码:


x_smooth = savgol_filter(y2_int, window_length=251, polyorder=5, mode='nearest',deriv=1,delta=x_int[1] - x_int[0])
difference_x_gaze_internal = abs(np.diff(y2_int_smooth))

velocity_x_gaze_internal = difference_x_gaze_internal * 100
x_int_smooth = np.linspace(start_int, stop_int, 1953)

plt.subplot(2,1,1)
plt.plot(x_int, velocity_x_gaze_internal)
plt.title('Velocity_X_Gaze_Internal')
plt.subplot(2,1,2)
plt.plot(x_int_smooth, y2_int_smooth, linewidth=3)
plt.xlabel('Time(mS)')
plt.ylabel('Velocity(mm/s)')
plt.title("Position_data")

我有大量采样率为 100 Hz 的眼睛数据,在绘制位置数据的相应速度时,我得到的图如下:Velocity+Postion plot

我认为这是不正确的,因为速度图中有太多的峰值和变化,即使在我看来它应该在某些注视位置是恒定的......我应该在过滤参数中更改一些内容吗?我应该考虑采用的窗口长度和多项式顺序应该是多少?

Python 位置 信号处理 速度 眼动追踪

评论


答: 暂无答案