4
$\begingroup$

im trying to demonstrate the convolution process between 2 HeavysidePi function with Manipulate.

im trying to get something like this GIF.

i found how to demonstrate the convolution with :

Manipulate[Show[Plot[HeavisidePi[y], {y, -3, 3}], Plot[HeavisidePi[x - t], {x, -3, 3}]], {t, -3, 3}]

but i dont understand how to plot the acutal convolution results, like it represented on the link above.

thanks for help!

$\endgroup$

1 Answer 1

6
$\begingroup$

First, you need to define the convolution of the two functions. Then plot it:

con[y_] := Convolve[HeavisidePi[x], HeavisidePi[x], x, y]; 
Manipulate[Show[Plot[HeavisidePi[y], {y, -3, 3}, Exclusions -> None, 
   Filling -> Bottom], 
  Plot[HeavisidePi[x - t], {x, -3, 3}, Exclusions -> None, 
   PlotStyle -> Green, Filling -> Bottom], 
  Plot[con[y], {y, -3, t}]], {{t, -2.9}, -3, 3}]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.