Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
xcorr (cross-correlation)

Subject: xcorr (cross-correlation)

From: RV

Date: 15 Jul, 2008 16:47:03

Message: 1 of 6

Hi,

I am using the function xcorr (cross-correlation)as follows:

c = xcorr(x,y,'coeff')

by using 'coeff' it normalizes the sequence so the
autocorrelations at zero lag are identically 1.0.

I would like to calculate the cross-correlation coefficient
between vectors x and y at different lags but without
normalization.

The other 'options'

1) 'biased': Biased estimate of the cross-correlation
function

or

2) 'unbiased': Unbiased estimate of the cross-correlation
function

does not generate an output with the cross-correlation
coefficient.


Thanks for your help

Subject: xcorr (cross-correlation)

From: Andrew Palmer

Date: 15 Jul, 2008 18:49:02

Message: 2 of 6

"RV " <cyanokybus@yahoo.com> wrote in message
<g5ika7$6sg$1@fred.mathworks.com>...
> Hi,
>
> I am using the function xcorr (cross-correlation)as follows:
>
> c = xcorr(x,y,'coeff')
>
> by using 'coeff' it normalizes the sequence so the
> autocorrelations at zero lag are identically 1.0.
>
> I would like to calculate the cross-correlation coefficient
> between vectors x and y at different lags but without
> normalization.
>
> The other 'options'
>
> 1) 'biased': Biased estimate of the cross-correlation
> function
>
> or
>
> 2) 'unbiased': Unbiased estimate of the cross-correlation
> function
>
> does not generate an output with the cross-correlation
> coefficient.
>
>
> Thanks for your help
>
>
>
>
>
>
>
>

I believe there is another option:
3) 'none': use the raw, unscaled cross-correlations

Subject: xcorr (cross-correlation)

From: RV

Date: 21 Jul, 2008 15:59:03

Message: 3 of 6

I guess the question is:

By using c = xcorr(x,y,'coeff')

matlab generates standardize cross-correlation coefficients.
How to generate un-standardize cross-correlation
coefficients (range -1 to 1)?

The other 'options': 'biased', 'unbiased' and 'none' does
not seem to provide cross-correlation coefficients.

Do I need to do an extra calculation to obtain the
correlation coefficient when I ask for the 'none' option?

Thanks



"RV " <cyanokybus@yahoo.com> wrote in message
<g5ika7$6sg$1@fred.mathworks.com>...
> Hi,
>
> I am using the function xcorr (cross-correlation)as follows:
>
> c = xcorr(x,y,'coeff')
>
> by using 'coeff' it normalizes the sequence so the
> autocorrelations at zero lag are identically 1.0.
>
> I would like to calculate the cross-correlation coefficient
> between vectors x and y at different lags but without
> normalization.
>
> The other 'options'
>
> 1) 'biased': Biased estimate of the cross-correlation
> function
>
> or
>
> 2) 'unbiased': Unbiased estimate of the cross-correlation
> function
>
> does not generate an output with the cross-correlation
> coefficient.
>
>
> Thanks for your help
>
>
>
>
>
>
>
>

Subject: xcorr (cross-correlation)

From: Malcolm Lidierth

Date: 21 Jul, 2008 16:37:02

Message: 4 of 6

From the help
'coeff': Normalizes the sequence so the autocorrelations at
zero lag are identically 1.0.

But xcorr does not do that for cross-correlations
so 'coeff' seems to be what you are after if I have
understood. See the scaleXcorr function within xcorr.

It is not unusual to force a correlation of 1.0 at zero lag
in autocorrelations to get rid of rounding errors.

Subject: xcorr (cross-correlation)

From: KC

Date: 2 Mar, 2012 00:14:17

Message: 5 of 6

"RV" wrote in message <g5ika7$6sg$1@fred.mathworks.com>...
> Hi,
>
> I am using the function xcorr (cross-correlation)as follows:
>
> c = xcorr(x,y,'coeff')
>
> by using 'coeff' it normalizes the sequence so the
> autocorrelations at zero lag are identically 1.0.
>
> I would like to calculate the cross-correlation coefficient
> between vectors x and y at different lags but without
> normalization.
>
> The other 'options'
>
> 1) 'biased': Biased estimate of the cross-correlation
> function
>
> or
>
> 2) 'unbiased': Unbiased estimate of the cross-correlation
> function
>
> does not generate an output with the cross-correlation
> coefficient.
>
>
> Thanks for your help
>
>
RV -- did you ever get an answer that helped you for this question? I am having the same problem. Thanks, KC

Subject: xcorr (cross-correlation)

From: TideMan

Date: 2 Mar, 2012 00:55:27

Message: 6 of 6

On Friday, March 2, 2012 1:14:17 PM UTC+13, KC wrote:
> "RV" wrote in message <g5ika7$6sg$1@fred.mathworks.com>...
> > Hi,
> >
> > I am using the function xcorr (cross-correlation)as follows:
> >
> > c = xcorr(x,y,'coeff')
> >
> > by using 'coeff' it normalizes the sequence so the
> > autocorrelations at zero lag are identically 1.0.
> >
> > I would like to calculate the cross-correlation coefficient
> > between vectors x and y at different lags but without
> > normalization.
> >
> > The other 'options'
> >
> > 1) 'biased': Biased estimate of the cross-correlation
> > function
> >
> > or
> >
> > 2) 'unbiased': Unbiased estimate of the cross-correlation
> > function
> >
> > does not generate an output with the cross-correlation
> > coefficient.
> >
> >
> > Thanks for your help
> >
> >
> RV -- did you ever get an answer that helped you for this question? I am having the same problem. Thanks, KC

Why not use corrcoef?
help corrcoef

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us