为什么python的scipy.signal.dimpulse会引入脉冲响应延迟?

问题描述 投票:1回答:1

考虑一个简单的线性时不变系统:

y_k = c * y_k-1 +(1-c)x_k

该系统的脉冲响应可以通过dimpulse或通过将lfilter应用于由一个后跟零组成的向量来计算:

import scipy.signal as sp_signal
import numpy as np

Ts = 1
c = 0.9
A = [1, -c]
B = [1-c]

time, imp_resp1 = sp_signal.dimpulse((B, A, Ts))

x = np.zeros(100)
x[0] = 1
imp_resp2 = sp_signal.lfilter(B, A, x)

print(imp_resp1[0][:5,0])
print(imp_resp2[:5])

产量:

array([ 0.    ,  0.1   ,  0.09  ,  0.081 ,  0.0729])

[ 0.1      0.09     0.081    0.0729   0.06561]

为什么dimpulse在脉冲响应中引入单样本延迟?

scipy filtering signal-processing
1个回答
0
投票

注意,如果你向分子加零,即[1-c,0] dimpulse将得到与lfilter相同的结果。添加这个零不应该做任何事情,所以我怀疑某种错误。

© www.soinside.com 2019 - 2024. All rights reserved.