python三维插值平滑_scipy(python)中高效的三维插值/近似

下面是一个小例子代码,它试图插值EEG cap信号。在这个例子中,EEG-cap有44个通道/电极,每个通道有1125个时间戳。此外,还有800个样本,每个样本包含每个44个通道/电极的1125个时间戳。在

我尝试了scipy的RBF插值,但似乎很慢。在

请注意,电极坐标只需旋转一次。在

如何改进代码以使插值速度更快?我愿意考虑其他插值/近似方法。在import numpy as np

from scipy.interpolate import Rbf

x = np.random.rand(44,1)

y = np.random.rand(44,1)

z = np.random.rand(44,1)

xR = np.random.rand(44,1)

yR = np.random.rand(44,1)

zR = np.random.rand(44,1)

time_series = np.random.rand(800,44,1125)

time_series_rotated = np.zeros((800,44,1125))

total_time_steps = time_series.shape[2]

total_samples = time_series.shape[0]

for s in range(total_samples):

for t in range(total_time_steps):

rbfi = Rbf(x, y, z, time_series[s,:,t], function="quintic")

time_series_rotated[s,:,t] = np.squeeze(rbfi(xR, yR, zR))

你可能感兴趣的:(python三维插值平滑)