signal.tests.mpsig

Some signal functions implemented using mpmath.

Module Contents

Functions

_prod(seq) Returns the product of the elements in the sequence seq.
_relative_degree(z,p) Return relative degree of transfer function from zeros and poles.
_zpkbilinear(z,p,k,fs) Bilinear transformation to convert a filter from analog to digital.
_zpklp2lp(z,p,k,wo=1) Transform a lowpass filter to a different cutoff frequency.
_butter_analog_poles(n) Poles of an analog Butterworth lowpass filter.
butter_lp(n,Wn) Lowpass Butterworth digital filter design.
zpkfreqz(z,p,k,worN=None) Frequency response of a filter in zpk format, using mpmath.
_prod(seq)

Returns the product of the elements in the sequence seq.

_relative_degree(z, p)

Return relative degree of transfer function from zeros and poles.

This is simply len(p) - len(z), which must be nonnegative. A ValueError is raised if len(p) < len(z).

_zpkbilinear(z, p, k, fs)

Bilinear transformation to convert a filter from analog to digital.

_zpklp2lp(z, p, k, wo=1)

Transform a lowpass filter to a different cutoff frequency.

_butter_analog_poles(n)

Poles of an analog Butterworth lowpass filter.

This is the same calculation as scipy.signal.buttap(n) or scipy.signal.butter(n, 1, analog=True, output=’zpk’), but mpmath is used, and only the poles are returned.

butter_lp(n, Wn)

Lowpass Butterworth digital filter design.

This computes the same result as scipy.signal.butter(n, Wn, output=’zpk’), but it uses mpmath, and the results are returned in lists instead of numpy arrays.

zpkfreqz(z, p, k, worN=None)

Frequency response of a filter in zpk format, using mpmath.

This is the same calculation as scipy.signal.freqz, but the input is in zpk format, the calculation is performed using mpath, and the results are returned in lists instead of numpy arrays.