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

The 1-D input vector z is split up into its complex (:None:None:`zc`) and real (:None:None:`zr`) elements. Every complex element must be part of a complex-conjugate pair, which are combined into a single number (with positive imaginary part) in the output. Two complex numbers are considered a conjugate pair if their real and imaginary parts differ in magnitude by less than tol * abs(z) .

Parameters

z : array_like

Vector of complex numbers to be sorted and split

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

zc : ndarray

Complex elements of z, with each pair represented by a single value having positive imaginary part, sorted first by real part, and then by magnitude of imaginary part. The pairs are averaged when combined to reduce error.

zr : ndarray

Real elements of z (those having imaginary part less than :None:None:`tol` times their magnitude), sorted by value.

Split into complex and real parts, combining conjugate pairs.

See Also

_cplxpair

Examples

>>> a = [4, 3, 1, 2-2j, 2+2j, 2-1j, 2+1j, 2-1j, 2+1j, 1+1j, 1-1j]
... zc, zr = _cplxreal(a)
... print(zc) [ 1.+1.j 2.+1.j 2.+1.j 2.+2.j]
>>> print(zr)
[ 1.  3.  4.]
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#846
type: <class 'function'>
Commit: