# Effect of sampling

I have this continuos-time system

$$\dot{x}=Ax+Bu$$

where

$$A=\begin{bmatrix}0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 1 \\ 0 & \phantom{0}2.8040 & -\phantom{0}5.2658 & 0 \\ 0 & 18.5885 & -19.6959 & 0 \end{bmatrix}, \quad B=\begin{bmatrix}0 \\ 0 \\ 3.7629 \\ 5.5257 \end{bmatrix}$$

With the MATLAB function c2d, I have calculated the relative ZOH discretization ($C=[1\, 0\, 0\, 0]$ and $D=0$) for $T_s=4\omega_b\approx0.005\text{ s}$, where $\omega_b$ is the bandwidth of the system, and I have found that the discrete-time impulse response is not equal in respect to the continuos-time impulse response at the sampling instants. I can't explain this effect. Believing that was a numerical problem, I've tried to discretize the system with greater sampling times, and the results, showed in the figure below, was worse.

The code that I have used is

A=[0 0 1 0; 0 0 0 1; 0 2.8040 -5.2658 0; 0 18.5885 -19.6959 0];
B=[0 0 3.7629 5.5257]';
sys1=ss(A,B,[1 0 0 0],0);
sys2=c2d(sys1,0.005);
sys3=c2d(sys1,0.05);
sys4=c2d(sys1,0.5);
impulse(sys1,5/7);
hold on
impulse(sys2,5/7);
hold on
impulse(sys3,5/7);
hold on
impulse(sys4,5/7);

• without knowing any better, I'd say your doing something wrong with the matlab functions you're using. But since you don't share your code, that's not clear. – Marcus Müller Mar 5 '17 at 6:58

The case for $T=0.005$ms looks pretty close, but it's hard to tell from the image.
If $T_s = 0.005{\rm ms} = 4\omega_b$ then making the sample period $T_s= 0.05$ms will cause aliasing, which will definitely make things worse.
Try making $T_s = 0.001$ms and see what happens.