lti#
- class scipy.signal.lti(*system)[source]#
Continuous-time linear time invariant system base class.
- Parameters:
- *systemarguments
The
lticlass can be instantiated with either 2, 3 or 4 arguments. The following gives the number of arguments and the corresponding continuous-time subclass that is created:2:
TransferFunction: (numerator, denominator)3:
ZerosPolesGain: (zeros, poles, gain)4:
StateSpace: (A, B, C, D)
Each argument can be an array or a sequence.
- Attributes:
Methods
bode([w, n])Calculate Bode magnitude and phase data of a continuous-time system.
freqresp([w, n])Calculate the frequency response of a continuous-time system.
impulse([X0, T, N])Return the impulse response of a continuous-time system.
output(U, T[, X0])Return the response of a continuous-time system to input U.
step([X0, T, N])Return the step response of a continuous-time system.
to_discrete(dt[, method, alpha])Return a discretized version of the current system.
See also
Notes
ltiinstances do not exist directly. Instead,lticreates an instance of one of its subclasses:StateSpace,TransferFunctionorZerosPolesGain.If (numerator, denominator) is passed in for
*system, coefficients for both the numerator and denominator should be specified in descending exponent order (e.g.,s^2 + 3s + 5would be represented as[1, 3, 5]).Changing the value of properties that are not directly part of the current system representation (such as the
zerosof aStateSpacesystem) is very inefficient and may lead to numerical inaccuracies. It is better to convert to the specific system representation first. For example, callsys = sys.to_zpk()before accessing/changing the zeros, poles or gain.Array API Standard Support
ltihas experimental support for Python Array API Standard compatible backends in addition to NumPy. Please consider testing these features by setting an environment variableSCIPY_ARRAY_API=1and providing CuPy, PyTorch, JAX, or Dask arrays as array arguments. The following combinations of backend and device (or other capability) are supported.Library
CPU
GPU
NumPy
✅
n/a
CuPy
n/a
⛔
PyTorch
⛔
⛔
JAX
⛔
⛔
Dask
⛔
n/a
See Support for the array API standard for more information.
Examples
>>> from scipy import signal
>>> signal.lti(1, 2, 3, 4) StateSpaceContinuous( array([[1]]), array([[2]]), array([[3]]), array([[4]]), dt: None )
Construct the transfer function \(H(s) = \frac{5(s - 1)(s - 2)}{(s - 3)(s - 4)}\):
>>> signal.lti([1, 2], [3, 4], 5) ZerosPolesGainContinuous( array([1, 2]), array([3, 4]), 5, dt: None )
Construct the transfer function \(H(s) = \frac{3s + 4}{1s + 2}\):
>>> signal.lti([3, 4], [1, 2]) TransferFunctionContinuous( array([3., 4.]), array([1., 2.]), dt: None )