clear all; clc;

b = [1 -1];
a = 1;
n = 0:1:100;

x = (sin(pi*n/25)).*[(n>=0) - (n>=100)]; %sinusoidal pulse
y = filter(b,a,x);
figure;

subplot(211);
stem(n,x);
xlabel('n'); ylabel('x(n)');
grid on;
title('Sinusoidal input');

subplot(212);
stem(n,y);
xlabel('n'); ylabel('y(n)');
grid on;
title('Output x(n)');