Resample time-domain data that is stored in an
by decimation or interpolation (requires Signal Processing Toolbox software)
Resample Time-Domain Data
Increase the sampling rate of data and compare the resampled and the original data signals.
idinput to generate an input signal
u that contains 2 periods, each containing 20 samples, of a sum-of-sinusoids signal with 5 sinusoids.
u = idinput([20 1 2],'sine',,,[5 10 1]); plot(u)
u into an
ui. Set the start time to
0. A sum-of-sinusoids signal is band limited, so set
ui = iddata(,u,1,'tstart',0,'intersample','bl');
Resample the data using factors of 25 and 3 for
Q, respectively. These values produce an increase in sample rate of about 8.3.
ur = resample(ui,25,3); plot(ui,ur) legend('ui','ur')
The resampled signal is smoother than the original signal.
data — Original data
Original data, specified as an
iddata that contains either
input/output data or time series data.
contain uniform time samples.
P,Q — Resampling factor terms
Resampling factor terms, specified as integers that represent the
interpolation and decimation factors. After resampling, the new sample time
Q/P times the original sample time.
(Q/P)>1 results in decimation and setting
(Q/P)<1 results in interpolation.
order — Order of FIR filter
10 (default) | positive integer
Order of the FIR filter that
resample applies before
interpolation and decimation, specified as a positive integer.
resample calls the
resample (Signal Processing Toolbox) function in Signal Processing Toolbox™. The algorithm takes into account the intersample characteristics of the
input signal that are described by the
If you do not have a license for Signal Processing Toolbox, perform resampling using
Introduced before R2006a