Command "impulse" behaving weird

7 views (last 30 days)
A M
A M on 24 Jan 2011

I tried the following code

a=1;
b=[1 1];
impulse(a,b,'r');
hold on
Ts=0.001;
sys=c2d(tf(a,b),Ts,'zoh');
impulse(sys)

It seems to give me different results which is causing a scaling with respect to Ts.

If I try the following code, plots appear normal. I will like to get some insight into this apparent anomaly.

a=1;
b=[1 1];
impulse(a,b,'r');
hold on
Ts=0.001;
sys=c2d(tf(a,b),Ts,'zoh');
impulse(sys/Ts)

Answers (1)

Paulo Silva
Paulo Silva on 24 Jan 2011
You can find information about it by searching for Impulse Invariance in your MATLAB documentation:
The impulse invariant mapping matches the discretized impulse response to that of the continuous time system. For example:
n=1;d=[1 1]; % Simple 1st order continuous system
sc=ss(tf(n,d)); % state space representation
sd1=c2d(sc,0.01,'imp'); % Convert to discrete system via impulse
% invariant
impulse(sc,sd1) % Plot both impulse responses
Note that the impulse responses match. The frequency responses do not match, however, because of scaling factor Ts, the sample time. For example,
bode(sc,0.01*sd1) % scaled by Ts
Although the impulse invariant transform is ideal when you are interested in matching the impulse response, it may not be a good choice if you are interested in matching the frequency response of the continuous system, because it is susceptible to aliasing. For example,
sd2=c2d(sc,0.2,'imp');
sd3 = c2d(sc,0.5,'imp');
bode(sc,0.01*sd1, 0.2*sd2, 0.5*sd3)
As the sampling time increases, you can see the effects of aliasing. In general, if you are interested in matching the frequency response of the continuous system, a bilinear transform (such as Tustin Approximation) is a better choice. For example, using the tustin bilinear transform for the same example,
bode(sc,c2d(sc,0.01,'tustin'))
c2d(sc,0.2,'tustin')
c2d(sc,0.5,'tustin'))
you can see that aliasing is no longer an issue.
See any standard text in digital signal processing for a discussion of impulse invariance scaling issues and aliasing.

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!