Is Conv2 based on direct convolution?
조회 수: 8 (최근 30일)
이전 댓글 표시
Is the conv2 function in Matlab 2023a, in particular the way it operates on 1d vectors, based on direct convolution or fft? I understand that you do not want to share all details on how this function is implemented, but for making use of this function in a scientific work where round-off errors and computational cost enter, it would be good to state with confidence that the method is either direct-based or fft-based.
댓글 수: 0
채택된 답변
Matt J
2023년 12월 4일
편집: Matt J
2023년 12월 4일
It is not FFT-based.
댓글 수: 4
Christine Tobler
2023년 12월 7일
I can confirm that conv2 uses a direct convolution method and not fft, and have passed along the suggestion to make this explicit in the documentation.
추가 답변 (1개)
Walter Roberson
2023년 12월 4일
Historically, MATLAB implemented several different cases according to size and data type (and matters such as complex-valued or not.) The general case was done by direct convolution -- but possibly by calls into high speed libraries. The special cases involved decomposition into kernels and some kind of transform.
The source code for the direct convolution used to be visible. The decomposition etc., was something I do not recall ever seeing the source code for (that is, it might have been present in MATLAB source form in sufficiently old versions in the time before I thought to look for it.)
댓글 수: 2
Walter Roberson
2023년 12월 4일
Note: historically, conv2() was implemented as a series of calls to conv() with transposes between.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!