Main Content


Resample time-domain data by decimation or interpolation


datar = idresamp(data,R)
datar = idresamp(data,R,order,tol)
[datar,res_fact] = idresamp(data,R,order,tol)


datar = idresamp(data,R) resamples data on a new sample interval R and stores the resampled data as datar.

datar = idresamp(data,R,order,tol) filters the data by applying a filter of specified order before interpolation and decimation. Replaces R by a rational approximation that is accurate to a tolerance tol.

[datar,res_fact] = idresamp(data,R,order,tol) returns res_fact, which corresponds to the value of R approximated by a rational expression.

Input Arguments


Name of time-domain iddata object or a matrix of data. Can be input-output or time-series data.

Data must be sampled at equal time intervals.


Resampling factor, such that R>1 results in decimation and R<1 results in interpolation.

Any positive number you specify is replaced by the rational approximation, Q/P.


Order of the filters applied before interpolation and decimation.

Default: 8


Tolerance of the rational approximation for the resampling factor R.

Smaller tolerance might result in larger P and Q values, which produces more accurate answers at the expense of slower computation.

Default: 0.1

Output Arguments


Name of the resampled data variable. datar class matches the data class, as specified.


Rational approximation for the specified resampling factor R and tolerance tol.

Any positive number you specify is replaced by the rational approximation, Q/P, where the data is interpolated by a factor P and then decimated by a factor Q.

Version History

Introduced in R2007a

See Also