convolution in time domain, runtime improvement by padding
3 次查看（过去 30 天）
I have implemented a convolution algorithm in the time domain as per the mathematical definition.
The algorithm works fine, does exaclty what it is supposed to, conv gives me the same result.
But I have noticed that the speed of my algorithm significantly increases (up to factor 2) when I use the circular or replicate padarray options. I have tried to think of any reasons why this happens, but couldn't come up with anthing.
Does it have to do with cache hits and misses or something similar?
There might be other factors that might be responsible for the speed boost you are experiencing. But If you just changed the padarray options and not others then the speed boost is most likely because of caching, also Circular and replicate pad options lead to smaller buffer allocations and scalar computations which can result in better vectorization and can improvize the speed.
Hope this helps!