y[n] = b0x[n] +b1x[n-1]
I have this MA filter in matlab as following
load handel; x = y; b0 = 0.5; b1 = 0.5; N = length(x); % Length of input signal y = zeros(1,20); % Allocate space for output y(1) = b0*x(1); % First sample, assuming x(0) = 0 for n=2:N % Remaining samples y(n) = b0*x(n) + b1*x(n-1); end; soundsc(y,Fs);
I was asked to create an input signal
x[n] = dirac[n] where i save the
n = 0...19 in a vector and plot both signals in the same window for
axis ([-1 20 ,0 1.5]).
I have tried so far that the new signal should look like this
y1(n) = b0*dirac(n) + b1*dirac(n-1) but not sure if this is the right way or I maybe just not understood something?