Convolution of a function g(x) and the dirac delta function.
조회 수: 10 (최근 30일)
이전 댓글 표시
I want to get the convolution of a function g(x) and the dirac delta function. It should give me the function g(x) back but I'm unable to get it. When I get the stem plot of g(x) and the above convolution, I get different results. What will be the right way to go about doing this?
댓글 수: 0
채택된 답변
John D'Errico
2018년 4월 1일
편집: John D'Errico
2018년 4월 1일
Works for me.
G = rand(1,10);
Gconv = conv(G,1);
norm(G-Gconv)
ans =
0
WTP? If you did something different, then you need to show what you did, and ask what is wrong.
댓글 수: 3
Walter Roberson
2018년 4월 1일
[1] is the discrete version of the dirac delta: it is 1 at the center and 0 in the infinite extension to both sides.
John D'Errico
2018년 4월 1일
편집: John D'Errico
2018년 4월 1일
I gave you a convolution with a discrete approximation of a delta function. And I showed that it replicates the original function exactly.
Because conv is a discrete tool, working on discrete vector data, you need to use a unit approximation to the delta function. conv applies to vectors, not functions.
If you were doing a symbolic integration to perform the convolution, then the convolution between the function g(x) and dirac would be correct.
For example, had you tried this:
syms x y
int(sin(x)*dirac(y - x),[-inf,inf])
ans =
sin(y)
Then to no surprise, at least to me, it would work well enough.
You cannot mix the two though. Mixing apples and oranges will just drive you nuts. I prefer cashews. ;-)
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Assumptions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!