linear convolution of discrete time sequence

2 Ansichten (letzte 30 Tage)
Aniket Jadhav
Aniket Jadhav am 28 Nov. 2022
Beantwortet: Aniket Jadhav am 28 Nov. 2022
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")

Akzeptierte Antwort

Aniket Jadhav
Aniket Jadhav am 28 Nov. 2022
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")

Weitere Antworten (0)

Kategorien

Mehr zu GPU Computing finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by