フィルターのクリア

Conv two continuous time functions

10 ビュー (過去 30 日間)
DDD
DDD 2015 年 5 月 26 日
コメント済み: zhitao Luo 2020 年 6 月 2 日
given y(t) and x(t), it is asked to conv them. Note: x(t)=dirac(t-3)-dirac(t-5). The conv result should sum y(t-3)-y(t-5) but it gives me:
y=@(t) 1.0*(t>=0).*exp(-3*t);
x=@(t) 1.0*(t==3)-1.0*(t==5);
delta=0.0001;
tx=2:delta:6; %tx=(-200:300)*delta;
ty=-1:delta:1.5; % ty=(-100:300)*delta;
c=conv(y(ty),x(tx))*delta;
tc=(tx(1)+ty(1)):delta:(tx(end)+ty(end));
figure()
title('c')
subplot(3,1,1)
plot(tx,x(tx))
xlabel('n'); title('x(t)'); ylim([min(x(tx))-1,max(x(tx))+1]); grid on
subplot(3,1,2)
plot(ty,y(ty))
xlabel('n'); title('h(t)'); ylim([min(y(ty))-1,max(y(ty))+1]); grid on
subplot(3,1,3)
plot(tc,c);
xlabel('n'); title('x(t)*h(t)');ylim([min(c)-1,max(c)+1]); grid on
What can i do to solve the problem?
Thanks

採用された回答

Thorsten
Thorsten 2015 年 5 月 26 日
編集済み: Thorsten 2015 年 5 月 26 日
The y-axis is too large to show the data. You can rescale them by, e.g.,
axis([1 8 -delta delta])
or with your code, use
ylim([min(c),max(c)]);
or get rid of the *delta in
c=conv(y(ty),x(tx))*delta;

その他の回答 (1 件)

Immanuel Manohar
Immanuel Manohar 2019 年 10 月 2 日
Your dirac Delta is wrong... you're attempting continuous time convolution but you are using unit impulse instead of dirac delta for convolution. To get the correct answer, your dirac delta approximation should have the height of 1/delta.
  1 件のコメント
zhitao Luo
zhitao Luo 2020 年 6 月 2 日
Hello, Immanuel Manohar, I also encountered the same problem, is there any more detailed answer?

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

カテゴリ

Help Center および File ExchangeSignal Processing Toolbox についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by