| Signal Processing Toolbox | ![]() |
Group complex numbers into complex conjugate pairs.
Syntax
y=cplxpair(x) y=cplxpair(x,tol)
Description
y returns = cplxpair(x)
x with complex conjugate pairs grouped together. cplxpair orders the conjugate pairs by increasing real part. Within a pair, the element with negative imaginary part comes first. The function returns all purely real values following all the complex pairs.
y includes a tolerance, = cplxpair(x,tol)
tol, for determining which numbers are real and which are paired complex conjugates. By default, cplxpair uses a tolerance of 100*eps relative to abs(x(i)). cplxpair forces the complex conjugate pairs to be exact complex conjugates.
The cplxpair function is part of the standard MATLAB language.
Example
Order five poles evenly spaced around the unit circle into complex pairs.
cplxpair(exp(2*pi*sqrt(-1)*(0:4)/5)') ans = -0.8090 - 0.5878i -0.8090 + 0.5878i 0.3090 - 0.9511i 0.3090 + 0.9511i 1.0000
Diagnostics
If there is an odd number of complex numbers, or if the complex numbers cannot be grouped into complex conjugate pairs within the tolerance, cplxpair generates the error message.
Complex numbers can't be paired.
| cov | cremez | ![]() |