Chapter 2 Linear System Representation
Xmath Control Design Module 2-16 ni.com
The exponential keyword assumes that the response value between
samples is constant and can, therefore, be represented by a zero-order hold
polynomial. When exponential is specified, the continuous-time step
response is discretized usin g th e Z-transform, then the result is
divided by the Z-transform of a step z/(z–1) to produce the desired
transfer function.
The firstorder keyword assumes extrapolation between samples
(connecting sample to sample in a straight line). If firstorder is
specified, the continuous-time ramp response is discretized using the
Z-transform and then the result is divided by the Z-transform of a ramp
z*dt/(z– 1)2 to produce the desired transfer function.
In each of these cases, the appropriate response (impulse, step, or ramp)
will match the continuous response very closely, with the only error being
round off error.
While no one method of discretization will always perform best for all
systems and all sampling times, it is often a good idea to compare the
frequency response resulting from different discretized models to the
continuous response. Example 2-9 applies the forward, backward, tustins,
exponential, and matched pole-zero discretization methods.
Example 2-9 A Comparison of Several Discretization Methods
H = system(0.5*polynomial([-0.36]),
makepoly([1,2.79,2.74,1.11,0.16]));
Create a logspaced vector for the frequency range of the response:
F = logspace(.001,5,200);
Perform the discretization using the different algorithms:
Hd_f = discretize(H,0.1,{forward});
Hd_b = discretize(H,0.1,{backward});
Hd_t = discretize(H,0.1,{tustins});
Hd_z = discretize(H,0.1,{polezero});
Hd_e = discretize(H,0.1,{exponential});
Now you can calculate the magnitude response as a function of frequency,
gainc = 20*log10(abs(freq(H,F)));
gain_f = 20*log10(abs(freq(Hd_f,F)));
gain_b = 20*log10(abs(freq(Hd_b,F)));
gain_t = 20*log10(abs(freq(Hd_t,F)));