Skip to content

DOC: Formula of Tustin formula in scipy.signal.bilinear misses "fs*2" #17911

@zolabar

Description

@zolabar

Formula of Tustin formula in scipy.signal.bilinear misses "fs*2"

The Tustin formula in

https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.bilinear.html

is described as (z-1) / (z+1)

but it should be fs2(z-1) / (z+1)

The implementation is correct, its only the formula in

https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.bilinear.html

that is wrong.

Here a simple example of the discretization of the lti $H(s)=\frac{1}{s}$ with the bilinear transform $s(z)=\frac{2}{T}\frac{z-1}{z+1}$ giving $H(z)=\frac{T}{s}\frac{z+1}{z-1}$

Reproducing Code Example

from scipy.signal import bilinear

num, den = bilinear([0, 1], [1, 0], 1/T)

print(num, den)

num_m = (T/2)*np.array([1, 1]) # manual usage of Tustin reads as ((2/T)*(z-1)/(z+1)))^-1
den_m = np.array([1, -1])

print(num_m, den_m)

Error message

no error

SciPy/NumPy/Python version information

1.5.0 1.18.5 sys.version_info(major=3, minor=8, micro=3, releaselevel='final', serial=0)

Metadata

Metadata

Assignees

No one assigned

    Labels

    DocumentationIssues related to the SciPy documentation. Also check https://github.com/scipy/scipy.orgscipy.signal

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions