DynamicSystems
Resample
resample a discrete-time system object
Calling Sequence
Parameters
Options
Description
Examples
Compatibility
Resample(sys, T, opts)
sys
-
System; system object (discrete)
T
algebraic; new sampling time
opts
(optional) equation(s) of the form option = value; specify options for the Resample command
method = forward, backward, bilinear, prewarp, matched, zoh, or foh
Specifies the resampling method.
frequency = realcons
Specifies the warping or critical frequency in rad/s. This is used only if method = prewarp, otherwise it is ignored.
The Resample command resamples a discrete-time system sys, discretized with sampling time sys:-sampletime, to create an equivalent discrete-time system with new sampling time T.
The method option specifies the resampling method. The following methods are supported: forward rectangle rule (forward), backward rectangle rule (backward), bilinear rule (bilinear), bilinear with prewarping (prewarp), matched poles and zeros (matched), zero-order hold (zoh), and first-order hold or non-causal triangle-hold (foh).
The bilinear rule is also known as the Tustin or Trapezoid rule.
Not all resampling methods can be applied to all system types. The following table describes the usage. An x indicates that the method can be used by the system type. A D indicates that the method is the default for the system type.
System Type
forward
backward
bilinear
prewarp
matched
zoh
foh
State-Space
x
D
Transfer-Function
Coefficients
Zero-Pole-Gain
For details on the transformation methods, see the sections Frequency Domain Transformations and Time Domain Transformations in DynamicSystems[ToContinuous] and DynamicSystems[ToDiscrete].
with⁡DynamicSystems:
Resample a discrete-time transfer function with new sampling time 0.001 s
sys≔ZeroPoleGain⁡0.7,0.5,1,discrete,sampletime=0.01:
sys≔TransferFunction⁡sys:PrintSystem⁡sys
Transfer Functiondiscrete; sampletime = .1e-11 output(s); 1 input(s)inputvariable=u1⁡zoutputvariable=y1⁡ztf1,1=z−0.7000000000z−0.5000000000
New sampling time T
T≔0.001
The default method is bilinear when no method is specified.
sys_1≔Resample⁡sys,T:PrintSystem⁡sys_1
Transfer Functiondiscrete; sampletime = .1e-21 output(s); 1 input(s)inputvariable=u1⁡zoutputvariable=y1⁡ztf1,1=1.116129032⁢z−0.9653179191z−0.9354838710
Resampling with the original sampling time, we obtain the original discrete-time system.
sys_orig≔Resample⁡sys_1,0.01:PrintSystem⁡sys_orig
sys_2≔Resample⁡sys,T,method=forward:PrintSystem⁡sys_2
Transfer Functiondiscrete; sampletime = .1e-21 output(s); 1 input(s)inputvariable=u1⁡zoutputvariable=y1⁡ztf1,1=z−0.9700000000z−0.9500000000
sys_3≔Resample⁡sys,T,method=backward:PrintSystem⁡sys_3
Transfer Functiondiscrete; sampletime = .1e-21 output(s); 1 input(s)inputvariable=u1⁡zoutputvariable=y1⁡ztf1,1=1.327272727⁢z−0.9589041096z−0.9090909091
sys_4≔Resample⁡sys,T,method=prewarp,frequency=2:PrintSystem⁡sys_4
Transfer Functiondiscrete; sampletime = .1e-21 output(s); 1 input(s)inputvariable=u1⁡zoutputvariable=y1⁡ztf1,1=1.116129582⁢z−0.9653190438z−0.9354859315
sys_5≔Resample⁡sys,T,method=zoh:PrintSystem⁡sys_5
Transfer Functiondiscrete; sampletime = .1e-21 output(s); 1 input(s)inputvariable=u1⁡zoutputvariable=y1⁡ztf1,1=z−0.9598197951z−0.9330329923
sys_6≔Resample⁡sys,T,method=foh:PrintSystem⁡sys_6
Transfer Functiondiscrete; sampletime = .1e-21 output(s); 1 input(s)inputvariable=u1⁡zoutputvariable=y1⁡ztf1,1=1.135736061⁢z−0.9646218847z−0.9330329923
Compare the frequency responses of all the systems.
p0≔MagnitudePlot⁡sys,range=0.1..10,color=red,thickness=2,legend=discrete:
p1≔MagnitudePlot⁡sys_1,range=0.1..100,color=blue,legend=bilinear:
p2≔MagnitudePlot⁡sys_2,range=0.1..100,color=green,legend=forward:
p3≔MagnitudePlot⁡sys_3,range=0.1..100,color=cyan,legend=backward:
p4≔MagnitudePlot⁡sys_4,range=0.1..100,color=grey,legend=prewarp:
p5≔MagnitudePlot⁡sys_5,range=0.1..100,color=magenta,legend=zoh:
p6≔MagnitudePlot⁡sys_6,range=0.1..100,color=black,legend=foh:
plotsdisplay⁡p0,p1,p2,p3,p4,p5,p6
The DynamicSystems[Resample] command was introduced in Maple 18.
For more information on Maple 18 changes, see Updates in Maple 18.
See Also
DynamicSystems[SystemOptions]
DynamicSystems[ToContinuous]
DynamicSystems[ToDiscrete]
Download Help Document