linear convolution of discrete time sequence

2 ビュー (過去 30 日間)
Aniket Jadhav
Aniket Jadhav 2022 年 11 月 28 日
回答済み: Aniket Jadhav 2022 年 11 月 28 日
clc;
clear;
x=[9,8,7,6,5,4];
h=[1,2,3,4];
L= length(x);
M = length(h);
N = L+M-1;
X=[x,zeros(1,N-L)];
H=[h,zeros(1,N-M)];
for i=1:1:N
Y(i)=0;
for j=1:1:i
Y(i)= Y(i)+H(i-j+1).*X(j);
end
end
x;
h;
Y;
Y2=conv(x,h)
subplot(4,1,1);
stem(x);
xlabel('Elements in x');
ylabel('First graph');
subplot(4,1,2);
stem(h);
xlabel('Elements in h');
ylabel('Second graph');
subplot(4,1,3);
stem(Y);
xlabel('Elements in Y');
ylabel('Third graph');
subplot(4,1,4)
stem(Y2)
xlabel("elements in Y2")
ylabel("Fourth graph")

採用された回答

Aniket Jadhav
Aniket Jadhav 2022 年 11 月 28 日
clc;
clear;
x=[9,8,7,6,5,4];
h=[1,2,3,4];
L= length(x);
M = length(h);
N = L+M-1;
X=[x,zeros(1,N-L)];
H=[h,zeros(1,N-M)];
for i=1:1:N
Y(i)=0;
for j=1:1:i
Y(i)= Y(i)+H(i-j+1).*X(j);
end
end
x;
h;
Y;
Y2=conv(x,h)
subplot(4,1,1);
stem(x);
xlabel('Elements in x');
ylabel('First graph');
subplot(4,1,2);
stem(h);
xlabel('Elements in h');
ylabel('Second graph');
subplot(4,1,3);
stem(Y);
xlabel('Elements in Y');
ylabel('Third graph');
subplot(4,1,4)
stem(Y2)
xlabel("elements in Y2")
ylabel("Fourth graph")

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGPU Computing についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by