GNSS SDR Signal Generator Implementation Based on USRP N210

With the rapid spread of transport systems, testing the performance of GPS signal receivers in transport systems has become a significant research topic, which requires a variety of specific GPS signals for testing. The paper focuses on the implementation of a Global Navigation Satellite System (GNSS) software-defined radio (SDR) signal generator, which is based on the USRP N210 hardware device and supporting code. Through this GNSS signal simulator, two functions are realized: first, for different signal test requirements, different GNSS signal data definition files are generated by software-defined GPS signal simulator; second, the signal data files can load to the radio front end (USRP N210) which can generate physical signals at the correct frequency. Also, the simulation tests reflect the signals created by this GNSS SDR signal generator can stably maintain on different satellite channels.


Introduction
With the rapid development of transport systems, the requirement of testing the performance of GPS signal receivers has explosive growth. As the GPS is one of the Global Navigation Satellite System (GNSS), the industry advocates the use of GNSS for testing the positioning and time synchronization in navigation devices [1]. Because of the random nature of the noise, the performance of the signal receiver cannot be fully tested by the actual GNSS signal. In this case, a Global Navigation Satellite System (GNSS) software-defined radio (SDR) signal generator achieves efficient generation of GNSS signals with specific requirements [2].
In this paper, it shows the implementation of a GNSS SDR signal generator is based on the USRP N210 which is a radio front-end to generate a physical signal, and in order to realize the diversity of analog GNSS signals and improve the feasibility of the user's actual operation, a control program matching the USRP N210 hardware was developed. The USRP N210 provides high-bandwidth, highdynamic range processing capability, which also is intended for demanding communications applications requiring this type of rapid development [3]. The control program is based on the GPS-SDR-SIM project, which is an opensource GPS baseband signal generator released under MIT license. The USRP N210 based GNSS SDR signal generator realizes two functions: (1) SDR signal generates for different signal test requirements and various situations such as certain UTC (Universal Time Coordinated) time or GPS time [4], static or dynamic receiver modes, with or without ionospheric delay, etc. Different GNSS signal data definition files are generated by software-defined GPS signal simulator.
(2) The signal data files can load to the USRP N210 radio front end, and it creates real physical signals at the correct frequency. Furthermore, the simulation tests reflect the signals which created by this GNSS SDR signal generator can stably maintain on different satellite channels and can work well

Technical Overview
This section gives an overview of the GPS positioning principle, the comparison between UTC and GPS time, the GPS signal frame, and the navigation message file.

GPS positioning principle
The word GNSS is "Global Navigation Satellite System". It consists of a constellation of satellites vehicles orbiting over the earth surface, and continuously transmitting signals so that the users can determine their three-dimensional position.  Figure 2. GPS signal frame Figure 1 above displays the basic principle of GPS positioning. For simulating the GPS signal, when locating a specific point in three dimensional, what the user wants to know is the position coordinate (x, y, z). Then, assuming there is a satellite has the coordinate (x1, y1, z1), and it can directly broadcast the signal which is an electromagnetic wave, from this known coordinate. For measuring the time duration τ1 between the signal being sent and received, a timestamp t1 need be involved in the signal wave as the time it is sent. And the time reference of t1 is derived from the clock installed in the satellite [5]. After signal arriving the receiver position, the timestamp t1 can be extracted from the signal. Theoretically, the time duration τ1 can be obtained by calculating the time difference between local time t2 and t1, that is τ1 = |t2 -t1|.

Time system: GPS and UTC
The GNSS SDR signal generator needs the information from the navigation file to calculate the GPS time. However, the navigation file only has information of UTC (Universal Time Coordinated) time. Also, the GPS time and UTC time are different [6]. Thus, we need a way to achieve conversion to each other. The starting point for GPS is 0h00m00s on January 6, 1980. At the start time, the GPS is aligned with the UTC time, and both systems give the same time. However, there are leap seconds at UTC, so after a period, the two-time systems will differ by n whole seconds where n is the number of jump seconds accumulated by UTC during this period.

GPS signal
The bit rate of the GPS signal is 50bps. The GPS satellite broadcasts GPS signals in different frequency bands and different modulation modes [7]. L1 signals are the most common signals in civilian use. Each satellite generates navigation messages based on the periodic data uploaded from the control segment and adds the message to the 1.023MHz pseudo-random noise (PRN) coarse/acquisition (C/A) code sequence. The code sequence generated by the satellite is modulated onto the 1575.42 MHz L band carrier to generate the spread spectrum ranging signal and broadcast it to the user community. Each C/A code is unique and provides a mechanism for identifying each satellite in the constellation. The whole message contains 25 pages (or "frames"), each page 30-second, forming the mainframe that needs 12.5 minutes to transmit. Each frame is subdivided into five sub-

Navigation file
To simulate GPS signals, the first thing needs to obtain is the observation data of GPS satellites. In the early days, the data format of each receiver manufacturer is different. Now, a common RINEX format has been commonly used [9]. RINEX is essentially a text file. The manufacturer is irrelevant to the specific model and can be used for general purpose. The most widely used is the 2nd version format. The RINEX file follows the standard naming convention, as shown in the following Figure 5.

Devices connection logic
As for showing in Figure 6, first, the computer uses the software program to generate a specific binary data file, which defines the user motion, UTC time, etc.; Second, this data file is loaded into USRP N210, which make the software-defined radio to be the real physical signals; Then, the signal output port connects to a direct current (DC)block and a signal splitter make the signal connect to a spectrum analyzer and a GPS receiver with a 40dB attenuator respectively; In the end, the received signal from the GPS receiver is back to PC and analyzed by software.

Generate user motion file
With the navigation message (such as brdc3540.14n), we have data resources for GPS signals. Next, we also need specific motion trajectory coordinates (such as usermotion.csv and GGA_stream.txt). In fact, many driving schools now have electronic fences. Therefore, the Google Earth is used to generate a trajectory of the fake movement [10]. The saved kml file cannot be used directly [11]. It is essentially a format that contains the key coordinate points in the path. It does not contain data such as acceleration, deceleration, and standstill in the actual motion path. We need to convert it. In this case, we need to convert the kml file into two formats of trace data files (CSV or NMEA GGA stream). First, the kml file converts to NMEA format. Here we need to use a small tool which is provided by LabSat and is SatGen. Set the frequency to 10hz, then click "Load KML file", the kml path is automatically loaded, and then click "Generate NMEA file" to generate a standard NMEA trace file. Second, to get a CSV file (ECEF trajectory file) [12], gps-sdr-sim provides a gadget in the "satgen" directory that can convert NMEA format to ECEF: "cd satgen" "gcc nmea2um.c -o nmea2um" then execute "nmea2um <source file> <target file>" on it.

Simulator Results and Discussion
This GNSS SDR Signal Generator has one static mode and two dynamic modes which are CSV file and NMEA GGA stream. Therefore, in this section, the results of simulating signals are shown with the help of the software, U-center [13]. To validate the simulated signal, if the simulated coordinates of the receiver are matched with defined in advance. Then, it proves that the signal is successfully generated. After setting the receiver port to the u-blox (GPS Receiver) that is been used, the signal received from this port can be shown on the software interface.

Static mode
In static mode, the receiver is fixed on a longitude, latitude, and height. In the Figure 7, the related information signal generated from a binary signal attribute data file is shown. For this binary signal data file, the user position has been set to 30.286502,120.032669,100, and navigation file brdc0370.18n is adopted. In Figure 7, the 3D position of the user is detected as 30.28633683, 120.03252283, 104.800m and the UTC time is switched to 02/06/2018, the speed of motion is 0.00m/s. All those detected parameters prove that the simulation of the static mode is achieved. After we stop signal generation of USRP N210, as shown in Figure 7 the signal from all channels are disappeared and some major information is lost, which can be seen from the text console. For example, the GGA stream contains no information for satellite vehicles' position, time, checksum, etc.

Dynamic mode
First, using the geodetic systems with NMEA GGA stream to simulate. In Figure 8, for the test GGA file, the user position has been set to around 48.5246626694, 2.1758140440, -21.3213, and navigation file brdc0370.18n is adopted. And the 3D position of the user is detected as 2.29373000, 48.87429233, -34.2m and the UTC time is switched to 02/06/2018, the speed of motion is 16.59m/s. All those detected parameters prove that the simulation of dynamic mode with GGA stream is achieved. Second, using the Earth-centered Earth-fixed (ECEF) system with CSV file [12] to simulate. In the Figure 9 shows the signal simulation for the related information of signal generated from a binary signal attribute data file. In this example, the user position has been set to around -381347X.X, 355427X.XX, 366278X.XX, and navigation file brdc0370.18n is adopted. In Figure 9, the 3D position of the user is detected as 137.01357667, 35.27491250, 86.000m and the UTC time is switched to 02/06/2018, the speed of motion is 8.34m/s. Also, the compass in the interface has turned around

Conclusions
The paper shows the implementation and validation of a USRP N210 based GNSS SDR signal generator which realizes two functions: (1)  physical signals at the correct frequency. And the simulation tests reflect the signals which created by this generator can stably maintain on different satellite channels and can work well on both static and dynamic modes.
The USRP N210 based GNSS SDR signal generator implemented as following four steps: generate the binary data file; load the data file into radio front-end (USRP N210); connect the receiver to the radio front-end; validate the signal received by the signal receiver on software, U-center. For the software part, the theory behind it has three main steps. First, read the receiver antenna position. Second, read and store the RINEX navigation file. Third, generate the baseband signal based on a navigation file for specific receiver position(s). As for hardware part, the configuration of the devices and the way of the connection between them is important, especially need to give attention to the sampling frequency, I\Q data format, and whether the daughterboard covers the GPS signal frequency.
As the simulator results show, the signal generation of GPS is achieved in both static mode and dynamic mode. At static mode, the user only needs to input the 3D position. For dynamic mode, the user can choose either CSV file or NMEA GGA stream as input. When the position parameter is shown on the U-center matching with the input values, then the signal generation is validated and that means they are correctly received.