diff --git a/Mustonen_Exec2_T2.m b/Mustonen_Exec2_T2.m index c732e6e48376e9089ba796ec408745bd8d026b9e..7982fa65363e136ec6558c765852d1034a4a1137 100644 --- a/Mustonen_Exec2_T2.m +++ b/Mustonen_Exec2_T2.m @@ -1,6 +1,22 @@ -bk = [0,0,2,0,-1,0,2]; -x= @(n) -7*(n-3); -y = conv(bk, x); +% FIR filter coefficients +bk = [0, 0, 2, 0, -1, 0, 2]; -figure; -stem(x); \ No newline at end of file +% Input signal +n = 0:10; +x = 7 * (n - 3 == 0); + +% Convolution to calculate output +output = conv(x, bk); + +% Plotting +subplot(2,1,1); +stem(n, x); +title('Input Signal'); +xlabel('Sample'); +ylabel('Amplitude'); + +subplot(2,1,2); +stem(output); +title('Output Signal'); +xlabel('Sample'); +ylabel('Amplitude'); \ No newline at end of file