Let's say I have separate two-dimensional arrays with different numbers of rows:
Array One:
1 2 3
4 5 6
7 8 9
Array Two:
10 11 12
13 14 15
I'd like to perform a convolution of these two arrays together along the zero axis, with the output size being the same as array 1, similar to what scipy's convolve method will output when using mode='same'.
So column 1 of both arrays are convoluted together, etc, column 2 of both arrays are convoluted together, etc. I'd like to do this in a way which is computationally viable for larger arrays (upwards of 100,000 rows), so I'd like to avoid the use of for loops, if at all possible. Do numpy/scipy or any other libraries have any methods of performing this?
Desired Output should look like:
10 22 36
53 83 117
122 158 198
with the same shape as the first input array. Each column is the output obtained from the convolution of the corresponding columns in arrays 1 and 2.