Unpack / Demultiplexer

Shipping
unpack

Split one SignalBundle back into N individual signals

Signature

Inputs

  • bundleSignalBundle|Signal

Outputs

  • out0Signal
  • out1Signal
  • out2Signal
  • out3Signal
  • out4Signal
  • out5Signal
  • out6Signal
  • out7Signal
  • out8Signal
  • out9Signal
  • out10Signal
  • out11Signal
  • out12Signal
  • out13Signal
  • out14Signal
  • out15Signal

Description

Unpack (Demultiplexer / Demux) is the inverse of pack: it splits a single SignalBundle bus back into its constituent channels, routing each to an individual Signal output port. It exposes up to 16 fan-out ports (out0out15); channel of the incoming bundle appears at outk, with the ordering matching the bundle's internal channel index.

Unpacking is lossless and metadata-preserving. Because a SignalBundle stores each channel as an independent Signal, every extracted output retains its own timestamps, sample_rate, physical unit, and per-sample uncertainty (). No resampling, alignment, or unit reconciliation is performed — the node is a pure routing / structural operation and applies no numerical transform.

The single input port accepts either a SignalBundle or a bare Signal. Given a plain Signal, that signal is passed through to out0 and the remaining outputs stay unwired. Ports beyond the channel count of the bundle produce no output. The node is stateless: outputs depend only on the current input, with no history across simulation blocks.

Mathematics

Examples

Splitting a stereo bus

A pack node muxes a left and right microphone channel into one bundle. Feeding that bundle into unpack recovers the two independent signals:

audio_source ─▶ pack.in0 ┐
                          ├─▶ bundle ─▶ unpack ─▶ out0 (left,  Pa, σ_L)
audio_source ─▶ pack.in1 ┘                       └─▶ out1 (right, Pa, σ_R)

Each output keeps its own unit () and standard deviation, ready for independent fft or statistics processing.

Per-channel metrology from a hardware bus

A hardware_source emits an 8-channel bundle of DAQ readings. A single unpack breaks it into out0…out7, letting you attach a distinct scale_offset calibration to each strain-gauge channel while preserving its individual for downstream error propagation.

Applications

  • Recovering individual sensor channels from a multiplexed DAQ or hardware acquisition bus for per-channel calibration and analysis.
  • De-interleaving stereo or multi-channel audio into separate processing chains (filtering, FFT, level metering).
  • Fanning out a bundled simulation bus so that each state variable drives its own plot, sink, or comparator.
  • Bridging bundle-native native sources into node-graph operators that consume plain Signals, one channel per branch.

Neat

A bare `Signal` fed to the bundle input is transparently routed to `out0`, so unpack doubles as a safe pass-through even when no real bundle is present.

Because channels are stored as reference-counted Arcs, unpacking clones pointers rather than sample data — fan-out to 16 outputs is effectively O(1) in memory regardless of signal length.

Known issues

Channels beyond the bundle's actual count produce no output; wiring `out5` from a 3-channel bundle leaves that branch silent rather than raising an error.

Channel-to-port mapping is strictly positional by internal index — if the upstream `pack` order changes (or nested bundles were flattened), output assignments shift accordingly.

See also

demultiplexerbundleroutingchannelsmultichannelstateless