idresamp
Resample time-domain data by decimation or interpolation
Syntax
datar = idresamp(data,R)
datar = idresamp(data,R,order,tol)
[datar,res_fact] = idresamp(data,R,order,tol)
Description
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
data
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.
R
Resampling factor, such that
R>1
results in decimation andR<1
results in interpolation.Any positive number you specify is replaced by the rational approximation,
Q/P
.order
Order of the filters applied before interpolation and decimation.
Default:
8
tol
Tolerance of the rational approximation for the resampling factor
R
.Smaller tolerance might result in larger
P
andQ
values, which produces more accurate answers at the expense of slower computation.Default:
0.1
Output Arguments
datar
Name of the resampled data variable.
datar
class matches thedata
class, as specified.res_fact
Rational approximation for the specified resampling factor
R
and tolerancetol
.Any positive number you specify is replaced by the rational approximation,
Q/P
, where the data is interpolated by a factorP
and then decimated by a factorQ
.
Version History
Introduced in R2007a