Travis E. Oliphant
Wed Apr 16 09:21:58 CDT 2008
Will Woods wrote:
> Is there a direct equivalent of matlab's impz() function in scipy?
> In matlab I can do:
> [b,a] = butter(4,[1.5/678,15.0/678],'bandpass');
> [h,t] = impz(b,a);
> The scipy.signal.impulse function is the closest I can find, but
> b,a = scipy.signal.butter(4,[1.5/678,15.0/678],'bandpass')
> T,h = scipy.signal.impulse((b,a))
> doesn't give the same answer.
Right, the latter gives samples of the continuous-time impulse
response. You are looking for the discrete-time impulse response.
The function is not directly available. However, you can get it (minus
the auto-compute N part), using
N = 100
x = scipy.zeros(N)
x = 1
h = scipy.signal.lfilter(b,a, x)
More information about the SciPy-user