How to make convolution on sinc function and square function

17 ビュー (過去 30 日間)
tata tutu
tata tutu 2019 年 6 月 9 日
コメント済み: tata tutu 2019 年 6 月 9 日
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?

採用された回答

KALYAN ACHARJYA
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);
  1 件のコメント
tata tutu
tata tutu 2019 年 6 月 9 日
Why the range is between o to 5000?

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSubplots についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by