Re: Cross correlation in signal analysis



On Apr 18, 3:16 pm, brob...@xxxxxxxxx wrote:
Hello,
I'm trying to gain understanding of cross correlation practical use.
My textbook (among others) define auto and cross correlation and
states they are both widely used in signal processing and detecting
signals with noise. So, I simply want to learn how to use it
effectively.
I made simple script in MATLAB:
t = 0:0.1:10; %time
x = 2*sin(t);
plot(x)
z = randn(1,length(t));
hold on;
plot(z,'r');

xcorrelation = xcorr(x,z);
figure(2)
plot(correlation,'g');
hold on
acorrelation = xcorr(x,x)
plot(acorrelation,'m');

I wanted to see how cross corelation look like when signal (sinusiod)
is correlated with itself and with noise.
If you execute this script, you'll see that auto correlation of
sinusoids has much higher amplitude then cross correlation (noise nad
sinusoide) as expected.
Now I'm trying to figure out how to make practical use of that? What
treshold to set in order to make a guess if signal is sinusoid ore
something else?
I simply don't know what to do further.
Can you explain a little bit more? I hope there are people here who
use correlation in practice and research and who can give one or two
useful advices.
Thank you

Auto correlation is used to determine if there is an ‘echo’ or time-
delayed version(s) of a signal in the data from one sensor. It’s
performed by taking the FFT of the sensor data, multiplying the
transform with its complex conjugate, inverse transforming, and then
using a peak detector on the output. The peak(s) in the output tell
you the time delay or delays, if there are multiple echoes.
Mathematically, auto correlation is similar to the convolution of a
signal with itself (F[k] below is the transform of the signal):

convolution: F[k] times F[k] then inverse transform
auto correlation: F[k] times F[k]* (* = conjugate) then
inverse transform

The reason for the conjugation operation has to do with the fact that
you don’t want that ‘time reversal’ thing that happens with
convolution.

As with convolution, you should zero-pad to avoid doing a circular
auto correlation.

Cross correlation is used to determine if there is a time delay
between a signal arriving at two spatially separate sensors. It’s
performed by taking the FFTs of data from each sensor, conjugating one
of them, multiplying them, point by point, and then inverse
transforming. Once again, you should zero-pad to avoid circular cross
correlation.

If there is a strong, unwanted sinusoid in your input, then the result
of the cross correlation will be based on the strong unwanted
sinusoid. You can minimize the effect of the unwanted component by
using a window function in the frequency domain prior to inverse
transforming. That is, FFT each sensor, conjugate one result,
multiply the transforms, multiply by the window, inverse transform,
then peak detect. But note that the window functions (there are
several, some much better than others) are NOT like the window
functions (e.g.: Hann, Hamming, etc.) used to minimize leakage and
picket fence effects.

Here’s 3 references that may help:

J. C. Hassab, R. E. Boucher, “Optimum Estimation of Time Delay by a
Generalized Correlator,” IEEE T-ASSP, vol. 27, no. 4, Aug. 1979, pp.
373-380.

J. C. Hassab, R. E. Boucher, “Performance of the Generalized Cross
Correlator in the Presence of a Strong Spectral Peak in the Signal,”
IEEE T-ASSP, vol. 29, no. 3, June 1981, pp. 549-555.

J. C. Hassab, R. E. Boucher, “An Experimental Comparison of Optimum
and Sub-Optimum Filters’ Effectiveness in the Generalized Correlator,”
J. Sound and Vibration, 1981, (12 pages total - I got this as a class
handout, and it doesn’t have the page numbers).
.



Relevant Pages

  • Cross Correlation - phase or magnitude or both?
    ... I have written a cross correlation algorithm which is giving me quite a few ... Summing the prducts is like taking the area under the resulting curve ... Now, if the signals are similar, and unslid, then their products will ...
    (comp.dsp)
  • Re: Cross correlation in signal analysis
    ... I'm trying to gain understanding of cross correlation practical use. ... use correlation in practice and research and who can give one or two ... Barker codes are used in 80.211b for example. ...
    (comp.dsp)
  • Re: trying to find 2D similarity patterns by xcorr2
    ... If you want to measure similarity based on maximum correlation that's ... We find and locate the max value of that cross correlation: ...
    (sci.image.processing)
  • Re: Finding a small image in another one
    ... I assume it not exactly the same but is at the same scale and not rotated. ... You should look at "correlation" techniques. ... The algorithm is better than cross correlation although, because cross correlation can be implemented in the frequency domain, cross correlation can be a lot faster. ...
    (sci.image.processing)
  • Re: to calculate time delay between two signals
    ... correlation and you look for the lag with the maximum magnitude value. ... amplify mutually weak frequency components (or relatively attenuate ... The 'generalized' cross correlator uses a filter in the frequency ... So you transform the outputs of 2 sensors, ...
    (comp.dsp)