7
votes

I am trying to do a 'convolution' of an arbitrary N-dimensional surface with a vector. More specifically, I am trying to get the output of an N-th order Volterra kernel (see http://www.scholarpedia.org/article/Volterra_and_Wiener_series, eq.1)

Thus, for a 1-dimensional kernel, the output is the simple sliding convolution of the 1st order kernel with the past input epoch. It essentially multiplies/weights every value in the past input epoch with a coefficient.

The 2nd order kernel output is a 'convolution' of a 2d matrix with a signal. This kernel weighs the product of every pair of points in the past with a coefficient.

The 3rd order kernel, a 3d matrix, weighs every triplet of points in the past memory epoch.

Also, I dont know the dimension/order of the kernel before hand. It is an input parameter..

I know I can probably do this very unelegantly and slowly by going through with several for loops point by point, but I was wondering if there was a way to do this very quickly and elegantly in matlab?

Thanks

1
Have you looked at convn command?Mohsen Nosratinia
I have, but Im not sure what it does. Whenever I try using it to convolve a surface with a vector, I get a surface output and not a vector output that I am looking for; Thus, I assume its not what I need...DankMasterDan
This is super relevant to what I'm doing now, could use as much info as possible. Starting a bounty.SetSlapShot
The OP wants a Volterra-style nonlinear system. This generalizes linear convolution to generate, at each point, the (scalar) integral of the product of the input signal against each dimension of the kernel - see the page linked in the OP. So, vector x n-dim -> vector is right, but the implicit definition is not something you can guess from the post!dpwe
You might find this useful: mathworks.com/matlabcentral/fileexchange/…dpwe

1 Answers

-1
votes

you can check the dimension of a variable with ndims(array), and do convolutions on the needed dimensions: conv() or conv2() for one-dimension and 2-dimensions respectively. If you need to do a convolution on a higher dimension, you can reshape your variable with the reshape command and then use the previous commands.