# Using Convolve and Manipulate

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!

## 1 Answer

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}]