N=50;
x=ones(1,N);
b=[1 0 -0.25];
a=[1 -0.5];
y=filter(b,a,x);
n=0:N-1;
figure;
subplot(2,1,1);
stem(n,x,'filled');
title('input:step signal x(n)');
xlabel('n');ylabel('x(n)');
grid on;
subplot(2,1,2);
stem(n,y,'filled');
title('output:y(n)');
xlabel('n');
ylabel('y(n)');
grid on;

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: