MATLAB: Is the frequency response of the continuous time system different than the discretized system, when I use the ‘imp’ (Impulse Invariant method) option in the C2D function in the Control System Toolbox

c2dControl System Toolboximpimpulseinvariant

I was trying to obtain a discrete system from a continuous system using the C2D function. I used the 'imp' option (Impulse Invariant method) to obtain the discrete system. The frequency responses of the continuous system and the discretized system obtained using this method do not match. The mismatch between the frequency responses seems to be a function of the sampling time. The reference documentation for the C2D function is missing information on the 'imp' option.

Best Answer

This bug has been fixed in Release 14 Service Pack 3 (R14SP3). For previous product releases, read below for any possible workarounds:
The Impulse Invariant discretization method implemented in the C2D function with the 'imp' option is such that the impulse responses for the continuous system and the obtained discretized system match. 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
figure
impulse(sc,sd1)
However the frequency responses for the systems may not match due to the scaling factor (the sampling time). For example,
figure
bode(sc,0.01*sd1) % scaled by Ts
Thus, the Impulse Invariant method is a good choice if the same impulse response is desired. It may not be a good choice for obtaining the same frequency response, since it is susceptible to aliasing. In general, a bilinear transform (such as 'tustin') is a better choice for obtaining a discretized system with matching frequency response. For example,
bode(sc,c2d(sc,0.01,'tustin'),c2d(sc,0.2,'tustin'),c2d(sc,0.5,'tustin'))
To obtain similar frequency responses between the continuous and discretized systems with the Impulse Invariant method, adjust the scaling factor in the C2D function inputs. Matching frequency responses for the continuous and discretized systems can then be obtained as shown in the following code:
Ts=[0.1 0.01 0.001];
n=1;d=[1 1];
sc=ss(tf(n,d));
sd1=c2d(sc*Ts(1),Ts(1),'imp');
sd2=c2d(sc*Ts(2),Ts(2),'imp');
sd3=c2d(sc*Ts(3),Ts(3),'imp');
bode(sc,sd1,sd2,sd3,{0.01,100});