Implementation of a Complete GPS Receiver Using Simulink



Comments



Description

FeatureImplementation of a Complete GPS Receiver Using Simulink © COMSTOCK Gihan Hamza, Abdelhaliem Zekry, and Ibrahim Motawie Abstract During the past few years a lot of efforts have been exerted to make the inner working of the GPS receiver visible, clear and easy to learn and modify either on the level of software or hardware. This article adds a step on the route toward the implementation of a more visible, clearer, and easier to learn and modify a single frequency GPS receiver using the C/A code on the L1 carrier. Simulink was used in the implementation of such receiver, thereby introducing a new look for the SDR technology that can be accomplished via a graphical user interface environment. I. Introduction uring the past decade a lot of efforts have been exerted not only to open the inner working of the GPS receiver but also to facilitate the education of the design and implementation of such system. The Software-Defined Radio technique was used as a tool in the implementation. From the efforts that were exerted in this field are: ■ The open source GPS project that was initiated in 1995 and leaded by Clifford Killy and Douglas Baker (with collaboration with others) [1]. This project had an educational aims to help any GPS enthusiast to learn deeply the internal working of the GPS receiver. They developed both a commercial hardware and software that constitute a complete GPS receiver. The hardware was introduced by developing two chipsets called GP1010 and GP1020. The GP1010 was used as a front-end and performs the acquisition phase; while The GP1020 was the tracking and navigation data extraction chip that has 6 correlators channels [2][3]. The software of this project was a C program written in Borland C. This program contained a library of the GPS functions such as the satellite location by using the almanac, the ephemeris, computing the navigation solution and decoding the navigation message. ■ Dick Benson, a consulting application engineer at Mathworks: developed an incomplete single channel GPS receiver using Simulink. He implemented acquisition, partial tracking, and no pseudorange in SIMULINK [4]. ■ The efforts of Kai Bore and Dennis Akos (with collaboration with others) fruited a book titled “A Software-Defined GPS and GALILEO D Digital Object Identifier 10.1109/MCAS.2009.934706 FOURTH QUARTER 2009 1531-636X/09/$26.00©2009 IEEE IEEE CIRCUITS AND SYSTEMS MAGAZINE 43 Guiza.edu. Representing the Data Collected from the Front.bin Double Histogram of 1.548 MHz. Ain Shams University.Receiver A Single-Frequency Approach” [5]. E-mail: motawie@nis. Every person writes the algorithm of a certain part and delivers the output to the next person to write the next part of the algorithm. II.eg). the modification and the debugging of many of the complicated electronic systems. and position solution are tested and developed by a real GPS signal that was collected from the SE4110 ASIC-based front end. the graphical environment makes the relation between the system modeling. They introduced the implementation of a complete 8-channels single frequency GPS receiver using the C/A code on the L1 carrier using Matlab as the coding language. The Front-End The Simulink models of acquisition. assembly.048. which is Simulink. Also. The implementation of a complete 8-channel GPS receiver is accomplished via a graphical environment. E-mail: gihan_hamza@yahoo. 1 shows the Simulink User of 1. Abdelhaliem Zekry is a professor in the Faculty of Engineering. In Vector Scope this figure the first branch gives the time domain representation vipmen. The second branch gives a histogram of 1.End in the Different Domains The digital samples that were collected from the frontend can be represented in the different domains using the different Time Domain types of scopes available in SimuRepresentation link. and transparent simulation of GPS receivers implemented with the SDR technology. main representation of 1.048. a teamwork is needed. Using a GUI environment instead of the hand written programming languages was a far idea due to the algorithm’s complexity and length. The signal is a noise Data Type Histogram Read Binary File Vector Conversion like and this is the nature of the Scope 1 CDMA signal.576 Frequency Domain Representation samples that is shown in Fig. Ibrahim Motawie is a professor in the National Institute of Standards. E-mail: aaazekry@asunet. 44 IEEE CIRCUITS AND SYSTEMS MAGAZINE FOURTH QUARTER 2009 . Previously. after modifying the algorithm of some parts to conform with the GUI environment and make the simulation time faster.000 Samples Submatrix model for data representation.048. the algorithm of a complete GPS receiver is considered complicated and long. This will facilitate the education. In This article the 39 m-files that are accompanied with the book titled “A Software-Defined GPS and GALILEO Receiver: A Single-Frequency Approach” are converted to only 5 Simulink models.sci. Egypt (Tel: +202-35715755. To write a complete algorithm for a GPS receiver.048. pseudorange. Its functional block diagram is shown in reference [6]. Simulink model to represent the collected data in the different domains. The main parameters of these data are:Sampling frequency: 38.com). tracking. In general.576 Gihan Hamza is a research assistant in the National Institute of Standards. because it contains different stages that deals with the processing of RF. This article adds a step on the route toward a clear. B. easy. to write either a part or a complete GPS algorithm you must be professional in C/C11 programming. or Matlab. This book is accompanied with 39 m-files that represent the receiver algorithm and a record for a real GPS signal collected from a specially designed ASIC-based front-end. The same signal is used in testing and developing the Matlab algorithms.192 MHz. 3. IF: 9. eg). the success of using a graphical programming language such as SIMULINK in simulating a complicated system such as the GPS receiver will open the route for other complicated systems to be simulated by the same way. 2. Cairo. Fig.576 Samples is clear that the 4-bit samples are Spectrum translated to 16 levels. using a graphical programming language eliminates the need to a team work and enables only one person to finish the simulation of the complete system in a relatively short time. IF. In general.shams. Building The Different Stages Of GPS Receiver A. The third Scope branch gives the frequency doFigure 1.000 samples that is shown User of 1. simulation. Guiza. In general. Egypt (Tel: +202-24840051.576 Samples in Fig. and implementation clearer and easier to debug. because we can put test points anywhere and obtain immediate results. Four-bit samples. Egypt (Tel: +202-26356263. It FFT of 1. These are the programming languages that researchers used in the simulation of the GPS receivers. and baseband signals. In acquisition we determine one of the visible satellites and determine both the carrier frequency and code phase roughly.048. It is clear that the symmetry is around the IF frequency. Frequency domain representation of 1. 5 is translated into a Simulink model. In Fig.mdl Acquisition. Z dt Figure 3.5 × 105 Figure 2. Each block in Fig. × 104 Incoming Signal 16 Number Within Bin 14 Acquisition 12 10 8 Tracking 6 4 2 0 2 4 6 8 Bins 10 12 14 16 Pseudorange and Position Calculation X. Figure 5. 5.048.5 1 1. SIMULINK implementation of a single channel GPS receiver. Structure of a single channel GPS receiver. 6 there are two additional models. Y. Histogram of 1.mdl Pseudorange and Position Calculation. Time domain representation of 1.mdl X. Incoming Signal C. IEEE CIRCUITS AND SYSTEMS MAGAZINE 45 . Z dt Figure 6. one provides the demodulation carrier and the other provides the dispreading code.mdl Dispreading Code. samples that is shown in Fig.000 samples. These tables contain all the possibilities of the demodulating carrier and dispreading codes according to a specified sampling frequency that is a modifiable value reserved in the Workspace. GPS Receiver Architecture The operation of a single channel GPS receiver is based on the structure shown in Fig.mdl Tracking. In tracking we track any changes to these values to ensure correct data decoding.576 samples.5 Time 2 2. 4. Y.576 samples receiver. After that both the pseudorange and position are calculated.6 PSD Magnitude (dB) 40 Amplitude 4 2 0 –2 –4 –6 20 0 –20 –40 –60 –8 0 0. 0 2 Frame 4 6 8 10 12 14 Frequency (MHz) 16 18 Figure 4. 6. as shown in Fig. Both the demodulation and dispreading models must be simulated first to feed lookup tables existed in the acquisition model. FOURTH QUARTER 2009 Demodulation Carrier. The implementation of the Fourier Transform thus afwhich are: the serial search acquisition. This means that we have to resample the technology is accomplished according to the third incoming signal by a frequency of 32. while Matlab able to do both. So. the first is to use In this technique we search through all the possible fre. Resampling by Peak Metric this way made the detected code Dispreading Demodulation code. It is well known that the FFT quency space search acquisition. which ASIC. The simulation time of the 90 DFT acquisition phase that was simulated as m-files was about 183 Local Oscillator PRN Generator second. Acquisition from that Simulink is optimized to make FFT and IFFT Acquisition is a two dimensional search process that not a DFT and IDFT. 8 shows code phase is multiplied by the factor (38192/32768). and the parallel code and IFFT are faster than the DFT and IDFT but they affect phase space search acquisition. Frequency Conj This signal is then punctured regularly to reach 32768 samples 90 DFT Code Phase and per C/A code [9].mdl Carrier from 38192 to 65536 samples [8].fects the simulation time.doesn’t have a block that down sample by a fractional allel code phase search technique shown in Fig. which are 32768 samples. 7 [5].mdl ber of samples per C/A code. was about 200 seconds. factor.5 KHz frequency interval. The increase in simulation time comes D. Figure 8. the parallel fre. the results in identifying the code phase with an uncertain. To make In the Simulink model of acquisition the 29 frequency the detected code phase to be referenced again to the old bins are searched at the same time where the incoming number of samples per C/A code we multiplied the detectsignal is multiplied by a look up table containing all the ed one by an inverse of the factor that was used in sampossible IF frequencies.mdl phase referenced to the new numCarrier. Acquisition. we have either of two ways. The number of frequency bins in our case was 29 frequency bins for 14 KHz tected code phase be referenced to the new number of search band stepped by a 0.768 MHz makes the dethe number of frequency bins. So. This means that the total num. Acquisition were implemented in Matlab.the “resample” m-function using the Embedded MATLAB quency bins and parallelize the code phase search such Function in the SIMULINK model to resample by the facthat the total number of searches per satellite equals tor (32768/38192).mdl (Implementation of the Parallel code phase search in a mapping block was created to SIMULINK). Acquisition was implemented with the par. which is implemented on an C/A code from 38192 to the lower radix-2 value. To use the FFT the first two methods in the traditional implementation and IFFT we have to reduce the number of samples per of the acquisition phase.768 MHz. So. Implementing acquisition according to the SDR is 32768 5 214. can be implemented by either of 3-standard methods. The second way is by interpolating the input signal by FIR Incoming interpolation filter to increase Signal the number of samples per 1 ms × (time of a complete C/A code) Fine Resolution DFT × |u|2 IDFT × Frequency Search. Fig. This means that each detected ber of searches for the 32 satellites is 32. SIMULINK method [7]. Using a new sampling rate of 32. while the time for it when simulated as a Simulink model Figure 7. It is customary to use only sequences that have a radix-2 length. 6. eliminate the effect of resampling Incoming Signal 46 IEEE CIRCUITS AND SYSTEMS MAGAZINE FOURTH QUARTER 2009 .pling down the frequency.DFT and IDFT were built as a Level-2 M-file S-Function ty equals to 6½ – chip and the IF with an uncertainty blocks that made them consume larger time than if they equals to 6½ the Doppler search bin size. Parallel code phase search block diagram. samples per C/A code.the actual implementation of this block diagram in Simulink where it is shown the position of both × the demodulation and dispreadFine Resolution DFT × |u|2 IDFT × Frequency Search Carrier ing models that were mentioned Frequency Conj before in Fig. 9 shows the final results obtained from the acquisition model before resampling.7705688 Carr Freq 9548200. 12 show the acquisition results for one of the visible satellites and invisible satellites respectively. track any changes that occur to these values.3250 Display 2 Double [1 × 8] [1] Code Phase Code Phase 13.404 6288 36321 207xxx Display 3 Rearranging The Detected Sats Descendingly Figure 9.26 12. we see that the resampling process has a minor effect on the acquisition process in spite of reducing the acquisition time to only its 1/3 of its original value. 9 and Fig. The Fine Resolution Frequency Search block consumes the largest time from the overall simulation time. Fig. which is 38192. The resolution of the detected frequency is calculated according to the following equation: Df 5 fs / 2 . Comparing the results of Fig. on the detected code phases. N/2 (1) where fs is the sampling frequency and N is the Fourier transform length. The fourth branch gives the corresponding code phases of the detected ones.2341919 9549875. Both the demodulating carrier and the dispreading code are resampled according to the new sampling frequency and then FFT and IFFT of a length of 215 are used instead of the DFT and IDFT. IEEE CIRCUITS AND SYSTEMS MAGAZINE 47 . The first branch shows the PRN of the visible satellites. which is a criteria putted to differentiate between the visible and nonvisible satellite. after building it as an S-function. Fig. the acquisition simulation time became about 58 seconds. The second branch illustrates that the peakMetric of all the visible satellites exceeds 2.5. The third branch shows the corresponding carrier frequency of each visible satellite.0249634 9549657. E. So. FOURTH QUARTER 2009 Fig.62 13. Using FFT instead of DFT made the simulation time become about 70 seconds.Double [1 × 8] [1] [1] [1] Detected PRN 21 Detected PRN 22 15 18 26 6 4. 11 and Fig. we obtain code phases that are referenced to the original number of samples per C/A code.09 9.5. 10 shows the acquisition results after resampling with the results sorted from the strongest to weakest visible satellites. after the resampling process and consequently we don’t need to make any changes to the Tracking model.mdl before resampling. These results are stored in the Workspace as inputs to the tracking. and demodulate the incoming signal to obtain the 50 Hz navigation data bits.4 Display 1 Double [1 × 8] Carr Freq 9547399.216 Display Double [1 × 8] Peak Metric Peak Metric 14.326 4. The resolution of the detected frequencies will not change because both the sampling frequency and the Fourier transform length are changed. It is clear that the visible satellite has a single dominant peak while the nonvisible satellite doesn’t have a distinct peak such that the ratio of the first to second peak is more than 2. In the mapping block we apply the reverse process of interpolation and puncturing to the detected code phase. which amounts only to 1/3 of that of the previous implementation. Results obtained from the Acquisition. 10. Tracking The main purpose of tracking is to refine the acquisition results. In other words. } Carr Freq Quired Code Phase Double [32 × 1] Double [32 × 1] Carr Freq Carr Freq Double [8 × 1] 4... 13 shows the combined code and carrier tracking loops. from the file that was recorded by the front-end module.938 9548250 Display 1 9545015.mdl after resampling. the first block is the feedback block of the DLL. Tracking consists of a carrier tracking loop implemented as a PLL and a code phase tracking loop implemented as a DLL.625 9550843. Acquisition plot for a not visible satellite.56 Detected PRN Detected PRN 6 12.875 2. FOURTH QUARTER 2009 .3125 3.15 Display 10. 14.6875 3. 48 IEEE CIRCUITS AND SYSTEMS MAGAZINE 25 30 12 10 8 6 4 2 0 4 × 104 3 2 1 0 0 5 10 15 20 25 30 Figure 12. The third block represents the NCO carrier generator and the PLL feedback.006 9549921.75 Double [8 × 1] Code Phase Code Phase 13404 9544312. a complete tracking channel [5]. Results obtained from the Acquisition. Fig. The two loops are combined in one loop to decrease the number of multipliers that consume a lot of time. where we read a variable data size.32 3 12. From left.21 22 15 18 26 Detected PRN Double [32 × 1] Double [8 × 1] 9 12. The second block represent the incoming signal. determined by the feedback. The implementation of these loops in Simulink is shown in Fig. Acquisition plot for a visible satellite.372 9549695. i.5 6288 9549914.09 Peak Metric Double [32 × 1] Peak Metric Peak Metric Double [8 × 1] for {. where it consists of 7 blocks.0625 36321 Display 2 20725 26826 4696 or Iterator Rearranging the Detected Sats Descendingly 28202 34211 Display 3 Figure 10.. The NCO carrier generator provides × 107 × 107 12 10 8 6 4 2 0 4 × 104 3 2 1 0 0 5 10 15 20 Figure 11.e.421 9547429. This discriminator is built according to the follow ing equation: Q f 5 tan 21 a b. FOURTH QUARTER 2009 IEEE CIRCUITS AND SYSTEMS MAGAZINE 49 . late. the fourth block is the PRN code generator which provide the early. and prompt codes. Top view for the Trackink. late. The fifth block is the integrate block at which we integrate over the number of samples per C/A code for the early. This type of discriminators is precise but consumes more time. This discriminator was built as a noncoherent discriminator according to the following equation: codeError 5 1 I 2E 1 Q2E 2 2 1 I 2L 1 Q2L 2 1 I 2E 1 Q2E 2 1 1 I 2L 1 Q2L 2 Integrate lE and Dump Integrate lP E l Data and Dump P Integrate and Dump lL L Incoming Signal Code Loop Discriminator PRN Code Generator L Integrate and Dump QL P Q Integrate and Dump QP E Integrate and Dump QE 90° . and prompt codes. I and Q are the in-phase and quadrature signals of Costas loop. This means For 1 : N 1 Iterator chNo For Iterator > 37000 Compare To Constant 4 fid R fid IncomingSignal PhaseStep abSample remPhase U PhaseStep remPhase_N FeedBackBlock remPhase blksize 3 fid × u T u T iBaseband Signal qaseband Signal earlyCode RemPhase lateCode acqFreq carrSin PhaseStep R promptCode blkSize carrCos caCode 3 carrFreq_N tcode_P caCode remPhase_N PRN Code tcode_P Generator NCO Carrier Generator Incoming Signal 2 acqFreq × (3) × × × × × × IE IP IL QE IL QL IE QE IL QL IP QP Code Loop Discriminator Reset I_E codeNco Q_E I_L codeFreq Q_L Integrate Resetting the I/P Is the Dump 2 Out4 Reset carrError 1 I_P Out2 Q_P carrFreq acqFreq Carrier Loop Discriminator and Loop Filter Figure 14. The comparison between Fig. which helps in adjusting the code phase. This block consists of summing blocks. where IE and IL are the in-phase outputs of the early and late codes respectively.a refined value for the carrier frequency. The carrier loop discriminator is built as an arctan discriminator. 14 demonstrates the resemblance between the tracking block diagram and its implementation in Simulink. I here f is the phase error. 13 and Fig. The seventh and last block is the carrier loop discriminator and loop filter. The sixth block is the code loop discriminator.mdl (the implementation of the tracking loops in Simulink). Combined code and carrier tracking loops (complete tracking channel). QE and QL are the outputs of the quadrature early and late codes respectively. NCO Carrier Generator (2) Carrier Loop Filter Carrier Loop Discriminator Figure 13. 66344317 Display 1 [1x8] [1x4] UY Double pos(1)Y Double N 4429017. el.486710475713 57.33907 22688941. The block diagram according to which the Pseudorange and position calculation was built in SIMULINK.6790361 Display 2 [1x4] UY Double pos(1)Z Double U 1403. 15 shows a part of the navigation data extracted from one of the receiver channels.cart2utm) Succeeded –1288156. Flow diagram for the pseudorange and position calculation. Part of the navigation data extracted from the Trackink.5 Tracking Result 1 0. dt Position Sat.findUtmZone .26070306979 72.m) for a single channel was about 20 minutes while the time for that implemented as a FOURTH QUARTER 2009 .6023873 Display 3 4079720. Tracking Results Find Preamble Subframe Start Figure 16.5 Least Square Filter (az. Fig. xyz dt) 0 100 200 300 400 500 600 700 800 900 1. The final results from the Pseudorange_and_position.5 Calculate Pseudorange 0 –0. Clock Correction Ephemeris Satellite Position Ephemeris TOW Least Square XYZ. Calculate Pseudorange Pseudorange Sat.483443421818 Display 5 Figure 18. DOP. Position Figure 17.000 Figure 15. easier building.1168178 –4720789.x 104 1. pseudoranges [1x8] satClkCorr corrected_psuedoranges Double [1x8] 21285293.channel.372632145 Coordinate Conversion (cart2geo .7646892 519510. and modification in SIMULINK environment.correctedP [1x4] [1x4] UY Double pos(1)X Double E 477646. 50 IEEE CIRCUITS AND SYSTEMS MAGAZINE The simulation time for the tracking algorithm that implemented as m-files (tracking.5 Satellite Position and Clock Offset –1 –1.63323641 [1x4] Display 4 72. debugging.558332232667 [1x8] 46.376222 [1x8] Display pos [1x8] navSolutions. where he became a professor of Electronics.SIMULINK model (tracking. S. Now.com/zarlink/hs/82_GP2015. Symp. Lin. She received the MSc degree from the same university in 2004 in the field of automating the long-term measurements. and fourth displays illustrate the coordinate conversion from the Cartesian to the UTM system. at Ain Shams University (ASU). Abdelhaliem Zekry graduated from Cairo University Egypt in 1969. He worked as a scientific coworker at TU Berlin. Egypt in 1998.earthlink. she is a research assistant in the FOURTH QUARTER 2009 Ibrahim Motawie graduated from Cairo University. Tian. third. Englewood Cliffs. and the Time Of Week (TOW).net/~cwkelley/ [2] Available: http://www. He published more than 70 papers in specialized conferences and periodicals in addition to two books in Electronics.” in Proc. Spread Spectrum Techniques and Applications (ISSSTA’08). Dr. National Institute for Standards (NIS) in the Time and Frequency Department and a PhD student. The commercial aims are embedded in the tools available in Simulink. devices. [8] J. Each subframe contains 10 words and each of them has a length of 30 bits. Egypt 1982. He moved to King Soud University at 1988 and stayed there for 6 years. He got his PhD in 1979 from Paul Seharie University.xilinx.htm [3] Available: http://www.pdf [5] K. the ephemeris. Algeria for about 6 years. Akos. After that we calculate the satellite clock correction and satellite position. New York: Birkhäuser.com/zarlink/hs/82_GP2021. or test any part of the system. Hua. and M. he is driving research on electronics for communication especially the implementation of advanced communication standards using DSP platforms. the receiver position. The simulated model has an educational and commercial aims. “Software defined radio GNSS receiver design over single DSP platform.htm [4] Available: www. Subframes 1. 2006. [11]. IEEE CIRCUITS AND SYSTEMS MAGAZINE 51 . Yoder. The first display shows the corrected pseudorage values for all the visible satellites.zarlink. where he got his PhD at 1981.5 minutes to receive a complete navigation message. Meclellan.zarlink. he is a professor in the National Institute for Standards (NIS). The educational aims come from the transparency in the design and simulation of any part of the algorithm. The subframe consumes 6 s as a transmission time which means that we need 12. He published more than 20 papers in specialized conferences and periodicals. The final step is to calculate the receiver position and the receiver clock offset. [11] Real-Time Workshop® Embedded Coder User’s Guide. A. Fig. F. Now. Zekry made intensive research on semiconductor materials. Zekry has been awarded several prizes for outstanding research as well as the Decoration of distinction from the Egyptian President.mdl)in Simulink was about 37 minutes. and the receiver clock offset. Oct. Ye. References [1] Available: http://home. ASU. The first step is to find the subframe start and then begin decoding the received data bits. Now. the second. By identifying the subframe start we calculate the pseudorange. and the receiver position. Pseudorange and Position Calculation This phase includes decoding the 50 Hz navigation bits (message) according to ICD-GPS-200 (1991) to obtain the pseudorange. A Software-Defined GPS and GALILEO Receiver—A Single-Frequency Approach. France.com/publications/magazines/dsp_01/xc_pdf/ p50-53_dsp-gps. [10] Real-Time Workshop User’s Guide. In our work we decoded a complete page that has a time of 30 s. R. system design becomes easier and clearer if it is accomplished via a graphical user interface environment. Borre and D. 18 shows the results obtained from that model. Egypt. He was offered the MSc degree in 1973 from the same university. He is interested in the Time and Frequency measurements and applications. He worked as an assistant prof. 1997. 17 shows the block diagram according to which the SIMULINK model was built. and 3 are the same in all the frames while subframes 4 and 5 are varying from frame to other. 2. Fig. and Z. and circuits. such as the RTW embedded coder [10]. Now he is a professor of Electronics at the faculty of Egypt. 37–41. III. debug. [7] J. She is interested in the time and frequency dissemination through using GPS receivers. The increase in time comes from that the performance of the Product blocks in Simulink is not the same as in Matlab 7. Also. He was offered the MSc degree from Ain Shams University. 16 shows a flow diagram for calculating the pseudorange. [9] Simulink Dynamic System Simulation for Matlab User’s Guide. A complete navigation message consists of 25 frames/ pages and each frame consists of 5 subframes. pp. DSP First A Multimedia Approach. [6] SE4110L PointCharger GPS Receiver IC Data Sheet. Fig. W. Gihan Hamza received her BSc in Communications and Electronics from Ain Shams University. Conclusion In general.1. H. it is very easy to modify. Egypt. Dr. W. Schafer. the satellite position and clock offset. 2008. He has been an IEEE Member since 1991. 10th Int. NJ: Prentice-Hall. He worked as an associate professor at Constantine University.
Copyright © 2024 DOKUMEN.SITE Inc.