xcorr2_fft(a,b)

버전 1.2.0.0 (1.06 KB) 작성자: Alessandro Masullo
Two-dimensional cross-correlation evaluated with FFT algorithm
다운로드 수: 1.2K
업데이트 날짜: 2015/10/19

라이선스 보기

xcorr2_fft(A,B) computes the cross-correlation of matrices A and B using the FFT algorithm.
When matrices A and B are real, xcorr2_fft is numerically equivalent to xcorr2, but much faster.
For big matrices, the speed improvement can be up to 100 times!
The correlation is simply evaluated padding matrices a and b with zeros according to the size of the correlation map. In this way, the periodicity of the circular cross-correlation evaluated with the FFT becomes equivalent to the linear cross-correlation evaluated with conv2.
% Example:
a = rand(122); b=rand(332);
a = a-mean(a(:));
b = b-mean(b(:));

tic,cl = xcorr2(a,b);toc
Elapsed time is 0.223502 seconds.
tic,cf = xcorr2_fft(a,b);toc
Elapsed time is 0.030935 seconds.

max(abs(cf(:)-cl(:)))
ans = 4.1922e-13

인용 양식

Alessandro Masullo (2026). xcorr2_fft(a,b) (https://kr.mathworks.com/matlabcentral/fileexchange/53570-xcorr2_fft-a-b), MATLAB Central File Exchange. 검색 날짜: .

MATLAB 릴리스 호환 정보
개발 환경: R2012b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Spectral Measurements에 대해 자세히 알아보기
버전 게시됨 릴리스 정보
1.2.0.0

Updated description

1.1.0.0

Improved speed with a smarter zero-padding

1.0.0.0