scipy 1.8.0 Pypi GitHub Homepage
Other Docs
ParametersRaisesReturnsBackRef
_cplxpair(z, tol=None)

Complex conjugates in z are sorted by increasing real part. In each pair, the number with negative imaginary part appears first.

If pairs have identical real parts, they are sorted by increasing imaginary magnitude.

Two complex numbers are considered a conjugate pair if their real and imaginary parts differ in magnitude by less than tol * abs(z) . The pairs are forced to be exact complex conjugates by averaging the positive and negative values.

Purely real numbers are also sorted, but placed after the complex conjugate pairs. A number is considered real if its imaginary part is smaller than :None:None:`tol` times the magnitude of the number.

Parameters

z : array_like

1-D input array to be sorted.

tol : float, optional

Relative tolerance for testing realness and conjugate equality. Default is 100 * spacing(1) of z's data type (i.e., 2e-14 for float64)

Raises

ValueError

If there are any complex numbers in z for which a conjugate cannot be found.

Returns

y : ndarray

Complex conjugate pairs followed by real numbers.

Sort into pairs of complex conjugates.

See Also

_cplxreal

Examples

>>> a = [4, 3, 1, 2-2j, 2+2j, 2-1j, 2+1j, 2-1j, 2+1j, 1+1j, 1-1j]
... z = _cplxpair(a)
... print(z) [ 1.-1.j 1.+1.j 2.-1.j 2.+1.j 2.-1.j 2.+1.j 2.-2.j 2.+2.j 1.+0.j 3.+0.j 4.+0.j]
See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

scipy.signal._filter_design._cplxreal scipy.signal._filter_design._cplxpair

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /scipy/signal/_filter_design.py#950
type: <class 'function'>
Commit: