cross-correlation

Interpreting (and comparing) output from numpy.correlate

自闭症网瘾萝莉.ら 提交于 2021-02-18 03:04:58
问题 I have looked at this question but it hasn't really given me any answers. Essentially, how can I determine if a strong correlation exists or not using np.correlate ? I expect the same output as I get from matlab's xcorr with the coeff option which I can understand (1 is a strong correlation at lag l and 0 is no correlation at lag l ), but np.correlate produces values greater than 1, even when the input vectors have been normalised between 0 and 1. Example input import numpy as np x = np

Interpreting (and comparing) output from numpy.correlate

只愿长相守 提交于 2021-02-18 03:04:50
问题 I have looked at this question but it hasn't really given me any answers. Essentially, how can I determine if a strong correlation exists or not using np.correlate ? I expect the same output as I get from matlab's xcorr with the coeff option which I can understand (1 is a strong correlation at lag l and 0 is no correlation at lag l ), but np.correlate produces values greater than 1, even when the input vectors have been normalised between 0 and 1. Example input import numpy as np x = np

How to calculate p-values from cross-correlation function in R

风流意气都作罢 提交于 2021-02-10 05:20:40
问题 I calculated a cross-correlation of two time series using ccf() in R. I know how to derive the confidence limits as: ccf1 <- ccf(x=x,y=y,lag.max=5,na.action=na.pass, plot=F) upperCI <- qnorm((1+0.95)/2)/sqrt(ccf1$n.used) lowerCI <- -qnorm((1+0.95)/2)/sqrt(ccf1$n.used) But what I really need is the p-value of the maximum correlation. ind.max <- which(abs(ccf1$acf[1:11])==max(abs(ccf1$acf[1:11]))) max.cor <- ccf1$acf[ind.max] lag.opt <- ccf1$lag[ind.max] How do I calculate this p-value? I have

Calculating FFT Correlation Coefficient

北城余情 提交于 2021-02-07 07:55:10
问题 I would like to calculate the correlation coefficient of 2 sound samples using AForge 2.2.5 . I've read from here the formula to calculate Cross Correlation. And here I've read about the formula to calculate the correlation coefficient. This is currently what I have: Prior to calling CrossCorrelation(), FFT has been performed. static Complex[] CrossCorrelation(Complex[] ffta, Complex[] fftb) { var conj = ffta.Select(i => new Complex(i.Re, -i.Im)).ToArray(); for (int a = 0; a < conj.Length; a+

Calculating FFT Correlation Coefficient

拜拜、爱过 提交于 2021-02-07 07:54:08
问题 I would like to calculate the correlation coefficient of 2 sound samples using AForge 2.2.5 . I've read from here the formula to calculate Cross Correlation. And here I've read about the formula to calculate the correlation coefficient. This is currently what I have: Prior to calling CrossCorrelation(), FFT has been performed. static Complex[] CrossCorrelation(Complex[] ffta, Complex[] fftb) { var conj = ffta.Select(i => new Complex(i.Re, -i.Im)).ToArray(); for (int a = 0; a < conj.Length; a+

Built in functions available in opencv2 python to find distance between to images

落花浮王杯 提交于 2020-12-06 19:17:47
问题 I want a faster Normalized cross correlation using which i can compute similarity between two images. I want to know whether there is any built in functions which can find correlation between two images other than scipy.signal.correlate2d() and matplotlib xcorr() . If these two functions are working can anyone show me an example to find correlation between two images. path1='D:/image/cat1.jpg' path2='D:/image/cat2.jpg' corrCoefft = computeCorrelationCoefft(path1,path2) 回答1: OpenCV does

Error while drawing animation of seaborn heatmap for 3D volume

人走茶凉 提交于 2020-07-15 07:51:41
问题 Trying to visualize the cross-correlation between two volumes, img_3D, and mask_3D, using Seaborn heatmap , and animation from Matplotlib to visualize the 3D cross-correlation result as a progressive animation of 2D images, but I was facing an error, can you please tell me how to get rid of this error, and visualize the heatmaps correctly? Thanks in advance. Traceback (most recent call last): File "C:\Users\User\AppData\Local\Programs\Python\Python37\lib\tkinter\__init__.py", line 1705, in _

Find time shift of two signals using cross correlation

假装没事ソ 提交于 2020-06-10 05:12:09
问题 I have two signals which are related to each other and have been captured by two different measurement devices simultaneously. Since the two measurements are not time synchronized there is a small time delay between them which I want to calculate. Additionally, I need to know which signal is the leading one. The following can be assumed: no or only very less noise present speed of the algorithm is not an issue, only accuracy and robustness signals are captured with an high sampling rate (>10

Find time shift of two signals using cross correlation

流过昼夜 提交于 2020-06-10 05:11:09
问题 I have two signals which are related to each other and have been captured by two different measurement devices simultaneously. Since the two measurements are not time synchronized there is a small time delay between them which I want to calculate. Additionally, I need to know which signal is the leading one. The following can be assumed: no or only very less noise present speed of the algorithm is not an issue, only accuracy and robustness signals are captured with an high sampling rate (>10

Numpy Correlate is not providing an offset

时光总嘲笑我的痴心妄想 提交于 2020-02-04 02:54:10
问题 I am trying to look at astronomical spectra using Python, and I'm using numpy.correlate to try and find a radial velocity shift. I'm comparing each spectrum I have to one template spectrum. The problem that I'm encountering is that, no matter which spectra I use, numpy.correlate states that the maximal value of the correlation function occurs with a shift of zero pixels, i.e. the spectra already line up, which is very clearly not true. Here is some of the relevant code: corr = np.correlate