How do I write the code in order to get the impluse response for the following equation: y[n]=x[n]+x[n-1]+x[n-2]
Neeta Dsouza answered .
2025-11-20
TRY THIS:
f=100;% frequanecy fs=1000; n=[1:1000]*f/fs; u=ones(n,1) x(n)=2*cos(0.5*pi*n).u(n); % ~ (check indexes im not sure ..) y(n)=x(n(3:1000))+x(n(2:999))+x((1:998))