Friday, 27 November 2015

What is Side band tracking in GPS?

0. Tracking the incoming GPS signal at a fixed frequency offset from its actual frequency is known as Side band tracking.  This occurs due to 'some' logic (described below) used in the discriminator to negate the effect of sudden 180 degree phase shift due to data-bit transition. This frequency offset depends solely on the loop integration time for such a 'logic.'

Side-band tracking detection: is not done by the loops but it is detected by checking the following:

a. Monitoring abrupt change in the Doppler frequency in the tracking, by keeping track of the time evolution of the Doppler. While in tracking, the Doppler change due to receiver dynamics and oscillator's g-sensitivity can cause side-band tracking. This can also happen during acquisition to tracking transition with large Doppler error.

b. Increasing parity errors in the decoded navigation data-bits.

c. Increasing code and carrier divergence.

Some points are given below:

1. Sideband-frequency-tracking is independent of the data-rate/data-bit period. So, explaining this using data-bits-spectrum is not possible. However, it occurs due to a logic used to negate the effect of 180 degree phase-difference introduced by the data-bit transitions. 

2. That 'conditional LOGIC' in the discriminator is
if phi > 90
      phi = phi - 180
else if phi<-90
      phi = phi + 180 

where, phi - phase difference between the epochs at the start and end of the integration period. 

Let us use 'atan' function, whose output are within +/- 90 degrees

3. Now, there are two cases which PASS the conditional logic above. 
    a. Data-bit transition 

    b. Some frequency offset - this frequency offset is such that within the given integration time (Pre-detection integration time, Tcoh) the phi > 90 degrees. That is  f * Tcoh >= 0.25 cycles. Or 2*pi*f*Tcoh >= pi/2 radians). i.e., f >= 1 / (4*Tcoh). 

For example: if Tcoh =10 ms, f >= 25 Hz. 

Matlab:
f = 25;
Tcoh = 10e-3;

q1 = sin(2* pi * f * Tcoh);
i1  = cos(2* pi * f * Tcoh);

phi1 = atan(q1/i1) * 180/pi   %epoch1


%epoch2
f = 25;
q2 = sin(2* pi * f * Tcoh);
i2  = cos(2* pi * f * Tcoh);
phi2 = atan(q2/i2) * 180/pi 

phi = phi2 - phi1; %This phi should pass through the logic desribed above.


4. Now the question is... why does the loop locks on to some other frequency?  
For example, it locks on to 50 Hz when Tcoh = 10 ms. Why?

To simplify the understanding, let us take a pilot channel -no data bits. Even in this case the 'conditional check' can be PASSED with a certain frequency offset. Let us take the same example as with Tcoh = 10 ms. 

For the loop to go to side-band, f >= 25 Hz. Let us say that the loop is initialized with this offset. That is the local NCO is generating this frequency. Then, what happens?

   a. phi> 90, the LOGIC makes phi = phi - 180. That means phase difference is reduced. 

   b. With reduced phase value, the loop thinks the local NCO frequency is smaller than the input frequency (NCO frequency is lagging). Hence, loop provides corrections to increase the frequency generated by the NCO. 

   With this increase in frequency, the phi continues to be greater than 90 degrees over the interval. With 'atan' it will be restricted to 90 degrees.

   c. The frequency increase by the loop continues until the phi = 0 (ideally).  So, when can this phi be equal to zero?

   d. In this case, phi = 0, when 2*pi*f*Tcoh = pi (or 180 degrees, f~=0). For this example, it is possible when f = 50 Hz.

   e. Once the phi is equal to zero, then the loop thinks the NCO is generating the correct frequency and locks on to it (meaning it will not be applying any correction). 

   f. After this, any deviation in the input frequency is tracked by suitably correcting the NCO frequency around this 50 Hz. So, loop never knows that it is actually tracking the so called SIDE BAND. 


By the way, WHOSE side-band is it? Crazy nomenclature!

Tuesday, 23 December 2014

How to get day of the week given Gregorian date in Matlab?

1. Use 'weekday'


2. This is useful if you want to find the TOW from the date and time to compute the position solution.

Wednesday, 17 December 2014

How to plot the frequency spectrum of the IF (intermediate frequency) data of GPS signal, in Matlab?


1. An example is given here.

clc;
clear all;

%Inputs
fName = 'Ifdata.bin'; % input data file

fs = 5e6; %IF data sampling frequency
lenTime = 100; % ms, length of data to be considered

fid = fopen(fName,'rb');

M = lenTime*fs * 1e-3 * 2; %I and Q (complex) values of 16 bits each
data = fread(fid, M,'int16'); % reading from the file. 'int16' is the data type
data = data(1:2:end) + 1i*data(2:2:end); %arranging in complex data format. d = I + j*Q
N = lenTime*fs * 1e-3;
delf = fs / N;
freqInd = -fs/2:delf:(fs/2) - delf;

figure, plot(freqInd, 10*log10(fftshift(abs(fft(data))))); %plot of the spectrum

Thursday, 4 December 2014

What are the data format converters available for PLAN group students?

1. The details are given in the html file below. In order view this file correctly, open with HTML viewer. HTML viewer app can be easily installed to your account. After installation change the settings to open html files always using HTML viewer in the Google drive settings. Note that this list is not exhaustive.

Converters

Converters in a mindmap



What are the GNSS processing softwares available for PLAN group students?

1. The details are given in the html file below. In order view this file correctly, open with HTML viewer. HTML viewer app can be easily installed to your account. After installation change the settings to open html files always using HTML viewer in the Google drive settings. Note that this list is not exhaustive.

GNSS Processing Software

GNSS Processing Software in a mindmap