bundles / scipy latest / scipy / signal / _filter_design / _cplxreal
function
scipy.signal._filter_design:_cplxreal
Signature
def _cplxreal ( z , tol = None ) Summary
Split into complex and real parts, combining conjugate pairs.
Extended Summary
The 1-D input vector z is split up into its complex (zc) and real (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_likeVector of complex numbers to be sorted and split
tol: float, optionalRelative tolerance for testing realness and conjugate equality. Default is
100 * spacing(1)ofz's data type (i.e., 2e-14 for float64)
Returns
zc: ndarrayComplex 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: ndarrayReal elements of
z(those having imaginary part less thantoltimes their magnitude), sorted by value.
Raises
: ValueErrorIf there are any complex numbers in
zfor which a conjugate cannot be found.
Examples
from scipy.signal._filter_design import _cplxreal 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) print(zr)✗
See also
Aliases
-
scipy.signal._filter_design._cplxreal