How to make convolution on sinc function and square function
17 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
tata tutu
il 9 Giu 2019
Commentato: tata tutu
il 9 Giu 2019

this is my code
t = -10:0.001:10;
h = sin(pi*t)./(pi*t);
t1=-10:0.01:-1;
t2=-1:0.01:1;
t3=1:0.01:10;
t4=[t1 t2 t3];
x1=zeros(size(t1));
x2=ones(size(t2));
x3=zeros(size(t3));
x=[x1 x2 x3];
c=conv(h,x);
hold on;
subplot(3,1,1);
plot(t,h)
stem(t,h,'g');
hold on;
subplot(3,1,2);
plot(t4,x,'b');
stem(t4,x,'b')
hold on;
subplot(3,1,3);
plot(t,c,'r');
stem(t,c,'r')
hold off
:
But the figure for the convolution part is not come out. What should I do?
0 Commenti
Risposta accettata
KALYAN ACHARJYA
il 9 Giu 2019
Modificato: KALYAN ACHARJYA
il 9 Giu 2019
t=-10:.01:10;
y1=sinc(t);
y2=zeros(size(t));
y2(t>=-1 & t<=1)=1;
c=conv(y1,y2);
stem(c);
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Subplots in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!