x1 = [3 11 7 0 -1 4 2];
x2 = [2 3 0 -5 2 1];
x1z = [zeros(1,length(x2)-1) x1 zeros(1,length(x2)-1)];
for i = 1 : length(x1) + length(x2) - 1;
y(i) = sum(x1z(i : i+length(x2)-1) .* fliplr(x2));
end
y
x1 = [3 11 7 0 -1 4 2];
n1 = -3 : 3;
x2 = [2 3 0 -5 2 1];
n2 = -1 : 4;
m1 = length(x1);
m2 = length(x2);
clear y n
for j = 1 : m1 + m2 - 1;
sum = 0;
for k = 1 : m2
if ((j + k - m2) >= 1) & ((j + k - m2) <= m1)
sum = sum + x1(j + k - m2) .* x2(m2 - k + 1);
end
end
y(j) = sum;
n(j) = n1(1) + n2(1) + j - 1;
end
stem(n,y);
display(y);
display(n);
x1 = [3 11 7 0 -1 4 2];
n1 = -3 : 3;
x2 = [2 3 0 -5 2 1];
n2 = -1 : 4;
m1 = length(x1);
m2 = length(x2);
clear y n
x1z = [zeros(1,m2-1) x1 zeros(1,m2-1)];
for i = 1 : m1 + m2 - 1;
y(i) = sum(x1z(i : i+m2-1) .* fliplr(x2));
n(i) = n1(1) + n2(1) + i - 1;
end
stem(n,y);
display(y);
display(n);
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?