使用时间数据进行Python / SciPy过滤

时间:2017-11-26 16:18:16

标签: python python-3.x numpy filter scipy

如果这是显而易见的事情,请提前表示道歉,我是Python新手,而且我无法在任何地方找到能够解决我所挣扎的问题。

this question中,Dave为如何在SciPy中实现过滤器提供了以下代码示例:

# spell out the args that were passed to the Matlab function
N = 10
Fc = 40
Fs = 1600
# provide them to firwin
h = scipy.signal.firwin(numtaps=N, cutoff=40, nyq=Fs/2)
# 'x' is the time-series data you are filtering
y = scipy.signal.lfilter(h, 1.0, x)

我不明白如何在明确提供带有信号值的时间戳数据的同时做到这一点。我的数据没有按照完美的时间步骤收集,因此没有这些信息的过滤感觉就像垃圾中的垃圾一样。

示例数据:

#Time    ,  Value
[0.004000,  0.023880] # diffT = 0
[0.012000,  0.022180] # diffT = 8
[0.028000,  0.023370] # diffT = 16
[0.043000,  0.022130] # diffT = 15
[0.053000,  0.022300] # diffT = 10
[0.072000,  0.022410] # diffT = 19
[0.079000,  0.022350] # diffT = 7

如果有任何帮助,我只需要执行低通和高通滤波,但需要使用参数来找到最佳滤波器系数。

提前感谢您的帮助。

0 个答案:

没有答案