Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

auto correlation and cross correlation values

Status
Not open for further replies.

abhigopal

Member level 3
Joined
Dec 21, 2004
Messages
61
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
624
Hi all,
I have a question! I have a vector( array of elements) and I need to compute the auto-correlation matrix for this. How do I do it in Matlab. This matrix needs to be toeplitz and symmetrical.

Also on the same lines, How do i perform cross correlation between 2 sets of elements (arrays again) using matlab.

I need all this because of work I am doing in Statistical Signal Processing,
Thanks all
Abhi
 

Just use 'xcorr' function. see help for the useage.
 

all these these r given in matlab tool box just take help from thre.
 

hi if x is a row vector then xTx shd give u auto correlation matrix whic is symmetric and Toeplitz.
matlab code is

R = x'.*x;

this will give u the Auto correlation matrix


thnx

purna
 

performing what you suggested:

>> x=rand(1,5)

x =

0.7621 0.4565 0.0185 0.8214 0.4447

>> R=x'*x

R =

0.5808 0.3479 0.0141 0.6260 0.3389
0.3479 0.2084 0.0084 0.3749 0.2030
0.0141 0.0084 0.0003 0.0152 0.0082
0.6260 0.3749 0.0152 0.6747 0.3653
0.3389 0.2030 0.0082 0.3653 0.1978


Sorry it is not a toeplitz
 

abhigopal said:
Hi all,
I have a question! I have a vector( array of elements) and I need to compute the auto-correlation matrix for this. How do I do it in Matlab. This matrix needs to be toeplitz and symmetrical.

I had the same doubt as you, and I still dont know if I achieved the solution, I will share it , and I will be glad if I had comments:

the crosscorrelation matriz is quoted in AR, ARMA methods, LMS, RLS and many others, it is a toeplitz hermitian matrix.

Lets consider a randon set of data and find the autocorrelation matrix:

>> x=rand(1,5)

x =

0.6154 0.7919 0.9218 0.7382 0.1763

>> r=xcorr(x)

r =

0.1085 0.5939 1.3144 2.0280 2.4317 2.0280 1.3144 0.5939 0.1085

>> R= toeplitz(r)

R =

0.1085 0.5939 1.3144 2.0280 2.4317 2.0280 1.3144 0.5939 0.1085
0.5939 0.1085 0.5939 1.3144 2.0280 2.4317 2.0280 1.3144 0.5939
1.3144 0.5939 0.1085 0.5939 1.3144 2.0280 2.4317 2.0280 1.3144
2.0280 1.3144 0.5939 0.1085 0.5939 1.3144 2.0280 2.4317 2.0280
2.4317 2.0280 1.3144 0.5939 0.1085 0.5939 1.3144 2.0280 2.4317
2.0280 2.4317 2.0280 1.3144 0.5939 0.1085 0.5939 1.3144 2.0280
1.3144 2.0280 2.4317 2.0280 1.3144 0.5939 0.1085 0.5939 1.3144
0.5939 1.3144 2.0280 2.4317 2.0280 1.3144 0.5939 0.1085 0.5939
0.1085 0.5939 1.3144 2.0280 2.4317 2.0280 1.3144 0.5939 0.1085

So R is a toeplitz and Hermitian matrix built with the autocorrelation of x. Is it right ?


abhigopal said:
Also on the same lines, How do i perform cross correlation between 2 sets of elements (arrays again) using matlab.

I need all this because of work I am doing in Statistical Signal Processing,
Thanks all
Abhi

To perform crosscorrelation you take the two set of data x1,x2 and use the comand xcorr1(x1,x2) care must be taken when the signals are periodic and of different lengths, in this case you have to zero pad N2-1 zeros to x1 and N1-1 zeros to x2 where N1 and N2 are the length of x1 and x2.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top