How to make convolution on sinc function and square function
17 views (last 30 days)
Show older comments

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 Comments
Accepted Answer
KALYAN ACHARJYA
on 9 Jun 2019
Edited: KALYAN ACHARJYA
on 9 Jun 2019
t=-10:.01:10;
y1=sinc(t);
y2=zeros(size(t));
y2(t>=-1 & t<=1)=1;
c=conv(y1,y2);
stem(c);
More Answers (0)
See Also
Categories
Find more on Subplots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!