Sign in

username:

password:



Not a member?

Search compdsp



Search tips

comp.dsp by Keywords

Adaptive Filter | ADPCM | ADSP | ADSP-2181 | Aliasing | AMR | Anti-Aliasing | ARMA | Autocorrelation | AutoCovariance | Beamforming | Bessel | Blackfin | Butterworth | C6713 | CCS | Chebyshev | CIC Filter | Circular Convolution | Code Composer Studio | Comb Filter | Compression | Convolution | Cross Correlation | DCT | Decimation | Deconvolution | Demodulation | DM642 | DSP Boards | DSP/BIOS | DTMF | Echo Cancellation | Equalization | Equalizer | ETSI | EZLITE (Ez-kit Lite) | FFT | FFTW | FIR Filter | Fixed Point | FSK | G.711 | G.723 | G.729 | Gaussian Noise | Goertzel | GPIO | Hilbert Transform | IFFT | IIR Filter | Interpolation | Invariance | JTAG | Kalman | Laplace Transform | Levinson | LPC | McBSP | MIPS | Modulation | MPEG | Multirate | Notch Filter | Nyquist | OFDM | Oversampling | Pink Noise | Pitch | PLL | Polyphase | QAM | QDMA | Quantization | Quantizer | Radar | Random Noise | Reed Solomon | Remez | Resampling | RTDX | Sampling | Sharc | TI C6711 | Undersampling | Viterbi | Wavelets | White Noise | Wiener Filter | Windowing | XDS510PP | Z Transform

Ads

Discussion Groups

Free Online Books

See Also

Embedded SystemsFPGAElectronics

Discussion Groups | Comp.DSP | Cross Correlation Definition

There are 4 messages in this thread.

You are currently looking at messages 0 to 4.


Cross Correlation Definition - porterboy - 2004-02-23 06:12:00

My (1st) edition of Oppenheimer and Schafer defines the
crosscorrelation of stationary signals x and y as:

rxy(k) = E[x(n)y(n+k)*]

whereas Matlab defines it as 

rxy(k) = E[x(n)y(n-k)*]

(See http://www.mathworks.com/access/helpdesk/help/bugfixes_12.shtml#fix47)

Which is correct? They are time-reversed and have different lags, so
it is not a trivial distinction when it comes to implementation...
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Cross Correlation Definition - Fred Marshall - 2004-02-23 12:25:00



"porterboy" <p...@yahoo.com> wrote in message
news:c...@posting.google.com...
> My (1st) edition of Oppenheimer and Schafer defines the
> crosscorrelation of stationary signals x and y as:
>
> rxy(k) = E[x(n)y(n+k)*]
>
> whereas Matlab defines it as
>
> rxy(k) = E[x(n)y(n-k)*]
>
> (See
http://www.mathworks.com/access/helpdesk/help/bugfixes_12.shtml#fix47)
>
> Which is correct? They are time-reversed and have different lags, so
> it is not a trivial distinction when it comes to implementation...

It may be that either one will generate a correct result depending on what
assumptions are being made about x and y.  e.g. are they real?  even?  odd?
none of the above?

Correlation does not flip one of the signals before integrating.
Convolution does.
If the signals are complex, then the complex conjugate is needed in the
calculation.

So, you might use:

rxy(k) = E[x(n)y(k+n)*]  where "*" denotes complex conjugate.
Note that the "+n" does not flip y in time and k is the running variable for
the integration on the right side.

Now, if you use
rxy(k) = E[x(n)y(n-k)*] instead, then you're doing convolution because y is
reversed in time isn't it?
If y is even and real or odd and imaginary this might still work - can you
see why?

Fred







______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Cross Correlation Definition - 2004-02-23 15:48:00

"porterboy" <p...@yahoo.com> asked in message
news:c...@posting.google.com...
> My (1st) edition of Oppenheimer and Schafer defines the
> crosscorrelation of stationary signals x and y as:
>
> rxy(k) = E[x(n)y(n+k)*]
>
> whereas Matlab defines it as
>
> rxy(k) = E[x(n)y(n-k)*]
>
> (See
http://www.mathworks.com/access/helpdesk/help/bugfixes_12.shtml#fix47)
>
> Which is correct? They are time-reversed and have different lags, so
> it is not a trivial distinction when it comes to implementation...

Both definitions are "correct" and one reaches the same conclusions
regardless of which definition is used (consistently, of course!)

For stationary signals, r_{xy, os}(k) = E[x(n)y*(n+k)] and
r_{xy, matlab} = E[x(m)y*(m-k)] do not depend on the choice
of n or m.  For given value of k, if we choose our favorite
value for m, and then choose n = m-k, we get that
r_{xy, os}(k) = E[x(n)y*(n+k)] = E[x(m-k)y*(m)]
= E[{x*(m-k)y(m)}*] = {E[y(m)x*(m-k)]}* = {r_{yx,matlab}(k)}*.
Similarly, r_{xy,matlab}(k) = {r_{yx,os}(k)}*.  In other words,
to convert from one definition to the other, interchange the signals
and take the complex conjugate of the final result.


In short


______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.

Re: Cross Correlation Definition - santosh nath - 2004-02-24 09:34:00

"Dilip V. Sarwate" <s...@YouEyeYouSee.edu> wrote in message
news:<c1dov4$ejr$1...@news.ks.uiuc.edu>...
> "porterboy" <p...@yahoo.com> asked in message
> news:c...@posting.google.com...
> > My (1st) edition of Oppenheimer and Schafer defines the
> > crosscorrelation of stationary signals x and y as:
> >
> > rxy(k) = E[x(n)y(n+k)*]
> >
> > whereas Matlab defines it as
> >
> > rxy(k) = E[x(n)y(n-k)*]
> >
> > (See
>  http://www.mathworks.com/access/helpdesk/help/bugfixes_12.shtml#fix47)
> >
> > Which is correct? They are time-reversed and have different lags, so
> > it is not a trivial distinction when it comes to implementation...
> 
> Both definitions are "correct" and one reaches the same conclusions
> regardless of which definition is used (consistently, of course!)
> 
> For stationary signals, r_{xy, os}(k) = E[x(n)y*(n+k)] and
> r_{xy, matlab} = E[x(m)y*(m-k)] do not depend on the choice
> of n or m.  For given value of k, if we choose our favorite
> value for m, and then choose n = m-k, we get that
> r_{xy, os}(k) = E[x(n)y*(n+k)] = E[x(m-k)y*(m)]
> = E[{x*(m-k)y(m)}*] = {E[y(m)x*(m-k)]}* = {r_{yx,matlab}(k)}*.
> Similarly, r_{xy,matlab}(k) = {r_{yx,os}(k)}*.  In other words,
> to convert from one definition to the other, interchange the signals
> and take the complex conjugate of the final result.
> 
> 
> In short

Very impressive! A quick query - how does it appear if it is not stationary?
santosh
______________________________
New DSP Code Snippets Section now Live.   Learn more about the reward program for contributors here.