How do you calculate cross and auto-correlation in time and frequency domains?

  • Thread starter Thread starter balanto
  • Start date Start date
  • Tags Tags
    Cross
Click For Summary

Discussion Overview

The discussion revolves around calculating cross-correlation and auto-correlation for given vectors in both time and frequency domains. Participants explore the concepts through specific homework problems, focusing on the time difference between signals and the relationship between auto-correlation and frequency representation.

Discussion Character

  • Homework-related
  • Mathematical reasoning
  • Technical explanation

Main Points Raised

  • One participant presents two homework problems involving cross-correlation and auto-correlation, seeking guidance on time difference and frequency correspondence.
  • Another participant suggests determining the lag of the non-zero entry in the cross-correlation and relates it to the raw signals.
  • A participant proposes that the lag should be 2, leading to a time difference of 2ms based on the sampling time of 1ms.
  • Concerns are raised about the calculation of the power spectral density and the limits of integration for the auto-correlation function.
  • One participant clarifies that the integral for the power spectral density involves the correlation function and questions the assumption of zero values in the auto-correlation.
  • Another participant corrects the count of values in the cross-correlation, noting there are 23 values instead of 14.

Areas of Agreement / Disagreement

Participants generally agree on the calculation of the lag and time difference but express uncertainty regarding the power spectral density and the interpretation of the auto-correlation results. Multiple competing views remain on the correct approach to these calculations.

Contextual Notes

Participants express uncertainty about the integration limits and the implications of the auto-correlation function. There are unresolved questions regarding the relationship between the calculated values and their interpretations in the frequency domain.

Who May Find This Useful

This discussion may be useful for students and practitioners interested in signal processing, particularly in understanding cross-correlation and auto-correlation in practical applications.

balanto
Messages
5
Reaction score
0
Homework Statement

1. Given two vectors
x = [0 0 1 0 0 ] and y = [0 0 0 0 1] find the cross correlation and the time difference between the pulses if the sampling frequency is 1kHz?

2. Given this vector calculate the auto correlation and if the signals is sampled at a frequency of 1MHz what does the signal correspond to in frequency
  1. x = {0, 0, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1}
The attempt at a solution
Cross correlation for problem 1:
[0 0 1 0 0 0 0 0 0]

Auto correlation for problem 2:
[0 0 1 2 1 0 2 4 2 0 3 6 3 0 2 4 2 0 1 2 1 0 0]

The thing I'm having a hard time about is finding the time difference for problem 1 and the corresponding frequency in problem 2. How do I approach that?
 
Physics news on Phys.org
1. What is the lag (offset from zero) of the non-zero entry in the xcorr? (You can also easily see the same time difference directly in the raw signals x and y.)
2. What theorem relates the autocorrelation function to the power spectral density?
 
marcusl said:
1. What is the lag (offset from zero) of the non-zero entry in the xcorr? (You can also easily see the same time difference directly in the raw signals x and y.)
2. What theorem relates the autocorrelation function to the power spectral density?

1. Okey, then the lag should be 2 in this case? Because there are two zero values before the first non-zero? And since the sampling time is 1ms then the time difference would be 2ms?
2. That would be integral of [f(t)*e^(-jwt) dt] where f(t) is the correlation function. Although I'm not sure what to do here. Since our autocorrelation have 15 values, from 0 - 14, then the limits of integrations would be 0 --> 14, but that would only result in 0. I am not quite sure I understand cross/autocorrelation and its applications

Thanks for the reply!
 
Number one is correct.
For number two, why do you think it is zero? In general, there will be an infinite number of omega frequencies to evaluate. In practice, you can assume a discrete Fourier transform, and just evaluate integer values k such that omega runs from 0 to 14 * 2*pi.
As for the meaning of autocorrelation, it gives the extent to which each point in a sequence is related to its nearest neighbors, next nearest neighbors, and so on.
 
Last edited:
I think my last post could have been clearer. The exponential for a discrete FT looks like exp\left(\frac{-j2\pi nk}{N}\right) with the indices n and k running from 0 to N-1. Here n indexes time and k indexes frequency. Also I just counted the number of values in your cross correlation and there are 23, not 14.
 
Last edited:

Similar threads

Replies
2
Views
2K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 18 ·
Replies
18
Views
4K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 18 ·
Replies
18
Views
2K
  • · Replies 8 ·
Replies
8
Views
3K
  • · Replies 21 ·
Replies
21
Views
3K