SystemML Class
std/2009/resample/numeric
Summary
Resampler for numeric data
Status
Stable

Overview

Resampler for numeric data. Zeroth-order resampling introduces no delay, whereas first-order resampling necessarily introduces a delay of one input sample period.

Notes

One resampling process can resample as many streams as you plug into it, but they must have different names or an error will be generated. You can achieve this with code of the sort below.

M Source Code (against 995)
% if the output names you plug in are different sys = sys.link('a>a', 'resamp'); sys = sys.link('b>b', 'resamp'); % if the output names you plug in are the same sys = sys.link('a>out', 'resamp<a'); sys = sys.link('b>out', 'resamp<b');

Connectivity

  • N inputs, the source data streams.
  • N outputs, the resampled data streams.

State

This Process stores its State in DataML.

order (UINT32 scalar)
Resampling order, must be zero (default) or one.
zero (BOOLEAN scalar)
If true (default), undefined samples (at the beginning of the output stream) are set to zero; if false, these are set to NaN.

Example

Script

M Source Code (against 995)
fS = 20; fS2 = 30; sys = sml_system; state = []; state.data = 1:10; state.repeat = true; sys = sys.addprocess('src', 'std/2009/source/numeric', fS, state); state = []; state.order = 1; state.zero = false; sys = sys.addprocess('resamp', 'std/2009/resample/numeric', fS2, state); sys = sys.link('src>out', 'resamp', 0); exe = brahms_execution; exe.all = true; exe.stop = 1; out = brahms(sys, exe); % first order introduces a delay of one input sample period... figure(1) clf hold on plot((0:fS-1)/fS, out.src.out) plot((0:fS2-1)/fS2 - (1/fS), out.resamp.out, 'r.') xlabel('time (seconds)')

Expected Output