Consider a simple linear, time invariant system of the form:
y_k = c*y_k-1 + (1-c)x_k
The impulse response of this system can be computed by either dimpulse or by applying lfilter to a vector composed of a one followed by zeros:
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])
which yields:
array([ 0. , 0.1 , 0.09 , 0.081 , 0.0729])
[ 0.1 0.09 0.081 0.0729 0.06561]
Why does dimpulse introduce a one-sample delay in the impulse response?