Re: 2D Convolution

*To*: mathgroup at smc.vnet.net*Subject*: [mg76199] Re: 2D Convolution*From*: CKWong <CKWong.P at gmail.com>*Date*: Thu, 17 May 2007 06:13:40 -0400 (EDT)*References*: <f29389$m7p$1@smc.vnet.net>

I've just learned the hard way that you cannot copy the contents of a Mathematica notebook to a posting to this group. My last 2 postings had thus become gibberish. Many apologies. In the off-chance that you are still interested, here is my version of the Convolve function: Convolve[ f_, g_, x_?NumberQ, y_?NumberQ] := NIntegrate[ f[xp,yp] * g[x-xp,y-yp] , {xp,-Infinity,Infinity}, {yp,-Infinity,Infinity} ] Sample usage: Convolve[SHole, Gaussian2D, 0, 0] Plot3D[Convolve[SHole, Gaussian2D, x, y] // Evaluate, {x, -4 BeamRadius, 4 BeamRadius}, {y, -4 BeamRadius, 4 BeamRadius}, PlotRange -> All]

**Follow-Ups**:**Re: Re: 2D Convolution***From:*Murray Eisenberg <murray@math.umass.edu>