What is convolute?

Let your imagination run wild

What is convolute?

PostPosted by seary » Wed Jan 28, 2009 11:38 pm

What does the convolution operator do? Is there an APL implementation?


Googled and checked out J fora, but couldn't find anything.


seary
 
Posts: 8
Joined: Tue Jan 27, 2009 10:38 pm

)inascii crash

PostPosted by forummaster » Thu Jan 29, 2009 5:45 pm

seary wrote:
seary wrote:
What does the convolution operator do? Is there an APL implementation?
Googled and checked out J fora, but couldn't find anything.


The convolution operator is a concept from mathematics (en.wikipedia.org/wiki/Convolution) from the first NARS system.


I seem to recall that I defined it as L f⍡g R for vectors where (⍴L)≥⍴R. Reverse R and drag it against L using g to compare the reversed R with the corresponding length subset of L, and reducing that by f to yield a vector of length 1+(⍴L)-⍴R.


For example, ∧⍡=∘⌽ is a string search function.


This would be a good candidate for a Magic Function.

forummaster
 
Posts: 555
Joined: Wed Jan 23, 2013 1:00 pm

)inascii crash

PostPosted by gar37bic » Sat Sep 04, 2010 12:30 pm

I would just add that the verb form is 'convolve'. I originally learned in optics that convolution is what a lens or filter does to light. It is very widely used in image processing and pattern recognition. For instance many of the effects in Photoshop are convolutions. I was deeply involved in using hardware-based binary and digital convolvers for character recognition at one time. I had not thought of convolution in the context of string searches, but I now will have to think about how Bayesian inference might be implemented as a convolution!
gar37bic
 
Posts: 5
Joined: Sat Sep 04, 2010 11:59 am

Re: What is convolute?

PostPosted by drab » Wed Jan 25, 2017 12:56 pm

This could be extremely useful in image processing (and the even documentation says so).

But you have prevented that by restricting the arguments to vectors.

Please support higher rank arrays -- at least matrices.

Also, the functions are apparently limited to scalar functions. It wouldn't let me try a ,⍡=
drab
 
Posts: 295
Joined: Thu Oct 09, 2014 6:23 am

Re: What is convolute?

PostPosted by forummaster » Wed Jan 25, 2017 5:52 pm

drab wrote:This could be extremely useful in image processing (and the even documentation says so).

But you have prevented that by restricting the arguments to vectors.

Please support higher rank arrays -- at least matrices.

Also, the functions are apparently limited to scalar functions. It wouldn't let me try a ,⍡=

Convolution could be defined on higher rank arrays, but its trivial to use the Rank operator for this purpose. For example,

Code: Select all
      L←3 4⍴⍳12
      R←3 2⍴⍳6
      L +⍡×⍤1 R
 1   4   7  10  8
15  38  45  52 32
45 104 115 126 72
      L[1;]+⍡×R[1;]
1 4 7 10 8
      L[2;]+⍡×R[2;]
15 38 45 52 32
      L[3;]+⍡×R[3;]
45 104 115 126 72
Also, there is no restriction on the operands to scalar functions. You encountered an error on ,⍡= because it requires a catenate reduction on a certain singleton which fails because there is no identity element in that case. This is explained in my "Reduction of Singletons" paper.

Try
Code: Select all
      (⍳4),⍡⍴⍳3
1  2 1 1  3 2 2 1 1 1  3 3 2 2 2 1 1 1 1  3 3 3 2 2 2 2  3 3 3 3

For reference, both Convolution and Rank operators are implemented as Magic Functions. Try ⎕VR '#DydConv' and ⎕VR '#DydRank'.
Having these definitions available is invaluable when some puzzling error occurs such as the error you encountered from ,⍡=.

Also, don't forget that polynomial multiplication (+⍡× -- see the examples above) is also a Convolution.
forummaster
 
Posts: 555
Joined: Wed Jan 23, 2013 1:00 pm


Return to New Primitive Operators

Who is online

Users browsing this forum: No registered users and 0 guests

cron