- #1
Evo8
- 169
- 0
Homework Statement
Let x(t) be a transmitted radar pulse. The received radar pulse is y(t).
[itex]y(t)=ax(t-t_{d})+v(t)[/itex]
Where v(t) is the additive noise and td is the time delay. The signals x(t) and y(t) are sampled and processed digitally to determine the delay
The discrete time signals are:
x(n) = x(nT)
y(n) = ax(n − D) + v(n)
where v(n) is the noise in the received signal, T is the sampling time of the
receiver, and D is the number of samples the received pulse is delayed by
the round trip to the target.
1. Explain how we can use cross correlation to determine the delay
2.Let x(n) be the 13-point Barker sequence
x(n) = [11111 − 1 − 111 − 11 − 11]
and let v(n) be a Gaussian zero mean sequence with variance [itex]σ^{2} = .01[/itex]
A Gaussian random variable array with σ2 = 1 can be generated using randn(m,n). To convert the sequence to another value of σ2, just multiply the entire sequence by σ. Write a program that generates the sequence y(n), for 0 ≤ n ≤ 199 for variable parameters a and D. Choose D to be the last two digits of your birth year + the day of your birth. If your birthday was August 21, 1989, D = 89 + 21 = 110. Thus, in y(n), there will be D zeros prior to the beginning of the Barker sequence and enough zeros afterwards to increase the length of y(n) to 200.
D=94
a=0.8814
3. Plot the signals x(n) and y(n) for 0≤n≤199
4. Compute and plot the cross correlation. 0≤l≤185. Estimate the delay from the plot
Homework Equations
See code below.
The Attempt at a Solution
For #1 this is what I think. -The cross correlation can be used to determine the degree that two series are related or correlated. When the two signals are calculated and cross correlated the result can be graphed and analyzed for the delay. The bounds that the cross correlation is calculated to will indicate how much correlation at certain delays. If an area of interest is at the positive bound this shows a high correlation, if at the lower bound this indicated no correlation. If below the lower bound this can indicate a negative correlation.
Ok so I thought I had this one down but my results just don't match up to my original delay of 94. I get almost exactly double my original delay. Am I missing something here?
#3
Here is my code:
clear all
n=0:199;
a=0.8814;
D=94;
v=randn(1,200)*.01;
x=[zeros(1,94) 1 1 1 1 1 -1 -1 1 1 -1 1 -1 1 zeros(1,200-(13+D))];
y=a*x+v;
subplot(2,1,1); plot(x); grid
xlabel('...'); ylabel('...');
title('x(n) Plot');
subplot(2,1,2); plot(y); grid
xlabel('...'); ylabel('...');
title('y(n) Plot');
The plots from this code
For #4 I reused the code and added the cross correlation:
clear all
n=0:185;
a=0.8814;
D=94;
v=randn(1,200)*.01;
x=[zeros(1,94) 1 1 1 1 1 -1 -1 1 1 -1 1 -1 1 zeros(1,200-(13+D))];
y=a*x+v;
z=xcorr(x,y);
subplot(1,1,1); plot(z); grid
xlabel('Delay'); ylabel('Amplitude');
title('Cross Correlation');
The plot of my calculated cross correlation
From looking at this plot of the cross correlation I would say the delay is at 200. The delay I used in the data was 94 though? Where am I going wrong?
Thanks for any help on this and sorry for the super long post.