% Sami Arica. March 24, 2014 % Plot of impulse and step response of the following LTI-causal system % d^(2)/dt^(2) y(t) + 2 d/dt y(t) + 5 y(t) = x(t) t = -1:0.01:10; h = zeros(size(t)); s = zeros(size(t)); k = t > 0; h(k) = 1/2 * exp(-t(k)) .* sin(2*t(k)); s(k) = 1/5 - 1/5 * exp(-t(k)) .* cos(2*t(k)) - 1/10 * exp(-t(k)) .* sin(2*t(k)); plot(t, h, 'k', 'LineWidth',2); axis([-1, 10, -0.1 0.3]) text(3,0.15,'d^{2}/dt^{2} y(t) + 2 d/dt y(t) + 5 y(t) = x(t)',... 'HorizontalAlignment','left') xlabel('t [second]') ylabel('h(t)') title('The impulse response'); plot(t, s, 'k', 'LineWidth',2); axis([-1, 10, -0.1 0.3]) text(3,0.1,'d^{2}/dt^{2} y(t) + 2 d/dt y(t) + 5 y(t) = x(t)',... 'HorizontalAlignment','left') xlabel('t [second]') ylabel('s(t)') title('The step response');