如何使用python检查信号是否低于参考信号的限制?每个信号都以二维列表的形式给出,例如在下面的代码和图表中。你知道吗
#Signal = [[t0, t1, t2, ...], [y(t0), y(t1), y(t2), ...]]
CapturedSignal = [[1.0, 1.9, 2.0, 3.0, 3.1, 4.0], [0.0, 0.0, 1.0, 1.0, 0.0, 0.0]]
ReferenceSignal = [[0.5, 2.4, 2.5, 2.7, 2.8, 4.5], [1.2, 1.2, 0.4, 0.4, 1.2, 1.2]]
reference and captured signal http://www.img-host.de/bild.php/35899,caprefsigWQJ8Z.png
我的问题是,两个信号的采样点不匹配。我可以在两个点之间进行插值以获得可比较的值,但也许你知道在SciPy、NumPy或其他东西中随时可用的函数。你知道吗
必须使用插值。它总是涉及一些不确定性(你永远不知道你的采样点之间是什么),但只要你的采样率足够高,你将是安全的一方。你知道吗
此图中的结果:
不需要使用NumPy。您可以使用zero-order hold,这意味着您假设样本之间的信号是恒定的。这是一种非常简单的插值,只需几行代码。你知道吗
结果:
相关问题 更多 >
编程相关推荐