Find the impulse response h[n] for a causal LTI discrete-time systems satisfying the given
difference equations and indicate whether the system is a FIR or an IIR system.
y[n] + y[n - 1] = x[n] - 2x [n - 1]
% IIR response impulse response
% y[n] + y[n - 1] = x[n] - 2x * [n - 1]
% Or
% y[n] = x[n] - 2x * [n - 1] - y[n - 1]
y=[];
x=0:1:10;
y(1)=0;
for n=2:1:length(x)
y(n) = x(n) - 2*x(n - 1) - y(n-1);
end
scrsz = get(0,'ScreenSize');
Dim=0;
figure('Position',[scrsz(1)+Dim, scrsz(2)+Dim,scrsz(3)-20,scrsz(4)-100]);
subplot(1,2,1);
plot(x,y);
grid on,
xlabel('--- x --->');
ylabel('y(n) = x(n) - 2*x(n - 1) - y(n-1)');
title('Plot: y(n) = x(n) - 2*x(n - 1) - y(n-1)','FontSize',20);
subplot(1,2,2);
impz(y);
grid on,
Comments
Leave a comment