Implementation of a Software-defined GPS Receiver
Anthony J. CorbinDr. In Soo Ahn
Thursday, April 20, 2023
Overview Rationale System Description Software Architecture
Coarse Acquisition Fine Acquisition Tracking Positioning
Progress/Results Conclusion/Achievements
Rationale
Reduce Cost Eliminates ASICs or other custom ICs
More Upgradeable GPS Block III Galileo
Cost Cost is driving the mass-adoption of GPS
devices Currently, a GPS chipset in volume costs
around $5 8
The software GPS chipset, which is currently being produced in low volume, costs around $4 2
In high-volume, the cost of a software GPS chipset would likely become negligible
Upgradeable China and the European
Union are developing their own systems7
Russia already has its own system, but is working on making it more compatible with other systems6
The U.S. is beginning work on Block III GPS satellites
For a software-defined receiver, a simple software patch would be, in many cases, sufficient to use these systems
Equipment List
Item Description PC Multi-core PC SiGe GPS Sampler USB Dongle GPS Patch Antenna
Active Patch Antenna
High-Level Block Diagram
Antenna
GPS L1 Signal 1575.42 MHz
PCSampled Signal
4.1304 MHzDisplay
Bandpass Filter - 1575.42 MHz
LNASiGe GPS Sampler
Input: GPS L1 Signal
Outputs: Earth-Centered, Earth-Fixed Coordinates Latitude, Longitude, Altitude
Antenna Stage
USB GPS Dongle USB 2.0 Interface Simple software
interface
Subsystem Requirements
Error Specification(s) Position Error 100 m Sampling Rate 4.1304 MHz Time to First Fix Cold Start : 2 minutes
Warm Start : 12 seconds Display Earth-centered, Earth-fixed Coordinates
Latitude, Longitude, Altitude UTC Time Update
Position Error Estimated position is based on the sampling
rate being 4 times the chipping rate. ¼ of the distance represented by a chip is
therefore the approximate error.
mm
m
s
s
m
f
c
Chip
Chip
31.734
26.293
4Precision
26.2931
10023.1
103
6
8
Time to First Fix [1]
A position fix requires that the ephemeris data is completely received.
This requires a complete frame of data, which takes 30 s to transmit.
However, it is unlikely that the receiver shall begin collecting data at the beginning of a subframe indicating that an extra subframe lasting 6 s must be received.
If the ephemeris data has already been received, the fix time is minimal.
6 Seconds
Subframe 1
Subframe 2
Subframe 3
Subframe 4
Subframe 5
30 Seconds
Functional Software Diagram
Acquire
Track
Satellite
Satellites
.
.
.
.
Timestamp
Size
Sample
Samples
.
.
.
.
010101
Timestamp
Position
Position
Positioning
.
.
.
.
Acquired Satellites
Pseudoranging
Acquisition
Ephemeris Data Collection
Position Vectorization
Satellite Object
+Satellite(in ID : size_t, in ca : CACode*, in Base : Frequencies, in fft : FFTEngine*)+~Satellite()+ID() : size_t+UpdateSamplesPerChip(in CodeF : double)+ComputePosition()+UpdatePosition(in TOW : double)
+Status : SatelliteStatus+fCA : complex<double> *+SampleLength_ : size_t+ClockFactor : double+CA_[1024] : double+SamplesPerChip_[1024] : size_t +NavData_ : EphemerisParameters+SatellitePosition : Position<double>+ID_ : size_t+Base_ : Frequencies+CodeFRem_ : double
Satellite
+Satellites(in Base : Frequencies &)+Satellites(in Base : Frequencies, in Data : string)+~Satellites()+operator [](in index : size_t) : Satellite *+ClearAcq()+DisplayStatus()+Size() : size_t+GetAcquiredSatellites() : AcquiredSatellites *+SaveSatellites(in Filename : string)
-Satellites_ : vector<Satellite*>-Base_ : Frequencies-fft_ : FFTEngine *-ca_ : CACode *
Satellites
+SatelliteStatus(in SNR_ : double, in CodeIndexAcq_ : size_t, in Carrier_ : double)+SatelliteStatus()+operator =(in s : SatelliteStatus)+Acquired() : bool
+SNR : double+CodeIndexAcq : size_t+CodeIndexTOW : double+Carrier : double+CodeF : double+c0_TOW : double+CodeIndex_c0 : double+t_c0 : __int64+Tracked : bool+FrameTime : __int64
«struct»SatelliteStatus
+DataComplete() : bool
+F1 : bool+F2 : bool+F3 : bool+TOW : unsigned int+SV_Code_Phase : unsigned int+SV_Code_Phase_c0 : unsigned int+Week_No : unsigned int+SV_Health_Index : unsigned int+SV_Accuracy_Index : unsigned int+T_GD : double+t_oc : double+a_f2 : double+a_f1 : double+a_f0 : double+DataSetCutover : bool+IODC : unsigned int+IODE2 : unsigned int+IODE3 : unsigned int+C_rs : double+delta_n : double+M_0 : double+C_uc : double+e : double+C_us : double+radA : double+t_oe : double+C_ic : double+Omega_0 : double+C_is : double+i_0 : double+C_rc : double+w : double+Omega_dot : double+IDOT : double+AODO : unsigned int+FIT_Interval_Flag : bool
«struct»EphemerisParameters
+Position(in X_ : T, in Y_ : T, in Z_ : T)+Position(in X_ : T, in Y_ : T, in Z_ : T, in Lat_ : T, in Lon_ : T, in Alt_ : T)+Position()+Rotate(in theta : T)+Display()+ToLLA()+DistanceTo(in p2 : Position) : T
+X : T+Y : T+Z : T+Lat : T+Lon : T+Alt : T
Position
T
+Frequencies(in SamplingFrequency : double, in CarrierFrequency : double, in CodeFrequency : double)+Frequencies()+operator =(in f : Frequencies)+SampleLength() : size_t+DataLength() : size_t
+Sampling : double+Code : double+Carrier : double
«struct»Frequencies
Software Architecture
Coarse Acquisition
Fine Acquisition
Tracking
Positioning
Determines the available satellites.
Refines the acquisition.
Fast algorithm to extract satellite orbital data.
Calculates the receiver position.
Coarse/Acquisition Code Generation
A generated C/A code sample is shown to the right.
The signal generated is based on the pseudorandom sequence generation shown on the next slide.
50 100 150 200 250 300
-1
-0.8
-0.6
-0.4
-0.2
0
0.2
0.4
0.6
0.8
1
C/A Code Generation [1]
1 2 3 4 5 6 7 8 9 10
1 2 3 4 5 6 7 8 9 10
Tap
Tap
GPS L1 Signal
Coarse Acquisition Coarse acquisition searches around the
intermediate frequency in the range +/- 10 KHz with a step of 500 Hz
Frequency Domain Correlation
FFTL1 C/A Code
Generator
+/- 10 KHz500 Hz Step
FFT
conj
IFFT SNR > Threshold?
Acquired Satellite
Yes
No
Frequency Domain Correlation The correlation value
must be checked at every code alignment.
To perform this quickly, the operation is performed in the frequency domain.
As shown in the right, cross-correlation is equivalent to the product of X*() and Y() in the frequency domain.
N
YX
enmyemxN
enmymxN
R
nmymxN
nr
N
n
N
nmjN
m
N
mj
N
n
N
m
N
nj
N
m
)()(
)()(1
)()(1
)(
)()(1
)(
*
1
0
)(1
0
1
0
1
0
1
0
C/A Code Characteristics
Repeats every 1023 chips Cross-correlation between two
satellites’ C/A codes is minimal Correlation value is only large when
the code is perfectly aligned with itself.
Cross-Correlation The first 3D graph
shows the cross-correlation between C/A codes for different satellites for the perfectly aligned case, while the second shows a misaligned case.
The crest in the first graph shows correlation values for the same satellite in the perfectly aligned case.
Correlation Result The graph to the
right shows the results of a correlation between sample data and a known C/A code
The large peak indicates the proper code alignment
Coarse Acquisition – Satellite Search
Coarse Acquisition – IF Search
Fine Acquisition Uses the frequency estimate from Coarse
Acquisition to obtain a more accurate estimate
10 L1 C/A Code Samples 2^(n+1)Length FFT Size
Zero AppendL1 C/A Code Generator
FFT
FFT conj
IFFT MAX Index
Sampling Frequency/FFT Size
Carrier Estimate
Tracking Tracking occurs in
the time domain A Delay-Locked
Loop tracks the Code Frequency
A Phase-Locked Loop tracks the Carrier Frequency
I
Q
Carrier Frequency
Phase Remainder
L1 Code Remainder
Chipping Length Generator
P
E
L
Signal
I_P
I_L
I_E
Q_P
Q_L
Q_E
Code Discriminator
Carrier Discriminator
Delay-Locked Loop [1] The DLL tracks the Code Frequency by generating two
extra C/A code sequences The extra sequences are shifted slightly early and
slightly late with respect to the prompt sequence The differences in the correlation values, as shown
below, indicates the direction in which the prompt sequence must be shifted
C/A Code Tracking The graphs to the
right show the code error output from the delay-locked loop.
The loop parameters have been refined through testing to allow for fast convergence.
-45
-40
-35
-30
-25
-20
-15
-10
-5
0
5
0 20 40 60 80 100 120 140 160 180 200
-45
-40
-35
-30
-25
-20
-15
-10
-5
0
5
0 200 400 600 800 1000 1200 1400 1600 1800 2000
Carrier Tracking A carrier error signal is
shown on the right. In this example, the
frequency of the carrier appears to be drifting further below the intermediate frequency.
This is due to the Doppler Effect.
-60
-50
-40
-30
-20
-10
0
10
20
30
0 5000 10000 15000 20000 25000 30000
Navigation Data
-6000
-4000
-2000
0
2000
4000
6000
0 5000 10000 15000 20000 25000 30000
The figures to the right show resolved 50 Hz navigation data after coarse acquisition, fine acquisition, tracking, and post-processing has occurred.
The top graph shows 32s of data, while the bottom graph shows 3s.
-6000
-4000
-2000
0
2000
4000
6000
0 500 1000 1500 2000 2500 3000
Position Calculation
Ephemeris Data
Pseudoranges
Satellite Positions
.
.
.
.
.
....
....
....
1 111
1
1
1
1
1
1 tc
tc
XZZYYXXSATRCV
SATRCVSATRCVSATRCV
Solve using QR Factorization
Update Receiver Position
Progress MATLAB GPS software [1] has been ported to C++
This includes: Coordinate conversion Tracking loop Acquisition algorithms
DSP design approach was abandoned due to technical issues at a very early stage of the project.
C++ code can accurately find a position from stored sample data.
Developed code has been restructured to run in parallel.
Position Results
51.81 m
Position Results
104.4 m
Position Results
Speed Currently the C++
code requires under a minute (per satellite) to read a full 36 s of satellite data.
Compare this with the Matlab code which takes 6 minutes per satellite.
0
1
2
3
4
5
6
7
C++ Matlab
Tim
e (
Min
ute
s)
Tracking
Intel Threading Building Blocks
Intel’s TBB is a library for creating threaded programs
Platform independent Relatively easy to use
Changes to Project Objectives Finding the satellite positions requires an accurate time…requiring
collection of at least subframes 1-3 of the ephemeris data The equation below shows the number of multiplications per
second required to track one satellite. This does not include C/A code generation, carrier demodulation, or the overhead involved with sampling.
The DSP considered is clocked at 225 MHz which is simply not fast enough.
sMultipliesMillionms
alignmentsarmsSamples/2.98
3*2*16368
Scheduling Telemetry and
Handover words contain a Time-of-Week value that can be used to update the position of the satellites
The TLM/HOW words are sent at the beginning of each subframe which occurs every 6 seconds
6 Seconds
Subframe
1.2 Seconds1.2 Seconds
TLM/HOW Data
Processing Time
6 Seconds
Subframe
6 Seconds
Subframe
Scheduling Scheduling allows a
minimal set of data to be used for position computation
Orbital data is typically valid for several hours
Collect 36s of Data
Extract orbital data
Coarse Acquisition
Fine Acquisition
Tracking
Estimate the Time at which the TLM/HOW word will be
transmitted
Wait until 0.1s before
Collect 1.2s+ of data
Compute position
Conclusions
Results show that implementation is practical on modern PCs
However, application in low cost embedded systems is several years out
Achievements Successful determination of position Real-time satellite availability determination Working C++ based receiver code
Stored data Received data using USB sampler
Wrapped the driver code for the USB device in C++
Multi-threaded object-oriented design Google Earth C++ class wrapper
Recommendations for Future Work
Continue enhancing code for further improvements.
Research neural network approaches.
References [1] Kai Borre, Dennis M. Akos, Nicolaj Bertelsen, Peter Rinder, and Soren
Holdt Jensent, Software-Defined GPS and Galileo Receiver : A Single-Frequency Approach. Birkhauser: Boston, 2007, pp. 29, 83, 105.
[2] SiGe, SE4110L-EK1 Evaluation Board User Guide. [3] SiGe, SE4110L Datasheet. [4] U.S. DoD, Navstar GPS Space Segment/Navigation User Interfaces.
IS-GPS-200 Rev. D. [5] U.S. DoD, World Geodetic System 1984 : Its Definition and
Relationships with Local Geodetic Systems [6] Wikipedia, GLONASS. <http://en.wikipedia.org/wiki/GLONASS> [7] Wikipedia, GALILEO. <http://en.wikipedia.org/wiki/Galileo_gps> [8] EDACafe.com. Atmel Introduces $5 GPS Baseband IC With 3
Meter Accuracy. <http://www10.edacafe.com/nbc/articles/view_article.php?articleid=177910&page_no=2>
Real-time Functionality
Collect 36s of data with a timestamp.
Extract ephemeris data and calculate
initial position.
Collect a small data sample with a
timestamp.
Use the current carrier estimate to perform a
frequency domain correlation with 1 ms of
the small sample
Using the entire small sample estimate the
current carrier frequency and save it.
Estimate pseudoranges.
Estimate new satellite position
given the difference in the
time stamps.
Estimate Position
Updated Schedule
Week Activity 1/23-1/26 GPS Acquisition Software 1/27-2/2 Develop C++ Tracking Algorithm 2/3-2/9 Develop C++ Tracking Algorithm 2/10-2/16 Develop software to calculate position 2/17-2/23 Documentation and software design 2/24-3/1 Redevelop software with updated design using lessons
learned from initial development 3/2-3/8 Continue redevelopment 3/9-3/15 Debug and document redesign 3/16-3/22 Continue debugging and documenting 3/23-3/29 Design display 3/30-4/5 Develop and test display 4/6-4/12 Develop and test display 4/13-4/19 System debugging and documentation 4/20-4/26 System debugging and documentation 4/27-5/3 System debugging and documentation