convol [message #92052] |
Sun, 04 October 2015 01:18  |
Dete van Eeden
Messages: 32 Registered: July 2015
|
Member |
|
|
Hallo
I want to use the convol function for an array and a kernel.
I am not sure how the center option works? how and where do I define it?
at the moment the result is not quite what it should be...
Any advise?
|
|
|
|
|
|
|
|
Re: convol [message #92059 is a reply to message #92056] |
Sun, 04 October 2015 03:44   |
Yngvar Larsen
Messages: 134 Registered: January 2010
|
Senior Member |
|
|
On Sunday, 4 October 2015 11:15:15 UTC+2, Dete van Eeden wrote:
> On Sunday, October 4, 2015 at 11:05:19 AM UTC+2, Fabien wrote:
>> On 10/04/2015 10:49 AM, Dete van Eeden wrote:
>>>> > Hallo
>>>> > > >
>>>> > > >I want to use the convol function for an array and a kernel.
>>>> > > >
>>>> > > >I am not sure how the center option works? how and where do I define it?
>>>> > > >
>>>> > > >at the moment the result is not quite what it should be...
>>>> > > >
>>>> > > >Any advise?
>>>> >
>>>> >https://xkcd.com/722/
>>>> >
>>>> >Cheers,
>>>> >
>>>> >Fabien
>>> comics??
>>
>> This comic is a perfect illustration of the way you described your
>> problem. People here are very helpful but they have no crystal ball and
>> can't give you a better advice than "press more buttons".
>>
>> http://www.catb.org/esr/faqs/smart-questions.html#beprecise
>
> thanks for being an idiot
(THIS is definitively not the way to get an answer anywhere on the net that I know of. But anyway, here it goes.)
The issue here is that you don't describe why CONVOL doesn't work like you expect. Given that CONVOL is extremely well documented, including the CENTER keyword, it is hard to know what your problem is.
http://www.exelisvis.com/docs/CONVOL.html#C_854643309_676409
You should describe what you did and why that isn't what you expected if you want answers.
A couple of (documented) gotchas are that
1) the CENTER keyword is set by default, and
2) CONVOL does not reverse the kernel unless /REVERSE is set, and thus by default calculates correlation rather than convolution in the mathematical sense.
--
Yngvar
|
|
|
Re: convol [message #92061 is a reply to message #92056] |
Mon, 05 October 2015 04:37  |
Paul Van Delst[1]
Messages: 1157 Registered: April 2002
|
Senior Member |
|
|
On 10/04/15 05:15, Dete van Eeden wrote:
> On Sunday, October 4, 2015 at 11:05:19 AM UTC+2, Fabien wrote:
>> On 10/04/2015 10:49 AM, Dete van Eeden wrote:
>>>> > Hallo
>>>> >>>
>>>> >>> I want to use the convol function for an array and a kernel.
>>>> >>>
>>>> >>> I am not sure how the center option works? how and where do I define it?
>>>> >>>
>>>> >>> at the moment the result is not quite what it should be...
>>>> >>>
>>>> >>> Any advise?
>>>> >
>>>> > https://xkcd.com/722/
>>>> >
>>>> > Cheers,
>>>> >
>>>> > Fabien
>>> comics??
>>
>> This comic is a perfect illustration of the way you described your
>> problem. People here are very helpful but they have no crystal ball and
>> can't give you a better advice than "press more buttons".
>>
>> http://www.catb.org/esr/faqs/smart-questions.html#beprecise
>
> thanks for being an idiot
Now, now. Don't take it personally. Fabien did provide good advice with
the last link (the comic did make me laugh...mostly because I've been in
that position myself, pressing buttons in blind panic mode. But I
digress....)
Getting back to your question, the documentation for CONVOL is pretty
thorough:
http://www.exelisvis.com/docs/CONVOL.html
When you say you are "not sure how the center option works? how and
where do I define it?" the doc in the above link should help.
To quote from the intro:
"The CENTER keyword controls the alignment of the kernel with the array
and the ordering of the kernel elements. If CENTER is explicitly set to
0, convolution is performed in the strict mathematical sense; otherwise,
the kernel is centered over each data point."
Now I go back to button pressing... :o)
cheers,
paulv
|
|
|