clear all;
function u = unitStep(n)
u = n>=0;
end
n = -10:1:10
stem(n,unitStep(n)./2,"filled");
title("Compressing a signal by a factor of 2");
xlabel("n");
ylabel("Amplitude");
grid on;
axis([-11 11 -2.5 2.5]);
To embed this project on your website, copy the following code and paste it into your website's HTML: