<< corrmtx FOSSEE Signal Processing Toolbox cpsd >>

FOSSEE Signal Processing Toolbox >> FOSSEE Signal Processing Toolbox > cplxreal

cplxreal

Function to divide vector z into complex and real elements, removing the one of each complex conjugate pair.

Calling Sequence

[zc, zr] = cplxreal (z, thresh)
[zc, zr] = cplxreal (z)
zc = cplxreal (z, thresh)
zc = cplxreal (z)

Parameters

z:

vector of complex numbers.

thresh:

tolerance for comparisons.

zc:

vector containing the elements of z that have positive imaginary parts.

zr:

vector containing the elements of z that are real.

Description

This is an Octave function. Every complex element of z is expected to have a complex-conjugate elsewhere in z. From the pair of complex-conjugates, the one with the negative imaginary part is removed. If the magnitude of the imaginary part of an element is less than the thresh, it is declared as real.

Examples

[zc, zr] = cplxreal([1 2 3+i 4 3-i 5])
zc =  3 + 1i
zr =
1   2   4   5

Report an issue
<< corrmtx FOSSEE Signal Processing Toolbox cpsd >>