Lab 4: Satellite Signal Generator


Due: in class September 13, 2003

Given:

Comments:

In your homework, you learned how to create the 1+ x3 + x10 PRN sequence. This is actually used by GPS receivers to create the C/A code, i.e. the civilian/access code that is used on all GPS satellites. Each satellite has its own C/A code. A GPS receiver is built with the instructions to create all the codes. When it receives a signal, it compares the signals it knows about with what it has received. The way that it compares the signals is called cross-correlation. We will use Matlab to do the same thing, via a function called xcorr(see below).

Steps to follow:

  1. Generate 1+ x3 + x10 PRN sequence using your homework.

  2. Generate the autocorrelation of this sequence. Plot. Use xcorr with scale option set to 'coeff'. This option makes sure that the plots will be properly scaled.

  3. Cross-correlate your 1+ x3 + x10 PRN sequence with my 1+ x7 + x10 PRN sequence. Plot.

  4. Make a new 1+ x3 + x10 PRN sequence, PRNnew, which is just like your original PRN, but shifted by 100 so that PRNnew(1) = PRNoriginal(101), etc. Cross-correlate your original 1+ x3 + x10 and PRNnew. Plot. What is the difference between calling xcorr(PRN, PRNnew, 'coeff') and xcorr(PRNnew, PRN, 'coeff')? Using Matlab, determine the shift of the cross correlation. If what you compute doesn't agree with the shift that you put in, you know you've made a mistake.

  5. Load the mystery PRN sequence.

  6. Using a for loop, create 10 C/A codes and cross-correlate them with the mystery sequence. Which satellite PRN is stored in the mystery sequence? While I want you to look at the plots, I don't want you to figure out which PRN is stored in the mystery sequence by eye. Your code should figure it out for you. How far is your C/A code PRN sequence shifted with respect to the mystery sequence ? Only turn in the plot of the correct PRN number, i.e. not all 10 of them. Make sure you write down the number of the PRN number on your plot, or use the text command to do so.
Plots

All cross-correlation plots should use the same x and y axis limits. Why? It is difficult to compare things if you use different axes on every figure.

Matlab Help

xcorr is Matlab's correlation function. Given two 1023-long sequences, Matlab will return 2*1023 - 1 responses. You can think of this as 1022 negative shifts, zero shift in the middle, and 1022 positive shifts. When plotting the cross correlations, please use a "shift" for the x-axis that runs from -1022 thru 1022.

Turn in:

requested answers to questions, plots and code. I do not want your PRN generator code.