Re: 2D Convolution
- To: mathgroup at smc.vnet.net
- Subject: [mg76389] Re: 2D Convolution
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Mon, 21 May 2007 05:59:16 -0400 (EDT)
- Organization: The Open University, Milton Keynes, UK
- References: <f29389$m7p$1@smc.vnet.net><f29bko$pjn$1@smc.vnet.net> <f2emd1$2r6$1@smc.vnet.net> <f2h96m$13g$1@smc.vnet.net>
Mathieu G wrote:
> CKWong a =E9crit :
>> Errata:
>> g should be the kernel in the function
>>
>> Convolve[f_, g_, x_?NumberQ, y_?NumberQ] := NIntegrate[f[
>> xPrime, yPrime] *g[x - xPrime,
>> y - yPrime], {xPrime, -=A1=DB, =A1=DB}, {yPrime, -=A1=DB,=
> =A1=DB}]
>> Sorry for the snafu.
>>
>>
> Thank you for your replies!!
>
> I have a few questions still since I am neither a mathematician or a
> mathematica expert:
>
> Is it necessary to use the <?NumberQ> part since using the Convolve
> function for anything else would be non-sense? Does that bring any
> improvement in the Mathematica computation?
The following FAQ should answer your questions: "How do I write a
function which evaluates only when the argument is a number?" Available at
http://support.wolfram.com/mathematica/kernel/features/evalwhennumber.html
Regards,
Jean-Marc
> Why does it make a difference that the kernel is the f or g function?
>
> Best regards,
> MG
>