Tile / Repeat
ShippingtileReplicate a Signal or Vector reps times, whole-array (tile) or per-element (repeat)
Signature
Inputs
aSignal|Vectorrequired— The signal or vector whose values are replicated.
Outputs
resultSignal|Vector— The replicated value, same variant as the input, of length `input_length × reps`.
Parameters
| Key | Type | Default | Notes |
|---|---|---|---|
reps | int | 2 | How many times the input is replicated (clamped to ≥ 1). Output length is always input_length × reps. |
mode | enum | tile | one of: tile, repeat |
Description
Tile / Repeat replicates an array's values reps times in one of two numpy modes:
- tile — concatenate the WHOLE array
repstimes:[1,2]→[1,2,1,2](numpynp.tile). - repeat — repeat EACH element
repstimes in place:[1,2]→[1,1,2,2](numpynp.repeat).
This is a pure reindexing op: every output sample is a verbatim copy of some input sample, picked by an index map. That makes σ² propagation exact — the output carries the source sample's variance under the same index map (None stays None; σ is never fabricated). Units are preserved unchanged (replication is dimensionless).
For a Signal, the replicated values get a fresh continuous, strictly-monotonic timestamp grid of the new length. The sample step is extrapolated from the source (explicit sample_rate ⟹ ; else the mean timestamp spacing; else ) and the samples are laid end-to-end at . Both modes therefore produce a gap-free, uniformly-spaced axis — the natural reading of "the same waveform, longer" (tile) and "time-stretched" (repeat). sample_rate is preserved. reps is clamped to ≥ 1: reps = 0 (which numpy allows but almost always in error here) is treated as a no-op rather than silently emptying the array.
Mathematics
Examples
Tile whole array
reps=2, mode=tile on [1,2] → [1, 2, 1, 2] (numpy np.tile([1,2], 2)).
Repeat each element
reps=2, mode=repeat on [1,2] → [1, 1, 2, 2] (numpy np.repeat([1,2], 2)). This is a zero-order-hold time stretch.
σ² rides the index map
Tiling [1,2] (σ² [0.1, 0.2]) with reps=2 gives values [1,2,1,2] and σ² [0.1, 0.2, 0.1, 0.2] — each output sample keeps its source variance.
Applications
- Looping a captured buffer end-to-end to build a longer periodic test signal (tile).
- Zero-order-hold upsampling / staircase interpolation of a coarse series (repeat).
- Generating a repeating pattern or tiled reference waveform for correlation.
- Building fixed-length padding-by-repetition for downstream length matching.
Neat
A single source-index map of length `n * reps` drives values, variances and (by count) the timestamp grid, so the three arrays stay perfectly coherent.
A malformed σ² array (length ≠ values) is dropped rather than gathered out of bounds — the node never misaligns uncertainty.
`reps = 0` is clamped to 1 as a deliberate deviation from numpy: silently emptying an array is almost always a wiring mistake, so a no-op is the less surprising choice.
Known issues
The output timestamps are a fresh uniform grid, not the source timestamps repeated — so an intentionally non-uniform input axis is regularised on the inferred dt.
Only 1-D arrays take the Vector path; a higher-rank Array input is a type mismatch.