SystemML Class
Resampler for numeric data


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


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 ='a>a', 'resamp'); sys ='b>b', 'resamp'); % if the output names you plug in are the same sys ='a>out', 'resamp<a'); sys ='b>out', 'resamp<b');


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


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.



M Source Code (against 995)
fS = 20; fS2 = 30; sys = sml_system; state = []; = 1:10; state.repeat = true; sys = sys.addprocess('src', 'std/2009/source/numeric', fS, state); state = []; state.order = 1; = false; sys = sys.addprocess('resamp', 'std/2009/resample/numeric', fS2, state); sys ='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