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.

Autocorrelation function intuition

Status
Not open for further replies.

urwelcome

Banned
Member level 5
Joined
Apr 12, 2007
Messages
83
Helped
7
Reputation
14
Reaction score
3
Trophy points
1,288
Activity points
0
autocorrelation function

How to find autocorrelation function please if possible give some practical example where it is useful for example in mobile communication where do we use it.

and is there any java applet or something like that to get the intuition of seeing the operation done during finding autocorrelation function.

Finally how to generate sequence and than its autocorrelation function in matlab.

I would be greatly thankful to you as this is very basic and I need them badly.

Regards,
 

autocorrelation in java

Autocorrelation gives you a measure of how much a signal resembles itself when it is shifted. It is found by just multiplying a signal with its shifterd version and averaging the result. It is written something like this

R(Γ) = ∫ f(t)*f(t-Γ)dt

you can clearly see the multiplication and averaging.

In mobile applications it is sometimes helpful if a signal doesnt resemble its shifted versions. In autocorr terms you say that the autocorr should be ideally a peak at 0 and zero elsewhere ie; the signal mismatches significantly with its own shifted versions and resembles only its unshifted version.
-b
 

    urwelcome

    Points: 2
    Helpful Answer Positive Rating
autocorrelation function in matlab

correlation is used in signal detection.


Naveed
 

    urwelcome

    Points: 2
    Helpful Answer Positive Rating
autocorrelation function matlab

I'd just like to add to Naveed's mention.

In communications you send out a message which is normally modulated onto a carrier. Simply think of sending a 1 as sin(2*pi*f1*t) and 0 as sin(2*pi*f1*t), two frequencies for the two binary symbols.

At the receiver you correlate the noise-corrupte.d waves that have been sent, without knowing which you are receiveing, with both original 2 waveforms that you know you expect.

Whichever gives the best correlation ( which finally equals an auto-correlation because only the corrupted waveform that was originally 1 will have the highest correlation with the 1 original waveform...) will show you which symbol was sent. That is the detector: it sees which of the 2 coreelation results is higher and "decides" what to give you as a result.

I have't mentioned the phase problem (transmission through channels always introduces a phase difference between original signal and recieved one) but normally the receiver should take care of it and eliminate it, otherwise we use I and Q components of the signal... and I'm drifting from the explanation of the basics...

As for Matlab, you have functions such as "corr", or "xcorr", read their Help it's the most useful way. And just generate a simple sine wave,maybe sampled, shift it ( "circshift" allows for example to shift it by the number of samples ou want...). Everytime the result of the "integral" or addition of the multiplied terms, store it in a vector and then plot the vector, having as X axis the time line. That's what's known as the Rxx , autocorrelation function
 

    urwelcome

    Points: 2
    Helpful Answer Positive Rating
autocorr function in matlab

tzushki,

if u paste ur code here, it will be so easy for all..


Naveed
 

matlab autocorrelation function

I hope I'm not too wrong:

% sine wave 50 kHz and 100 kHz --> periods 0.02 and 0.01 s

t=[-0.4:0.00125:0.04];
s1=[];s2=[];
for i=1:size(t,2)
s1(i)=sin(2*pi*t(i)*50);
s2(i)=sin(2*pi*t(i)*100);
end

plotyy(t,s1,t,s2);

%We transmit so we corrupt s1 and s2, and say we transmit s1

% If there is no noise and no delay

Rs1=0;
Rs12=0;
Rs2=0;

for i=1:size(t,2)
Rs1=Rs1+s1(i)*s1(i); %autocorrelation function for s1 in tau=0 (tau is time difference related to the phase difference of the two waveforms (0 is reference)
Rs12=Rs12+s1(i)*s2(i); %Cross correlation function in t=0 between s1 and s2
% it equals Rs2s1
Rs2=Rs2+s2(i)*s2(i); %autocorrelation function for s2 in tau=0

end

stem([Rs1 Rs12 Rs2]); % to see that s1 and s2 have the high correlation point and in the middle the s12 correlation is 0

% The previous calculation will actually be in a loop and autocorrelation
% and cross-correlation is done for the shifted versions of the signals
% The smallest time interval I have is 0.00125s, so that means one sample
% shift in s1 values


for i=1:size(t,2)
corr_s1(i)=0;
corr_s12(i)=0;
end
for i=1:size(t,2)
for j=i:size(t,2)
corr_s1(i)=corr_s1(i)+s1(j)*s1(j-i+1); % shift of i-1 samples, Matlab index strats at 1...
corr_s12(i)=corr_s12(i)+s1(j)*s2(j-i+1);
end
end
plot(t,corr_s1,t,corr_s12);


am I very wrong?

much easier is to do xcorr(s1); and xcorr(s1,s2); and plot their results. It should be the same, I have no time to try now, sorry...
 

autocorr matlab

please follow the book

signals and systems by barry van veen and simon haykin
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top