# Re: Convolution

• To: mathgroup@smc.vnet.net
• Subject: [mg10938] Re: Convolution
• From: calvitti@lychee.ces.cwru.edu
• Date: Sat, 14 Feb 1998 00:53:13 -0500
• In-Reply-To: Larry Gottlob's message of 12 Feb 1998 06:37:02 -0500
• Organization: Case Western Reserve University
• References: <6bumsu\$l93@smc.vnet.net>

```>>>>> "L" == Larry Gottlob <lrg@geri.duke.edu> writes:

L> I'm not experienced at Mathematica.  I define two functions:
L> Func1[x_] := tau*Exp(-x)      Func2[x_] := mu*x^2
L> for instance, where tau and mu are constants.

L> How do I define a function of x that is a convolution of Func1
L> and Func2, and plot that?

you're probably going to have trouble taking the convolution of those
two functions since their integrals diverge. convolution of f and g is
defined as:

convolution[f_,g_,x_] := Integrate[f(y)*g(x-y),y]

you can plot convolution[Func1,Func2,x] like any other function.
alternatively,

1) convolution is also the inverse fourier transform of the product of
the fourier transforms of the f and g

2) use the discretized approximation Sum[f[x]*g[x],{x,-M,M}] where M is
a large number. if you use this method, it's probably much faster to
build up a list (with Table) to represent the convolution over a
specific interval at a specific gridsize...then use ListPlot to plot
it:

discreteConvolution[f_,g_,x_,x0_,x1_,dx_,M_] :=
Table[Sum[f[x]*g[y-x],{x,-M,M}],{y,x0,x1,dx}];

+---------------------------------+
|          Alan Calvitti          |
| Systems and Control Engineering |
|    Autonomous Robotics Group    |
| Case Western Reserve University |
+---------------------------------+

```

• Prev by Date: Re: How do u go about doing this---?
• Next by Date: Re: Thank you