The Behavior of CONVOL [message #7324] |
Thu, 31 October 1996 00:00  |
Kevin R. Turpie
Messages: 3 Registered: July 1995
|
Junior Member |
|
|
I've found the behavior of CONVOL to be a bit confusing. Please
let me know if I'm missing something, but here are my observations:
First, CONVOL does not appear to perform a convolution by default;
rather it seems to do a correlation. They are similar, but give
different results if the kernel is asymmetric.
Second, when CENTER is set to 0, CONVOL does a convolution in a
strict sense *if* the input kernel function, say k(x), is defined
so that k(x) = 0 for all x < 0. The result is usually shifted to
the right.
To do a true convolution with CONVOL for any kernel, it seems that
CENTER must be set to 1 and REVERSE must be applied to each dimension
of the kernel prior to input.
I spoke with RSI Tech Support about this last February and they
felt the solution would be to more clearly explain CONVOL in future
releases of the RG. Hmmm. Anyway, try it out and see if you get
the same results.
Thanks,
Kevin
PS - If your interested, I did create a routine to perform
two dimensional convolutions using a FFT. It is *very* fast
and behaves like CONVOL with the EDGE_WRAP keyword on and
the kernel oriented properly.
|
|
|
Re: The Behavior of CONVOL [message #7399 is a reply to message #7324] |
Mon, 04 November 1996 00:00  |
Christian Soeller
Messages: 46 Registered: August 1996
|
Member |
|
|
"Kevin R. Turpie" <turpie@seaeagle.gsfc.nasa.gov> writes:
> I'm afraid you missed the point; normalization doesn't have anything
> to do with it. It is the orientation of the kernel. In a convolution
> the kernel "flipped" wrt to the function being convolved. In a
> correlation is is not. With CENTER=1 (default), CONVOL uses the same
> orientation as a correlation. With CENTER=0, it does not.
Your observation is correct. If you want to have the normal convolution
behaviour you have to replace your kernel k(u) by k(-u) (here assuming
a centered notation). I came across it when doing deconvolutions. Something
to watch out for when using nonsymmetric kernels.
If it is not yet in the FAQ it should definitely go there.
Best regards,
Christian
------------------------------------------------------------ --------
Christian Soeller mailto: csoelle@sghms.ac.uk
St. Georges Hospital Medical School Dept. of Pharmacology
Cranmer Terrace London SW17 0RE
|
|
|