In your question you haven't mentioned sampling frequency since the finddelay and xcorr will give you the delay in number of samples. Check this example, Fs = 100; L = 1000; t = (-L / 2 : 1 : L / 2) / Fs; y1 = sinc(t); y2 = sinc(t...

matlab,correlation,cross-correlation

First, Let me transpose your code in R2014b: load carbig; data = [Displacement Horsepower Weight Acceleration MPG]; % Truncate the data, to follow-up with your sample code data = data(1:100,:); nans = sum(isnan(data),2) > 0; [wx, wy, r, U, V,] = canoncorr(X(~nans,1:3),X(~nans,4:5)); OK, now the trick is that the vectors...

r,julia-lang,cross-correlation

I assume that citing this excerpt here is ok by StackOverflow's terms of use? From page 390 (section 14.1) of Venables and Ripley (2002) you can find the definition that they use here for the acf() function: If you look at the source code of the ccf() function in R...

python,numpy,convolution,cross-correlation

Remember that Python indexing starts at zero rather than 1. You want index 19999 rather than 20000: x = np.random.randn(20000) y = np.random.randn(20000) np.correlate(x, y, 'valid')[0] # -29.778322045152521 np.correlate(x, y, 'full')[19999] # -29.778322045152521 ...

java,signal-processing,audio-processing,cross-correlation

If I remember correctly, a cross-correlation is the same as convolution with one of the signals time-reversed. A convolution in turn is efficiently calculated by multiplying the spectra of the two signals; i.e., take the FFT of each signal padded at least to the sum of the size of both...

matlab,3d,template-matching,cross-correlation

There are no eror in your code Your algorithm is correct! But unfortunately in your case the maximum of cross-correlation is located at (4, 4, 4) and not (2, 2, 4) as you would expect it to be. This is because looking for the pattern of matrix B contained in...

c++,pattern-matching,image-recognition,fftw,cross-correlation

This question would probably be more appropriately posted on another site like cross validated (metaoptimize.com used to also be a good one, but it appears to be gone) That said: There's two similar operations you can perform with FFT: convolution and correlation. Convolution is used for determining how two signals...

opencv,matrix,cross-correlation

There are a couple of problems with the code you posted: 1) There is no instance of a cv::Mat constructor that matches the way you are initializing the "channel1" and "channel2" matrices. Solution: Declare your matrices in this way: cv::Mat channel1(X.row(1).clone()); //take the first row of matrix X cv::Mat channel2(X.row(10).clone());...

r,image-processing,fft,cross-correlation

The code looks correct from what I know about phase correlation. If I understand what you want correctly, you are trying to use phase correlation to determine the offset between two images given that their homographies are nothing more than horizontal and vertical offsets. The fact that you're only getting...

The cross-correlation of two complex function equals the convolution of one function and the complex conjugate of the other: Cross correlation and convolution As the function convolve in R already uses the Fast Fourier Transform, all you have to do is: convolve(my.vector1, my.vector2) The maximum lag can be found by:...

python,python-2.7,opencv,distance,cross-correlation

no wonder. apart from CV_COMP_BHATTACHARYYA not being a valid compare flag for matchTemplate , both CV_COMP_BHATTACHARYYA and TM_CCORR_NORMED resolve to the same enum value 3 under the hood. so basically you're doing the very same thing twice....