How to make convolution on sinc function and square function
17 次查看(过去 30 天)
显示 更早的评论

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 个评论
采纳的回答
KALYAN ACHARJYA
2019-6-9
编辑:KALYAN ACHARJYA
2019-6-9
t=-10:.01:10;
y1=sinc(t);
y2=zeros(size(t));
y2(t>=-1 & t<=1)=1;
c=conv(y1,y2);
stem(c);
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Subplots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!