How to make convolution on sinc function and square function
17 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
tata tutu
le 9 Juin 2019
Commenté : tata tutu
le 9 Juin 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 commentaires
Réponse acceptée
KALYAN ACHARJYA
le 9 Juin 2019
Modifié(e) : KALYAN ACHARJYA
le 9 Juin 2019
t=-10:.01:10;
y1=sinc(t);
y2=zeros(size(t));
y2(t>=-1 & t<=1)=1;
c=conv(y1,y2);
stem(c);
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Subplots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!