Split Re / Im

Shipping
complex_unpack

Split a complex array into its real and imaginary parts (inverse of complex_pack)

Signature

Inputs

  • zArray|Complex|ScalarrequiredA complex (or real) array/scalar. A real input yields an all-zero imaginary output.

Outputs

  • reArrayReal component, carrying z's unit.
  • imArrayImaginary component (zeros for a real input), carrying z's unit.

Description

Split Re / Im decomposes a complex array into two real arrays on the re and im ports — the exact inverse of Complex (Re + Im) (complex_pack). Because a Captyse complex array is stored structure-of-arrays, unpacking simply exposes the two underlying f64 columns as first-class real arrays.

Both outputs inherit z's physical unit. A real input is handled gracefully: the re output is the data itself and the im output is an array of zeros the same length — the imaginary part is treated as zero rather than fabricated or errored. The node is stateless.

Mathematics

Examples

Extract quadrature components

Feed a complex FFT output into z. The re port gives the cosine (in-phase) component and im gives the sine (quadrature) component, ready for separate plotting or arithmetic.

Applications

  • Separating a complex spectrum into real and imaginary channels for independent inspection or filtering.
  • Recovering I and Q streams from a packed complex baseband signal.
  • Feeding real-only downstream nodes that cannot consume complex arrays directly.

Neat

Output port order is contractually [re, im] — the executor returns the two real buffers in that exact order to line up with the registered output ports.

A real input never fails: it unpacks to (data, zeros), so the node doubles as a way to attach an explicit zero imaginary channel.

See also

complexsplitunpackiqstateless