Re: 2D Convolution

• To: mathgroup at smc.vnet.net
• Subject: [mg76005] Re: 2D Convolution
• From: Mathieu G <ellocomateo at free.fr>
• Date: Mon, 14 May 2007 05:51:05 -0400 (EDT)
• References: <f29389\$m7p\$1@smc.vnet.net>

```Mathieu G a =E9crit :
> Hello,
> I would like to compute + plot a 2D convolution between a disk- or
> square shaped hole, and a 2D Gaussian.
> Here is where I am so far...
>
>
> HoleSize = 300*^-9; (*Radius or side length*)
>
>
> (*Disk-shape hole*)
> DHole = Disk[{0, 0}, HoleSize/2];
>
> (*Square-shape hole*)
> SHole = Rectangle[{-HoleSize/2, -HoleSize/2}, {HoleSize/2,
>      HoleSize/2}];
>
> Plot3D[Gaussian2D[x, y], {x, -4 BeamRadius,
>   ColorFunction -> "Rainbow", PlotRange -> Full]
>
,
>
> (*Graphics3D[Beam]
> Graphics[{Red,SHole,Orange,DHole},Frame->True]*)
>
>
> Thank you,
> Mat'
>

Am I going in the right direction???
It looks like the definition on the Hole functions are problem sources!?

HoleSize = 300*^-9;
HoleSize = HoleSize/2;

DHole =.; SHole =.;
DHole[x_, y_] := If[Sqrt[x^2 + y^2] <= HoleSize, 1, 0];
SHole[x_, y_] := If[Abs[x] <= HoleSize && Abs[y] <= HoleSize, 1, 0]=
;

Gaussian2D[x_, y_] :=

Convolve[f_, g_, x_, y_] :=
Integrate[
Function[{x, y}, f][xPrime, yPrime] Function[{x, y}, g][x - xPrime,
y - yPrime], {xPrime, -\[Infinity], \[Infinity]}, {yPrime, -\
\[Infinity], \[Infinity]}, GenerateConditions -> False]

Plot3D[DHole[x, y], {x, -2 HoleSize, 2 HoleSize}, {y, -2 HoleSize,
2 HoleSize}, Mesh -> All, PlotRange -> {0, 2}]

Convolve[DHole, Gaussian2D, x, y]

```

• Prev by Date: Launching Mathematica kernel with Windows 'start' command in order to customise the priority of the kernel process
• Next by Date: Integrate[s^s(1-s)^(1-s)Sin[Pi s],{s,0,1}]
• Previous by thread: 2D Convolution
• Next by thread: Re: 2D Convolution