convolution in time domain, runtime improvement by padding

조회 수: 1 (최근 30일)
Leon Hülsmann
Leon Hülsmann 2023년 5월 31일
댓글: Leon Hülsmann 2023년 6월 8일
Hey everybody,
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?
  댓글 수: 1
Matt J
Matt J 2023년 5월 31일
편집: Matt J 2023년 6월 1일
Who can say? We haven't seen your implementation of the convolution nor your tests of it. Maybe it's not that the speed increases with circular or replicate padding options. Maybe it's that your other options are not well implemented, and slow things down.

댓글을 달려면 로그인하십시오.

답변 (1개)

Dinesh
Dinesh 2023년 6월 6일
Hi Leon,
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!
Thank you.

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

제품


릴리스

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by