Why is the convolution so different from the analytical answer?

조회 수: 5 (최근 30일)
Bradlee Harrison
Bradlee Harrison 2021년 4월 10일
댓글: Bradlee Harrison 2021년 4월 10일
I am trying to graph the convolution of two functions.
t = linspace(0,5,1001);
xt = (exp(-t) + exp(-3*t)).*heaviside(t);
ht = (1.5.*exp(-2.*t) + 1.5.*exp(-4.*t)).*heaviside(t);
yt_n = conv(xt,ht);
yt_a = (2.*exp(-1.*t)-2.*exp(-4.*t)).*heaviside(t)
When comparing yt_n and yt_a, the results are very different. Though, they should be the same since yt_a is just the analytically derived output response for x(t) and y(t), Why is this?

채택된 답변

Paul
Paul 2021년 4월 10일
편집: Paul 2021년 4월 10일
When approximating the continuous convolution with a discrete convoluton, the discrete convolution needs to be multilplied by dt, which in this case is 0.005
plot(t,yt_a,t,yt_n(1:numel(t))*.005,'o'),grid

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by