Questions tagged [cross-correlation]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
69 votes
8 answers
128k views

How do I implement cross-correlation to prove two audio files are similar?

I have to do cross correlation of two audio file to prove they are similar. I have taken the FFT of the two audio files and have their power spectrum values in separate arrays. How should I proceed ...
user avatar
55 votes
5 answers
54k views

What is the difference between convolution and cross-correlation?

I've found on multiple sites that convolution and cross-correlation are similar (including the tag wiki for convolution), but I didn't find anywhere how they differ. What is the difference between ...
Mien's user avatar
  • 815
4 votes
3 answers
1k views

2D Cross-Correlation using 1D FFT

I need to calculate cross correlation between 2 images which I read in 2 vectors, both of them uni-dimensional. As per my understanding I need to do the following operations: FFT(1D) on vector 1 and ...
user3253067's user avatar
6 votes
4 answers
7k views

How to calculate a delay (correlation peak) between two signals with a precision smaller than the sampling period?

I would like to calculate a delay between two signals in MATLAB. Normally, I would do this with a cross-correlation (xcorr), and then calculate the position of the ...
BNJMNDDNN's user avatar
  • 225
2 votes
1 answer
3k views

GPS Coarse Acquisition PRN Codes

Are the actual 1023 bit sequences for each of the 32 GPS satellites available to consumers? I found the IS GPS 200 but it doesn't list the entire sequences. Are verified sequences available for ...
random_dsp_guy's user avatar
6 votes
3 answers
462 views

Cross-correlation seems defined backwards

Suppose $f$ and $g$ are real. Why $$ C(\tau)=(f\star g)(\tau) = \int_{-\infty}^{\infty} f(t) g(t + \tau)dt \tag{1} $$ and not $$ C(\tau)=(f\star g)(\tau) = \int_{-\infty}^{\infty} f(t) g(t - \tau)dt\...
OverLordGoldDragon's user avatar
22 votes
2 answers
6k views

Examples of Independent and uncorrelated data in real-life, and ways to measure/detect them

We always hear about this vector of data VS this other vector of data being independent from each other, or uncorrelated, etc, and while it is easy to come across the math regarding those two concepts,...
Spacey's user avatar
  • 9,807
15 votes
5 answers
8k views

Is up-sampling prior to cross-correlation useless?

Consider a simple case where two signals from two different sensors are cross-correlated, and the time-delay-of-arrival computed from the absissa of the peak of their cross-correlation function. Now ...
Spacey's user avatar
  • 9,807
15 votes
5 answers
15k views

Time delay estimation of oscilloscope signals using cross correlation

I have recorded 2 signals from an oscope. They look like this: I want to measure the time delay between them in Matlab. Each signal has 2000 samples with a sampling frequency of 2001000.5. The ...
Nick Sinas's user avatar
9 votes
2 answers
4k views

Detecting a Signal Inside a Time Series Using MATLAB's $ \tt xcorr() $

I would like to find the exact replica of signal A in time series B. I am working with the simple toy example below, in which A is located starting at the 4th position in B. I thought that using <...
val's user avatar
  • 445
8 votes
1 answer
9k views

Comparing multiple signals for similarity

I have multiple (between 2 and 100) signals and need to determine when a significant number diverge from the rest. We're exploring machine learning techniques, but we also want tackle this as a signal ...
John Strong's user avatar
7 votes
3 answers
6k views

GCC-PHAT (Generalized cross correlation MATLAB)

I've been trying to implement generalized cross correlation with a PHAT weighting function for a while now, and cannot get it to work. I have tried correlating using MATLAB's xcorr.m file, and it ...
CN railfan's user avatar
4 votes
1 answer
466 views

Direct Correlation (DC) Time Delay Estimation: Variance Keeps Decreasing for Increasing SNR?

I'm trying to reproduce the results from this paper "Discrete time techniques for Time Delay Estimation" doi:10.1109/78.193195, for both the correlation and Least Squares. I've generated a random (...
LDPC's user avatar
  • 195
3 votes
1 answer
5k views

Cross correlation vs FFT for finding phase between 2 signals

I have been struggling with this issue for months now, trying to understand which one to pick: FFT or cross correlation. I am given a sine wave (with phase, amplitude, frequency and time vector ...
user11266's user avatar
3 votes
2 answers
686 views

Efficient 2D convolution/cross-correlation along only one axis (1D output)

I wish to convolve/cross-correlate two images and but, only horizontally, yielding 1D output. So, first output point would be sum(x * h), second ...
OverLordGoldDragon's user avatar
2 votes
2 answers
5k views

How to find a maximal possible value of a cross correlation

Is there any way of calculating a maximal possible value of a cross correlation of two signals whose maximal amplitude and sample rate is known? To make things clearer, , signals in question are ...
Dalen's user avatar
  • 161
1 vote
1 answer
1k views

Is Cross correlation between stationary random signal and noise zero for all lags?

If $x(n)$ is a stationary random process (let say small 20ms window of speech which can be assumed stationary) and $v(n)$ is said to be uncorrelated noise, can we say that cross correlation of $x(n)$ ...
ILT's user avatar
  • 13
1 vote
2 answers
3k views

Matching 2 audio files

I'm doing research on how we can do matching between 2 audio files using Android to see if they have the same content or not. After doing lots of research, I have concluded that I must do 2 main ...
nada's user avatar
  • 11
0 votes
1 answer
642 views

2D FFT Cross-Correlation in Python

How to replicate scipy.signal.correlate2d(x, h) with arbitrarily sized x and h? ...
OverLordGoldDragon's user avatar
0 votes
3 answers
745 views

How to reliably compute the group delay of a comb filter

I applied the following FIR comb filter in real-time: y[n]=x[n]-x[n-40] Since this is an FIR, the group delay is D=(N-1)/2=20 samples. After applying the filter ...
Chika's user avatar
  • 93
0 votes
0 answers
195 views

How to use cross-correlation to verify speech data and determine delay

I have been experimenting with cross-correlation function to verify the presence of speech in a recorded file wrt a source file. I tried the following in Matlab: <...
skrowten_hermit's user avatar
10 votes
2 answers
8k views

Phase Correlation - Poor Performance on Noisy/Blurred Images?

I have successfully tested 1D phase correlation algorithm to determine vertical shift between two synthetic images. When I moved to real images, however, it is not able to detect translation at all (...
Libor's user avatar
  • 4,255
10 votes
2 answers
7k views

Meaning of the Transpose of Convolution

I have an $n \times n$ asymmetric convolution kernel, $k(t_1,t_2)$. $k$ is zero everywhere except for in small regions near the corners. I also have an $n \times n$ image, $f$. Let $*$ denote ...
dranxo's user avatar
  • 295
10 votes
1 answer
4k views

Synchronizing Two Audio Tracks

I would like to implement an algorithm that synchronizes two audio tracks. The two tracks are very similar; you can imagine they are two recordings of sound (not necessarily music) from two ...
Sinan Taifour's user avatar
8 votes
1 answer
7k views

Measuring time delay of audio signals

Before anyone yells at me I fully realize that this question has been asked numerous times. I assure you that I've read through the existing questions and answers but I am still confused about part of ...
CaymanEss's user avatar
  • 275
5 votes
2 answers
1k views

Time Alignment of 2 Sensors Sampling the Same Signal with Different Hardware Delays

I have two radios sampling simultaneously, and I am trying to time-align their two signals (they will always start sampling at slightly different times with random delays due to hardware differences). ...
jstein123's user avatar
  • 155
5 votes
2 answers
1k views

Map time difference between two similar videos

Question: Is there any software, source-code, or well documented and easily implementable research (I am not afraid for a little bit of Python) to do the following: Take two similar videos from ...
Simon Streicher's user avatar
4 votes
1 answer
839 views

Cross-correlation, sharp peak at 0?

First of all, I have to stress that I am not a professional of coding, no more than a professional of signal processing. I am a chemist that happen to be working on a project involving both. So in ...
Trion's user avatar
  • 87
4 votes
2 answers
2k views

Subtracting Original Audio Signal

here is my scenario: one speaker is sending a chirp, and a microphone is recording it as well as all following echoes. The function of the chirp is already know. My goal: subtract the original chirp ...
Kaifei's user avatar
  • 143
4 votes
3 answers
13k views

How do I get the phase angle from Cross Correlation?

Im trying to cross correlate two signals in matlab and get the phase difference between the signals. For cross correlation (the idea is to do it without xcorr) I used: ...
Learner12's user avatar
4 votes
2 answers
912 views

Signals cross-correlation

I am trying to measure phase difference between two received waves which are recorded by two separate PC's (microphones). The two PC's starts recording at the same time, then I make a sine wave sound ...
Redan Hassoun's user avatar
4 votes
1 answer
971 views

Time delay estimation in low SNR

So I am interested in finding delay between two noisy narrowband signals,for example, two arterial pulse waveform. I can easily get a correct estimate of delay using cross-correlation method, but it ...
Akash Maity's user avatar
3 votes
1 answer
853 views

GCC-PHAT always peaks at zero when estimating delay offset

My question is that when I used gcc-phat to estimate delay between two audio signals, it always returns zero offset. However normal cross correlation Xcorr gives a good result. I don't know the reason....
Qiang's user avatar
  • 33
3 votes
2 answers
6k views

Cross-correlation peak

How get cross-correlation peak and based on it calculate correlation score for similarity of two audio samples. SO far I've FFT two samples complex conjugate second multiply results IFFT cross-...
user4947's user avatar
2 votes
1 answer
2k views

GCC-PHAT (Generalized cross correlation) always peak at delay=0 on real audio signal

I have studied the GCC-PHAT algorithm to estimate TDOA on audio signals at 2 mics. Here is my MATLAB implementation: ...
LCS's user avatar
  • 21
2 votes
2 answers
2k views

Problem with Generalized Cross Correlation (PHAT filter)

I have to calculate time delay between two signals.I am using the GCC-PHAT method. First, I cut the signals into smaller parts (~0.5s) and then try to calculate the delay. When I display those two ...
d7vid's user avatar
  • 21
2 votes
3 answers
1k views

Is possible to compare to audio samples with cross-correlation [duplicate]

Is it possible to compare two audio samples(meaning find word from one in another) realtime with cross-correlation?
user4947's user avatar
2 votes
1 answer
658 views

Proving the upper bound of cross correlation

I am reading about cross-correlation from this document and equation (5) states that The maximum value of the crosscorrelation is not always when the shift equals zero; however, we can prove the ...
Karn Watcharasupat's user avatar
2 votes
1 answer
1k views

Understanding time delay estimation for GPS?

I really need help to understand these questions which is highlight, for the GPS situation, I hope anyone who has been working in this situation before, please help me to have a clear understanding ...
phuc nguyen's user avatar
2 votes
2 answers
955 views

GPS CA Signal Acquisition

The coarse acquisition C/A GPS signal has a symbol rate or chip rate of 1.023 Mcps with code period of 1 ms. The code bandwidth is +/-1.023MHz (to 1st sinc nulls). I'd like to record this signal using ...
random_dsp_guy's user avatar
1 vote
1 answer
640 views

Real Data Complex Transfer Function using H0, H1, H2 Estimators

BACKGROUND: This question is attempting to consolidate material discussed in two previous topics. These are: Understanding the H1 and H2 estimators @Pontus S Frequency-domain deconvolution: "...
telemeister's user avatar
1 vote
1 answer
1k views

CWT at low scales: PyWavelets vs Scipy

Low scales are arguably the most challenging to implement due to limitations in discretized representations. Detailed comparison here; the principal difference is in how the two handle wavelets at ...
OverLordGoldDragon's user avatar
1 vote
2 answers
444 views

Is 2D circular cross-correlation with FFT done as described in this source?

Given input images x and h of same size, greyscale 2D and potentially complex, we seek circular ...
OverLordGoldDragon's user avatar
1 vote
3 answers
368 views

How do I know quantitatively if the correlation of two time series is significant?

I computed the correlation coefficient of two time series of daily observations, x and y, but noticed that the more sampling ...
wsdzbm's user avatar
  • 217
1 vote
2 answers
2k views

How to Match 2 Signals which Are a Shifted and Scaled Version of Each Other

I have 2 signals S1 and S2 that contain the same information, but S2 is shifted and scaled compared to S1 by an unknown amount (but small; eg shift would be of the order of 1-10 samples). What is the ...
Stevo's user avatar
  • 67
1 vote
0 answers
377 views

Train Pulse Recognition in Medium Voltage Networks

I just started a project in the Smart Grids area. It involves the recognition and quick extinction of earth faults in a medium voltage system. The system works automatically and pretty much gets rid ...
user7085's user avatar
1 vote
1 answer
365 views

Why the spectral coherence is unity for all frequencies between single-frequency time series and itself

In the example below, I am plotting the coherence between time series and itself. The time series do has one frequency.The coherence magnitude was one for all frequencies. I wonder why it is not zero ...
Kernel's user avatar
  • 123
1 vote
1 answer
804 views

Time delay estimation using ultrasound

I have a sound source that generates an ultrasonic pulse. I have two microphones seperated by a distance which are at a distance from the source. I want to find the time delay of arrival of the ...
BaluRaman's user avatar
  • 689
0 votes
1 answer
329 views

Estimate the time delay of two signals

I am having 2 sets of data data1 and data2 .I wanted to find the delay between the two datasets. Assume data1=[1 2 3 4 5 6 7 8 9 10] and data2=[0 0 0 0 1 2 3 4 5 6].From the data I know that, data2 is ...
Deepa's user avatar
  • 293
0 votes
1 answer
4k views

How to find the period of a noisy signal using MATLAB's $\tt xcorr$?

Here is my code: function [ T ] = FindPeriodicity2(x,Fs) ac=xcorr(x,x); [~,locs]=findpeaks(ac); T=mean(diff(locs)/Fs); end and when I pass the signal ...
MAh2014's user avatar
  • 135