Main Content

idresamp

Resample time-domain data by decimation or interpolation

Syntax

datar = idresamp(data,[P Q])
datar = idresamp(data,R)
datar = idresamp(___,opt)
[datar,res_fact] = idresamp(___)

Description

idresamp resamples time-domain data using two different methods, one which uses Signal Processing Toolbox™ and one which does not.

  • If you have Signal Processing Toolbox, it is recommended that you use one of the syntaxes that has [P,Q] as the second argument. The software automatically uses the resampling algorithm from that toolbox.

  • If you do not have Signal Processing Toolbox, then the software automatically uses the resampling algorithm from System Identification Toolbox™ regardless of which syntax you use.

datar = idresamp(data,[P Q]) resamples the data data at P/Q times the original sample rate and returns the resampled data as datar. data can be a timetable, a comma-separated pair of numeric matrices, or an iddata object. The algorithm takes into account the intersample characteristics of the input signal that are described by the InputInterSample property in idresampOptions.

datar = idresamp(data,R) resamples data using a sample time that is a factor R of the original sample interval. This syntax does not require Signal Processing Toolbox

datar = idresamp(___,opt) incorporates an option set opt that specifies options in idresampOptions such as filter order, rational approximation tolerance, and input intersample behavior. You can use this syntax with any of the previous input-argument combinations.

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

Input Arguments

data

Time-domain signal data. data can be uniformly sampled input-output or time-series data in the form of a timetable, a comma-separated pair of numeric matrices u,y, or an iddata object.

[P,Q]

Vector of two positive integers that represent the interpolation and decimation factors that combine to form the sample rate multiplier P/Q (or equivalently, the sample time multiplier Q/P).

Setting Q/P > 1 results in decimation and setting Q/P < 1 results in interpolation.

opt

Resampling options, specified as an idresampOptions option set.

Output Arguments

datar

Name of the resampled data variable. datar has the same format (timetable, matrix or data object) as data.

res_fact

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

expand all