# [SciPy-user] signal.lti

Ryan Krauss ryanlists at gmail.com
Tue Sep 12 22:37:28 CDT 2006

```I think Lars is right.  I made 1 change to line 333 of signal/ltisys.py:
#    ufunc = interpolate.linear_1d(T, U, axis=0, bounds_error=0, fill_value=0)
ufunc = interpolate.interp1d(T, U, axis=0, bounds_error=0, fill_value=0)

It seems like interp1d replaces linear_1d.  With this change, I was
able to generate this fabulous step response of an intergrator based
on this code:

T=2.0
fs=100
dt=1.0/fs
t=arange(0.0,T+dt,dt)
u=where(t>0.5,1,0)

ylim([-0.1,1.1])
mysys=signal.lti(1,[1,0])
yo=signal.lsim2(mysys,u,t)
cla()
plot(t,u)
plot(t,yo[1])
legend(['input','output'],2)
xlabel('Time (sec)')
ylabel('Amplitude')

Ryan

On 9/12/06, Lars Friedrich <lfriedri at imtek.de> wrote:
> Hello,
>
> > Ryan Krauss wrote:
> >
> > >not being correct.  The A matrix really is just 0.  So, passing in the
> > >numerator and denominator polynomials does correctly create a system,
> > >you just can't take its step response.
>
> shouldn't signal.lsim2 be able to handle such systems? I tried the
> following:
>
> #*************** start shell session
> from scipy import signal
> from numpy import *
>
> sys1=signal.lti((1),(1,0))
>
> signal.lsim2(sys1, ones(10), arange(10))
>
> Traceback (most recent call last):
>   File "<input>", line 1, in ?
>   File "/usr/lib/python2.4/site-packages/scipy/signal/ltisys.py", line
> 333, in lsim2
>     ufunc = interpolate.linear_1d(T, U, axis=0, bounds_error=0,
> fill_value=0)
> AttributeError: 'module' object has no attribute 'linear_1d'
> #***************** end shell session
>
> sys=signal.lti((1),(1,1)).
>
> Thanks
> Lars
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.org
> http://projects.scipy.org/mailman/listinfo/scipy-user
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: integrator.png
Type: image/png
Size: 27393 bytes
Desc: not available
Url : http://projects.scipy.org/pipermail/scipy-user/attachments/20060912/996389dc/attachment-0001.png
```