Resample data by interpolation and decimation.
Syntax
zr = idresamp(z,R)
[zr, R_act] = idresamp(z,R,filter_order,tol)
Description
z : The data to be resampled. Each column of z contains a signal.
zr : The resampled data. The columns of zr correspond to those of z.
R : The resampling factor. The new data record will correspond to a new sampling interval of R times the original one. R > 1 thus corresponds to decimation and R < 1 corresponds to interpolation. Any positive real number for R is allowed, but it will be replaced by a rational approximation (R_act).
R_act : The actually achieved resampling factor.
filter_order: The order of the presampling filters used before interpolation and decimation. Default is 8.
tol : The tolerance in the rational approximation of R. Default is 0.1.
Algorithm
The resampling factor is first approximated by a rational number by [num,den] = rat(R,tol). The data are then interpolated by a factor den and then decimated by a factor num. The interpolation and decimation are preceded by prefiltering, and follow the same algorithms as in the routines interp and decimate in the Signal Processing Toolbox.
Caution
For signals that have much energy around the Nyquist frequency (like piece-wise constant inputs), the resampled waveform may look "very different," due to the prefiltering effects. The frequency and information contents for identification is, however, not mishandled.
Example
Resample by a factor 1.5 and compare the signals.
plot(t,u)
[ur,ra] = idresamp(u,1.5);
plot(t,u,ra*t,ur)
[ Previous | Help Desk | Next ]