I want a circular convolution function where I can set the number N
as I like.
All examples I looked at like here and here assume that full padding is required but that not what I want.
I want to have the result for different values of N
- so input would
N
and and two different arrays of values - the output should be the N point convolved signal
Here is the formula for circular convolution. Sub N
can be seen as the modulo operation.
update for possible solution
This answer is a suitable solution when the array a
is piled accordingly to the different cases of N
.
When I find time I will post a complete answer, meanwhile feel free to do so.
Thanks to @André pointing this out in the comments!
x1=np.array([1,2,3,4])
,x2=...
,expected_result=...
. Having some code to start with makes it a bit easier to reproduce and begin working on your problem, just as well as confirming that the answer is actually correct.a
is tiled. I think in the caseN => L > P
we have to zero pada
and in the othera
will be tiled from a different index. Thanks for pointing this out!