Skip to main content

Arithmetical manipulation for scipy.signal.lti TransferFunction

Project description

lti-arithmetic

Arithmetical manipulation for scipy.signal.lti TransferFunction

LTI system representations in scipy do not offer built-in composability. Given two instances of scipy.signal.lti, for example, H and G, you cannot directly write H * G.

This package defines a scipy.signal.lti-compatible TransferFunction that permits standard arithmetical combination: H + G, H - G, H * G, H / G, and H**n. In addition, the parallel combination (reciprocal of reciprocal sums) of systems is available by writing H | G.

The package also defines functions Z_R, Z_C, and Z_L that represent the impedance of a resistance, capacitance, and inductance, respectively, as LTI systems that can be composed to represent the transfer function of a larger network.

For convenience, the package also defines s so that transfer functions can be written as rational expressions in s.

Examples

>>> from ltiarithmetic import TransferFunction, Z_R, Z_C, Z_L, s

Compute the product of two LTI systems:

>>> H = TransferFunction([1,2,3],[1])
>>> G = TransferFunction[[1],[2,3,4])
>>> H * G
TransferFunction(
array([0.5, 1. , 1.5]),
array([1. , 1.5, 2. ]),
dt: None
)

Compute the transfer function of a RC lowpass filter:

Z_1 = Z_R(1000.)
Z_2 = Z_C(1e-9)
H = Z_2 / (Z_1 + Z_2)

Construct LTI systems from rational expressions in s:

import math
w0 = 2 * math.pi * 1000.
Q = 2.
H = 1/(1 + s / (Q * w0) + (s / w0)**2)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lti-arithmetic-1.0.0.post1.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

lti_arithmetic-1.0.0.post1-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file lti-arithmetic-1.0.0.post1.tar.gz.

File metadata

  • Download URL: lti-arithmetic-1.0.0.post1.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.6

File hashes

Hashes for lti-arithmetic-1.0.0.post1.tar.gz
Algorithm Hash digest
SHA256 2bd67fd29c6ab348e10dbb141d4994ca46f72ed913e0072b68dbd131c6c88fba
MD5 f8adfaa795c84913146a80063f2f3c32
BLAKE2b-256 5acde79e668155bda03dabaeac555016b8f4527614ecf2cb16ceb5995315301e

See more details on using hashes here.

File details

Details for the file lti_arithmetic-1.0.0.post1-py3-none-any.whl.

File metadata

  • Download URL: lti_arithmetic-1.0.0.post1-py3-none-any.whl
  • Upload date:
  • Size: 4.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.8.6

File hashes

Hashes for lti_arithmetic-1.0.0.post1-py3-none-any.whl
Algorithm Hash digest
SHA256 2b415c94da7b4aceb2dfc2633ccf962dfd5f9fecfa1af200c54afbb94e32e124
MD5 b725137e61e176fe4894934d8aa0fe39
BLAKE2b-256 19bff00469e2d97ec575d8d6a495e07acacbc45e8d6899a64600bd7f9ad4e23f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page