Final
Final
Bachelor of Technology
In
Computer Science & Engineering
By
K. Pranavi
(13003055)
A. Sriram
(13003066)
K L University
Green Fields, Vaddeswaram, Guntur District-522 502
2014-2015
K L University
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
CERTIFICA
TE
This is to certify that this project based lab report entitled TIME DELAY ESTIMATION
USING CORRELATION IN RADAR is a bonafide work done by ANNE SRIRAM
(13003066) in partial fulfilment of the requirement for the award of degree in BACHELOR
OF TECHNOLOGY in Computer Science and Engineering during the academic year
2014-2015.
Lecturer In Charge
K L University
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
DECLARATI
ON
We hereby declare that this project based lab report entitled TIME DELAY ESTIMATION
USING CORRELATION IN RADAR has been prepared by us in partial fulfilment of the
requirement for the award of degree BACHELOR OF TECHNOLOGY in COMPUTER
SCIENCE AND ENGINEERING during the academic year 2014-2015.
I also declare that this project based lab report is of our own effort and it has not been
submitted to any other university for the award of any degree.
BATCH 4
Date: -11-2014
K.PRANAVI
13003055
Place: Vaddeshwaram
A.SRIRAM
13003066
13003067
ACKNOWLEDGEMENTS
Our sincere thanks to Mr. Ravi Kumar Mokkapati in the Lab for their outstanding support
throughout the project for the successful completion of the work
We express our gratitude to Dr.K.Thirupathi Rao , Head of the Department for Computer
Science and Engineering for providing us with adequate facilities, ways and means by which
we are able to complete this term paper work.
We would like to place on record the deep sense of gratitude to the honourable Vice
Chancellor, K L University for providing the necessary facilities to carry the concluded term
paper work.
Last but not the least, we thank all Teaching and Non-Teaching Staff of our department and
especially my classmates and my friends for their support in the completion of our term paper
work.
K.PRANAVI
13003055
A.SRIRAM
13003066
13003067
PROJECT DESCRIPTION
Objectives:
(a) Understanding the basic theory of RADAR system.
(a) Implement the auto-correlation and cross-correlation for Radar system in the noisy
environment.
(b) Measuring the time delay by computing cross-correlation.
(c) Calculating the distance of the target.
FIG 1
x [n ] = xa(nT)
t
If we calculate the cross correlation between both signals, the max(or min) of the cross
correlation function indicates the in time where the signals are best aligned ie. The time delay
between the signals is determined by the argument of the max or arg max of cross-correlation
Barker Sequences
DESCRIPTION OF TASKS
1. Task1: Explain how we can measure the delay D by computing the auto-correlation
rxy (l) .
3. Task3:Compute and plot the cross-correlation rxy (l) , for the range (i) 0 <= l <= 59 and (ii)
-30 <= l <= 30 . Use the plot to estimate the value of the delay D in both cases and
compare and comment.
x[n] =[1,-1,-1,1,-1,1,1,-1,-1,1,1,1,1,1,-1,-1,-1,1,1,-1,1,1,1,-1,1,-1,1,-1,-1,-1,-1,-1]
and the received y[n] is given by
y[n] =[ 0.4923 0.6947 0.9727 0.3278 0.8378 0.7391 0.9542 0.0319 0.3569 0.6627
1.2815 -0.7696 -0.2889 1.6246 -0.4094 1.6604 1.0476 -0.6512 -0.5487 1.2409
1.7150 1.8562 1.2815 1.7311 -0.8622 -0.1633 -0.8614 1.5882 1.3662 -0.1932
1.5038 1.4896 1.8770 -0.6469 1.4494 -0.0365 1.0423 -0.0270 -0.8108 -0.3329
-0.4136 -0.3249 0.3610 0.6203 0.8112 0.0193 0.0839 0.9748 0.6513 0.2312
0.4035 0.1220 0.2684 0.2578 0.3317 0.1522 0.3480 0.1217 0.8842 0.0943]
Plot the cross-correlation function rxy (l) and from the plot find the time delay. If the
sampling frequency is 1 MHz, Find the distance between the object and the radar.
TASK 1:-
x[n] [1,1,1,1,1,1,1,1,1,1,1,1,1]
n=0:12;
x=[1,1,1,1,1,-1,-1,1,1,-1,1,-1,1];
y=xcorr(x,x)
figure();
subplot(2,1,1);
stem(n,x,'r','fill','linewidth',1.5);
axis([0 25 -2 14]);
title('x[n]');
xlabel('time');
ylabel('amplitude');
subplot(2,1,2);
stem(0:24,y,'k','fill');
axis([0 25 -2 14]);
title('Autocorrelation function of x[n]');
xlabel('lags');
ylabel('Autocorrelation');
output:
y=
Columns 1 through 9
1.0000 -0.0000
1.0000
1.0000
0.0000
1.0000
0.0000
1.0000
0.0000
Columns 10 through 18
0.0000
0.0000
1.0000 -0.0000
Columns 19 through 25
1.0000
0.0000
1.0000
0.0000
1.0000
0.0000
1.0000
1.0000
amplitude
x[n]
10
5
Autocorrelation
0
0
10
15
time
Autocorrelation function of x[n]
20
25
20
25
10
5
0
10
lags
15
FIG 2
The maximum value in the auto correlation graph gives us the delay D i.e. 12
n=0:12;
x=[1,1,1,1,1,-1,-1,1,1,-1,1,-1,1];
y=randn(1,13);
Rxx=xcorr(x,x)
Rxy=xcorr(x,y)
figure();
subplot(2,1,1);
stem(n,x,'r','fill','linewidth',1.5);
axis([0 13 -2 5]);
title('x[n]');
xlabel('time');
ylabel('amplitude');
subplot(2,1,2);
stem(0:24,Rxy,'k','fill');
axis([0 25 -6 10]);
title('crosscorrelation function of x[n]');
xlabel('lags');
ylabel('crosscorrelation');
output:
Rxx =
Columns 1 through 9
1.0000 -0.0000
1.0000
1.0000
0.0000
1.0000
0.0000
1.0000
0.0000
Columns 10 through 18
0.0000
0.0000
1.0000 -0.0000
1.0000
Columns 19 through 25
1.0000
0.0000
1.0000
0.0000
1.0000
0.0000
1.0000
3.2299
2.1408
0.1698 -2.2570
Rxy =
Columns 1 through 9
1.5442
1.4642
2.6448
3.1973
0.0977
Columns 10 through 18
3.1915
6.3374
Columns 19 through 25
-2.8055
0.3529 -2.4098
1.6401 -0.1075
0.1006 -1.2141
x[n]
amplitude
4
2
0
-2
0
6
8
time
crosscorrelation function of x[n]
crosscorrelation
10
10
12
5
0
-5
0
FIG 3
10
lags
15
20
25
The difference between vector index of the maximum, of the autocorrelation function (rxx)
and cross-correlation function (rxy), gives us time delay in this case it is
17-13=4.
TASK 2:-
n=0:199;
a=0.9;
d=20;
v=randn(1,200)*0.1;
x=[zeros(1,94),1,1,1,1,1,-1,-1,1,1,-1,1,-1,1,zeros(1,200-(13+94))];
x1=[zeros(1,114),1,1,1,1,1,-1,-1,1,1,-1,1,-1,1,zeros(1,200-(13+94+20))];
y=a*(x1)+v;
figure();
subplot(2,1,1);
stem(n,x,'r','fill');
title('BARKER SEQUENCE');
xlabel('time');
ylabel('amplitude');
subplot(2,1,2);
stem(n,y,'k','fill','linewidth',1.5);
title('y(n)');
xlabel('time');
ylabel('amplitude');
BARKER SEQUENCE
amplitude
1
0.5
0
-0.5
-1
20
40
60
80
100
time
y(n)
120
140
160
180
200
20
40
60
80
100
time
120
140
160
180
200
amplitude
2
1
0
-1
-2
FIG 4
TASK 3:-
n=0:199;
a=0.9;
d=20;
v=randn(1,200)*0.1;
x=[zeros(1,94),1,1,1,1,1,-1,-1,1,1,-1,1,-1,1,zeros(1,200-(13+94))];
x1=[zeros(1,114),1,1,1,1,1,-1,-1,1,1,-1,1,-1,1,zeros(1,200-(13+94+20))];
y=a*(x1)+v;
Rxy=xcorr(x,y,60)
Rxy1=xcorr(x,y,30)
figure();
subplot(2,1,1);
stem(0:120,Rxy,'r','fill');
title('time lag between 0 to 59');
xlabel('time');
ylabel('amplitude');
subplot(2,1,2);
stem(0:59,Rxy1,'k','fill','linewidth',1.5);
title('time lag b/w -30 to 30');
xlabel('time');
ylabel('amplitude');
amplitude
15
10
5
0
-5
20
40
10
20
amplitude
15
100
120
50
60
10
5
0
-5
FIG 5
60
80
time
time lag b/w -30 to 30
30
time
40
amplitude
15
10
5
0
-5
20
40
10
20
amplitude
15
60
80
time
time lag b/w -30 to 30
100
120
50
60
10
5
0
-5
FIG 6
For variance = 1
30
time
40
n=0:199;
a=0.9;
d=20;
v=randn(1,200)*1;
x=[zeros(1,94),1,1,1,1,1,-1,-1,1,1,-1,1,-1,1,zeros(1,200-(13+94))];
x1=[zeros(1,114),1,1,1,1,1,-1,-1,1,1,-1,1,-1,1,zeros(1,200-(13+94+20))];
y=a*(x1)+v;
Rxy=xcorr(x,y,60)
Rxy1=xcorr(x,y,30)
figure();
subplot(2,1,1);
stem(0:120,Rxy,'r','fill');
title('time lag between 0 to 59');
xlabel('time');
ylabel('amplitude');
subplot(2,1,2);
stem(0:60,Rxy1,'k','fill','linewidth',1.5);
title('time lag b/w -30 to 30');
xlabel('time');
ylabel('amplitude');
amplitude
20
10
0
-10
20
40
10
20
amplitude
20
60
80
time
time lag b/w -30 to 30
100
120
50
60
10
0
-10
FIG 7
TASK 5:-
30
time
40
30
Rxy(l)
25
20
amplitude
15
10
5
0
-5
-10
FIG 8
20
40
60
lag
80
100
120
CONCLUSION
By this project, we have observed that the delay in time of a particular sequence can be
calculate using correlation or more specifically auto-correlation. We can also understand the
syntax of correlation in MATLAB.
We also explore some different topics such as Barker Sequences, and the effect of variance on
the time delay.
REFERENCE
1. Page 116 and 144, John G. Proakis and Dimitris G. Manolakis. Digital Signal
Processing,
2. Principles, Algorithms and Applibations, Fourth edition, Pearson Prentice Hall, 2007.