Resample

Shipping
resample

Change signal sample rate using sinc anti-aliased resampling

Signature

Inputs

  • signalSignalrequired

Outputs

  • resultSignal

Parameters

KeyTypeDefaultNotes
target_ratefloat1000.0Hz

Description

Resample converts a signal from its native sample rate to a new rate target_rate (, in Hz) using sinc-based, anti-aliased interpolation. It takes one signal input and produces one result signal carrying the same physical unit but a new time base defined by . The output length scales by the rate ratio: an -sample input becomes approximately samples.

The core is bandlimited interpolation: each output sample is reconstructed from a windowed kernel over neighboring input samples. On downsampling () the kernel cutoff is lowered to the new Nyquist frequency , suppressing frequencies that would otherwise alias. On upsampling () the kernel interpolates between existing samples without adding spectral content above the original Nyquist.

Unit is preserved unchanged — resampling is purely a time-axis operation and does not touch the sample magnitude dimension. The uncertainty () channel is propagated through the same linear interpolation weights; because each output sample is a weighted sum of input samples, correlated smoothing of the sigma field is expected rather than independent-error scaling.

This node is stateless: each evaluation resamples its input block independently with no carried filter memory or phase accumulator between calls. target_rate is constrained to Hz.

Mathematics

Examples

Downsample 48 kHz audio to 16 kHz

Feed a 48000 Hz recording and set target_rate = 16000. The sinc kernel cutoff drops to (the new Nyquist), removing content between 8 and 24 kHz before decimation so no aliasing folds into the retained band.

signal (48 kHz)  ->  resample[target_rate = 16000]  ->  result (16 kHz)

Align two sensor streams

A pressure sensor logs at and a thermocouple at . Resample both to a common target_rate = 100 so they share a time base before combining in a formula or math_operator node. Units (Pa, K) pass through unchanged.

Applications

  • Rate conversion between audio/telemetry devices with incompatible clocks (e.g. 44.1 kHz to 48 kHz).
  • Bringing asynchronous multi-sensor data onto a common sampling grid before fusion or correlation.
  • Decimating high-rate acquisition to a lower rate for storage or display while avoiding aliasing artifacts.
  • Upsampling for smoother plotting or to match the fixed step of a downstream simulation solver.

Neat

Anti-alias cutoff is tied to the smaller of source and target Nyquist, so a single node does the right thing for both up- and downsampling without a mode switch.

Because it is stateless per block, chaining resample with itself (e.g. up then down) is not lossless — each pass applies its own finite sinc window and window edge effects.

Known issues

Finite kernel support causes transient artifacts near the first and last samples where the sinc window extends beyond the available data; edge samples are less accurate than interior ones.

Non-integer rate ratios ($f_t/f_s$ irrational) yield a fractional output length that is rounded, so round-trip resampling rarely returns exactly the original sample count.

See also

resamplingsample-rateanti-aliasingsincinterpolationsignal-processing