mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-12-12 11:10:33 +00:00
Merge branch 'next' of https://github.com/gnss-sdr/gnss-sdr into kf
This commit is contained in:
commit
5656dbee89
@ -41,9 +41,10 @@ endif(NOT CMAKE_PREFIX_PATH)
|
||||
|
||||
########################################################################
|
||||
# Determine optional blocks/libraries to be built (default: not built)
|
||||
# Enable them here or at the command line by doing 'cmake -DENABLE_XXX=ON ../'
|
||||
# Enable them at the command line by doing 'cmake -DENABLE_XXX=ON ../'
|
||||
########################################################################
|
||||
# Support of optional RF front-ends
|
||||
option(ENABLE_UHD "Enable the use of UHD (driver for all USRP devices)" ON)
|
||||
option(ENABLE_OSMOSDR "Enable the use of OsmoSDR and other front-ends (RTL-based dongles, HackRF, bladeRF, etc.) as signal source (experimental)" OFF)
|
||||
option(ENABLE_FLEXIBAND "Enable the use of the signal source adater for the Teleorbit Flexiband GNURadio driver" OFF)
|
||||
option(ENABLE_ARRAY "Enable the use of CTTC's antenna array front-end as signal source (experimental)" OFF)
|
||||
@ -1195,18 +1196,18 @@ endif(NOT MATIO_FOUND OR MATIO_VERSION_STRING VERSION_LESS ${GNSSSDR_MATIO_MIN_V
|
||||
################################################################################
|
||||
# USRP Hardware Driver (UHD) - OPTIONAL
|
||||
################################################################################
|
||||
find_package(UHD)
|
||||
if(NOT UHD_FOUND)
|
||||
set(ENABLE_UHD OFF)
|
||||
message(STATUS " The USRP Hardware Driver (UHD) signal source will not be built,")
|
||||
message(STATUS " so all USRP-based front-ends will not be usable.")
|
||||
message(STATUS " Please check http://files.ettus.com/manual/")
|
||||
else(NOT UHD_FOUND)
|
||||
set(GR_REQUIRED_COMPONENTS UHD)
|
||||
find_package(Gnuradio)
|
||||
set(ENABLE_UHD ON)
|
||||
endif(NOT UHD_FOUND)
|
||||
|
||||
if(ENABLE_UHD)
|
||||
find_package(UHD)
|
||||
if(NOT UHD_FOUND)
|
||||
set(ENABLE_UHD OFF)
|
||||
message(STATUS " The USRP Hardware Driver (UHD) signal source will not be built,")
|
||||
message(STATUS " so all USRP-based front-ends will not be usable.")
|
||||
message(STATUS " Please check http://files.ettus.com/manual/")
|
||||
else(NOT UHD_FOUND)
|
||||
set(GR_REQUIRED_COMPONENTS UHD)
|
||||
find_package(Gnuradio)
|
||||
endif(NOT UHD_FOUND)
|
||||
endif(ENABLE_UHD)
|
||||
|
||||
|
||||
################################################################################
|
||||
|
@ -67,7 +67,7 @@ GitHub](https://github.com/join).
|
||||
GitHub](https://github.com/gnss-sdr/gnss-sdr/fork). This will copy the
|
||||
whole gnss-sdr repository to your personal account.
|
||||
|
||||
3. Then, go to your favourite working folder in your computer and
|
||||
3. Then, go to your favorite working folder in your computer and
|
||||
clone your forked repository by typing (replacing ```YOUR_USERNAME``` by
|
||||
the actual username of your GitHub account):
|
||||
|
||||
@ -128,7 +128,7 @@ $ git pull --rebase upstream next
|
||||
|
||||
### How to submit a pull request
|
||||
|
||||
Before submitting you code, please be sure to [apply clang-format](http://gnss-sdr.org/coding-style/#use-tools-for-automated-code-formatting).
|
||||
Before submitting your code, please be sure to [apply clang-format](http://gnss-sdr.org/coding-style/#use-tools-for-automated-code-formatting).
|
||||
|
||||
When the contribution is ready, you can [submit a pull
|
||||
request](https://github.com/gnss-sdr/gnss-sdr/compare/). Head to your
|
||||
|
44
README.md
44
README.md
@ -13,6 +13,7 @@ In the L1 band (centered at 1575.42 MHz):
|
||||
|
||||
In the L2 band (centered at 1227.60 MHz):
|
||||
- 🛰 GPS L2C :white_check_mark:
|
||||
- 🛰 GLONASS L2 C/A :white_check_mark:
|
||||
|
||||
In the L5 band (centered at 1176.45 MHz):
|
||||
- 🛰 GPS L5 :white_check_mark:
|
||||
@ -52,7 +53,7 @@ Before building GNSS-SDR, you need to install all the required dependencies. The
|
||||
|
||||
### Alternative 1: Install dependencies using software packages
|
||||
|
||||
If you want to start building and running GNSS-SDR as quick and easy as possible, the best option is to install all the required dependencies as binary packages.
|
||||
If you want to start building and running GNSS-SDR as quick and easy as possible, the best option is to install all the required dependencies as binary packages.
|
||||
|
||||
#### Debian / Ubuntu
|
||||
|
||||
@ -84,7 +85,7 @@ $ sudo yum install make automake gcc gcc-c++ kernel-devel cmake git boost-devel
|
||||
boost-date-time boost-system boost-filesystem boost-thread boost-chrono \
|
||||
boost-serialization log4cpp-devel gnuradio-devel gr-osmosdr-devel \
|
||||
blas-devel lapack-devel matio-devel armadillo-devel gflags-devel \
|
||||
glog-devel openssl-devel python-mako python-six
|
||||
glog-devel openssl-devel python-mako python-six
|
||||
~~~~~~
|
||||
|
||||
Once you have installed these packages, you can jump directly to [download the source code and build GNSS-SDR](#download-and-build-linux).
|
||||
@ -303,7 +304,7 @@ $ cmake ../
|
||||
$ make
|
||||
~~~~~~
|
||||
|
||||
By default, CMake will build the Release version, meaning that the compiler will generate a fast, optimized executable. This is the recommended build type when using a RF front-end and you need to attain real time. If working with a file (and thus without real-time constraints), you may want to obtain more information about the internals of the receiver, as well as more fine-grained logging. This can be done by building the Debug version, by doing:
|
||||
By default, CMake will build the Release version, meaning that the compiler will generate a fast, optimized executable. This is the recommended build type when using an RF front-end and you need to attain real time. If working with a file (and thus without real-time constraints), you may want to obtain more information about the internals of the receiver, as well as more fine-grained logging. This can be done by building the Debug version, by doing:
|
||||
|
||||
~~~~~~
|
||||
$ cmake -DCMAKE_BUILD_TYPE=Debug ../
|
||||
@ -696,8 +697,8 @@ Getting started
|
||||
2. You will need a GPS active antenna, a [USRP](http://www.ettus.com/product) and a suitable USRP daughter board to receive GPS L1 C/A signals. GNSS-SDR require to have at least 2 MHz of bandwidth in 1.57542 GHz. (remember to enable the DC bias with the daughter board jumper).
|
||||
We use a [DBSRX2](https://www.ettus.com/product/details/DBSRX2) to do the task, but you can try the newer Ettus' daughter boards as well.
|
||||
3. The easiest way to capture a signal file is to use the GNU Radio Companion GUI. Only two blocks are needed: a USRP signal source connected to complex float file sink. You need to tune the USRP central frequency and decimation factor using USRP signal source properties box. We suggest using a decimation factor of 20 if you use the USRP2. This will give you 100/20 = 5 MSPS which will be enough to receive GPS L1 C/A signals. The front-end gain should also be configured. In our test with the DBSRX2 we obtained good results with ```G=50```.
|
||||
4. Capture at least 80 seconds of signal in open sky conditions. During the process, be aware of USRP driver buffer underuns messages. If your hard disk is not fast enough to write data at this speed you can capture to a virtual RAM drive. 80 seconds of signal at 5 MSPS occupies less than 3 Gbytes using ```gr_complex<float>```.
|
||||
5. If you have no access to a RF front-end, you can download a sample raw data file (that contains GPS and Galileo signals) from [here](http://sourceforge.net/projects/gnss-sdr/files/data/).
|
||||
4. Capture at least 80 seconds of signal in open sky conditions. During the process, be aware of USRP driver buffer underruns messages. If your hard disk is not fast enough to write data at this speed you can capture to a virtual RAM drive. 80 seconds of signal at 5 MSPS occupies less than 3 Gbytes using ```gr_complex<float>```.
|
||||
5. If you have no access to an RF front-end, you can download a sample raw data file (that contains GPS and Galileo signals) from [here](http://sourceforge.net/projects/gnss-sdr/files/data/).
|
||||
3. You are ready to configure the receiver to use your captured file among other parameters:
|
||||
1. The default configuration file resides at [/usr/local/share/gnss-sdr/conf/default.conf](./conf/gnss-sdr.conf).
|
||||
2. You need to review/modify at least the following settings:
|
||||
@ -717,7 +718,7 @@ For more information, check out our [quick start guide](http://gnss-sdr.org/quic
|
||||
Using GNSS-SDR
|
||||
==============
|
||||
|
||||
With GNSS-SDR, you can define you own receiver, work with captured raw data or from a RF front-end, dump into files intermediate signals, or tune every single algorithm used in the signal processing. All the configuration is done in a single file. Those configuration files reside at the [gnss-sdr/conf/](./conf/) folder (or at /usr/local/share/gnss-sdr/conf if you installed the program). By default, the executable ```gnss-sdr``` will read the configuration available at ```gnss-sdr/conf/gnss-sdr.conf``` (or at (usr/local/share/gnss-sdr/conf/default.conf if you installed the program). You can edit that file to fit your needs, or even better, define a new ```my_receiver.conf``` file with your own configuration. This new receiver can be generated by invoking gnss-sdr with the ```--config_file``` flag pointing to your configuration file:
|
||||
With GNSS-SDR, you can define your own receiver, work with captured raw data or from an RF front-end, dump into files intermediate signals, or tune every single algorithm used in the signal processing. All the configuration is done in a single file. Those configuration files reside at the [gnss-sdr/conf/](./conf/) folder (or at /usr/local/share/gnss-sdr/conf if you installed the program). By default, the executable ```gnss-sdr``` will read the configuration available at ```gnss-sdr/conf/gnss-sdr.conf``` (or at (usr/local/share/gnss-sdr/conf/default.conf if you installed the program). You can edit that file to fit your needs, or even better, define a new ```my_receiver.conf``` file with your own configuration. This new receiver can be generated by invoking gnss-sdr with the ```--config_file``` flag pointing to your configuration file:
|
||||
|
||||
~~~~~~
|
||||
$ gnss-sdr --config_file=/path/to/my_receiver.conf
|
||||
@ -769,7 +770,7 @@ Since the configuration is just a set of property names and values without any m
|
||||
|
||||
### GNSS block factory
|
||||
|
||||
Hence, the application defines a simple accessor class to fetch the configuration pairs of values and passes them to a factory class called [GNSSBlockFactory](./src/core/receiver/gnss_block_factory.h). This factory decides, according to the configuration, which class needs to be instantiated and which parameters should be passed to the constructor. Hence, the factory encapsulates the complexity of blocks' instantiation. With that approach, adding a new block that requires new parameters will be as simple as adding the block class and modifying the factory to be able to instantiate it. This loose coupling between the blocks' implementations and the syntax of the configuration enables extending the application capacities in a high degree. It also allows to produce fully customized receivers, for instance a testbed for acquisition algorithms, and to place observers at any point of the receiver chain.
|
||||
Hence, the application defines a simple accessor class to fetch the configuration pairs of values and passes them to a factory class called [GNSSBlockFactory](./src/core/receiver/gnss_block_factory.h). This factory decides, according to the configuration, which class needs to be instantiated and which parameters should be passed to the constructor. Hence, the factory encapsulates the complexity of blocks' instantiation. With that approach, adding a new block that requires new parameters will be as simple as adding the block class and modifying the factory to be able to instantiate it. This loose coupling between the blocks' implementations and the syntax of the configuration enables extending the application capacities in a high degree. It also allows producing fully customized receivers, for instance a testbed for acquisition algorithms, and to place observers at any point of the receiver chain.
|
||||
|
||||
More information can be found at the [Control Plane page](http://gnss-sdr.org/docs/control-plane/).
|
||||
|
||||
@ -783,9 +784,9 @@ GNU Radio's class ```gr::basic_block``` is the abstract base class for all signa
|
||||
|
||||
A signal processing flow is constructed by creating a tree of hierarchical blocks, which at any level may also contain terminal nodes that actually implement signal processing functions.
|
||||
|
||||
Class ```gr::top_block``` is the top-level hierarchical block representing a flowgraph. It defines GNU Radio runtime functions used during the execution of the program: run(), start(), stop(), wait(), etc. A a subclass called [GNSSBlockInterface](./src/core/interfaces/gnss_block_interface.h) is the common interface for all the GNSS-SDR modules. It defines pure virtual methods, that are required to be implemented by a derived class.
|
||||
Class ```gr::top_block``` is the top-level hierarchical block representing a flowgraph. It defines GNU Radio runtime functions used during the execution of the program: run(), start(), stop(), wait(), etc. A subclass called [GNSSBlockInterface](./src/core/interfaces/gnss_block_interface.h) is the common interface for all the GNSS-SDR modules. It defines pure virtual methods, that are required to be implemented by a derived class.
|
||||
|
||||
Subclassing GNSSBlockInterface, we defined interfaces for the GNSS receiver blocks depicted in the figure above. This hierarchy provides the definition of different algorithms and different implementations, which will be instantiated according to the configuration. This strategy allows multiple implementations sharing a common interface, achieving the objective of decoupling interfaces from implementations: it defines a family of algorithms, encapsulates each one, and makes them interchangeable. Hence, we let the algorithm vary independently from the program that uses it.
|
||||
Subclassing GNSSBlockInterface, we defined interfaces for the GNSS receiver blocks depicted in the figure above. This hierarchy provides the definition of different algorithms and different implementations, which will be instantiated according to the configuration. This strategy allows multiple implementations sharing a common interface, achieving the objective of decoupling interfaces from implementations: it defines a family of algorithms, encapsulates each one, and makes them interchangeable. Hence, we let the algorithm vary independently of the program that uses it.
|
||||
|
||||
Internally, GNSS-SDR makes use of the complex data types defined by [VOLK](http://libvolk.org/ "Vector-Optimized Library of Kernels home"). They are fundamental for handling sample streams in which samples are complex numbers with real and imaginary components of 8, 16 or 32 bits, common formats delivered by GNSS (and generic SDR) radio frequency front-ends. The following list shows the data type names that GNSS-SDR exposes through the configuration file:
|
||||
|
||||
@ -805,7 +806,7 @@ More information about the available processing blocks and their configuration p
|
||||
|
||||
The input of a software receiver are the raw bits that come out from the front-end's analog-to-digital converter (ADC). Those bits can be read from a file stored in the hard disk or directly in real-time from a hardware device through USB or Ethernet buses.
|
||||
|
||||
The Signal Source module is in charge of implementing the hardware driver, that is, the portion of the code that communicates with the RF front-end and receives the samples coming from the ADC. This communication is usually performed through USB or Ethernet buses. Since real-time processing requires a highly optimized implementation of the whole receiver, this module also allows to read samples from a file stored in a hard disk, and thus processing without time constraints. Relevant parameters of those samples are the intermediate frequency (or baseband I&Q components), the sampling rate and number of bits per sample, that must be specified by the user in the configuration file.
|
||||
The Signal Source module is in charge of implementing the hardware driver, that is, the portion of the code that communicates with the RF front-end and receives the samples coming from the ADC. This communication is usually performed through USB or Ethernet buses. Since real-time processing requires a highly optimized implementation of the whole receiver, this module also allows reading samples from a file stored in a hard disk, and thus processing without time constraints. Relevant parameters of those samples are the intermediate frequency (or baseband I&Q components), the sampling rate and number of bits per sample, that must be specified by the user in the configuration file.
|
||||
|
||||
This module also performs bit-depth adaptation, since most of the existing RF front-ends provide samples quantized with 2 or 3 bits, while operations inside the processor are performed on 32- or 64-bit words, depending on its architecture. Although there are implementations of the most intensive computational processes (mainly correlation) that take advantage of specific data types and architectures for the sake of efficiency, the approach is processor-specific and hardly portable. We suggest to keep signal samples in standard data types and letting the compiler select the best library version (implemented using SIMD or any other processor-specific technology) of the required routines for a given processor.
|
||||
|
||||
@ -821,7 +822,7 @@ SignalSource.item_type=gr_complex
|
||||
SignalSource.sampling_frequency=4000000 ; Sampling frequency in samples per second (Sps)
|
||||
~~~~~~
|
||||
|
||||
Type ```gr_complex``` refers to a GNU Radio typedef equivalent to ```std::complex<float>```. In order to save some storage space, you might wanted to store your signal in a more efficient format such as an I/Q interleaved ```short`` integer sample stream. In that case, change the corresponding line to:
|
||||
Type ```gr_complex``` refers to a GNU Radio typedef equivalent to ```std::complex<float>```. In order to save some storage space, you might want to store your signal in a more efficient format such as an I/Q interleaved ```short`` integer sample stream. In that case, change the corresponding line to:
|
||||
|
||||
~~~~~~
|
||||
SignalSource.item_type=ishort
|
||||
@ -845,7 +846,7 @@ Sometimes, samples are stored in files with a format which is not in the list of
|
||||
|
||||
Within a byte the samples may be packed in big endian ```big_endian_bytes=true``` (if the most significant byte value is stored at the memory location with the lowest address, the next byte value in significance is stored at the following memory location, and so on) or little endian ```big_endian_bytes=false``` (if the least significant byte value is at the lowest address, and the other bytes follow in increasing order of significance). If the order is big endian then the most significant two bits will form the first sample output, otherwise the least significant two bits will be used.
|
||||
|
||||
Additionally the samples may be either real ```sample_type=real```, or complex. If the sample type is complex, then the samples are either stored in the order: real, imag, real, imag, ... ```sample_type=iq``` or in the order: imag, real, imag, real, ... ```sample_type=qi```.
|
||||
Additionally, the samples may be either real ```sample_type=real```, or complex. If the sample type is complex, then the samples are either stored in the order: real, imag, real, imag, ... ```sample_type=iq``` or in the order: imag, real, imag, real, ... ```sample_type=qi```.
|
||||
|
||||
Finally, if the data is stored as shorts ```item_type=short```, then it may be stored in either big endian ```big_endian_items=true``` or little endian ```big_endian_items=false```. If the shorts are big endian then the 2nd byte in each short is output first.
|
||||
|
||||
@ -1007,7 +1008,7 @@ If your signal source is providing baseband signal samples of type ```gr_complex
|
||||
SignalConditioner.implementation=Pass_Through
|
||||
~~~~~~
|
||||
|
||||
If you need to adapt some aspect of you signal, you can enable the Signal Conditioner and configure three internal blocks: a data type adpater, an input signal and a resampler.
|
||||
If you need to adapt some aspect of your signal, you can enable the Signal Conditioner and configure three internal blocks: a data type adapter, an input signal and a resampler.
|
||||
|
||||
~~~~~~
|
||||
;#[Signal_Conditioner] enables this block. Then you have to configure [DataTypeAdapter], [InputFilter] and [Resampler] blocks
|
||||
@ -1030,7 +1031,7 @@ More documentation at the [Data Type Adapter Blocks page](http://gnss-sdr.org/do
|
||||
|
||||
#### Input filter
|
||||
|
||||
This block filters the input data. It can be combined with frequency translation for IF signals. The computation of the filter taps is based on parameters of GNU Radio's function [pm_remez](http://gnuradio.org/doc/doxygen/pm__remez_8h.html), that calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, the desired reponse on those bands, and the weight given to the error in those bands.
|
||||
This block filters the input data. It can be combined with frequency translation for IF signals. The computation of the filter taps is based on parameters of GNU Radio's function [pm_remez](http://gnuradio.org/doc/doxygen/pm__remez_8h.html), that calculates the optimal (in the Chebyshev/minimax sense) FIR filter impulse response given a set of band edges, the desired response on those bands, and the weight given to the error in those bands.
|
||||
|
||||
The block can be configured like this:
|
||||
|
||||
@ -1085,7 +1086,7 @@ More documentation at the [Input Filter Blocks page](http://gnss-sdr.org/docs/sp
|
||||
|
||||
#### Resampler
|
||||
|
||||
This block resamples the input data stream. The ```Direct_Resampler``` block implements a nearest neigbourhood interpolation:
|
||||
This block resamples the input data stream. The ```Direct_Resampler``` block implements a nearest neighbourhood interpolation:
|
||||
|
||||
~~~~~~
|
||||
;######### RESAMPLER CONFIG ############
|
||||
@ -1103,7 +1104,7 @@ More documentation at the [Resampler Blocks page](http://gnss-sdr.org/docs/sp-bl
|
||||
|
||||
### Channel
|
||||
|
||||
A channel encapsulates all signal processing devoted to a single satellite. Thus, it is a large composite object which encapsulates the acquisition, tracking and navigation data decoding modules. As a composite object, it can be treated as a single entity, meaning that it can be easily replicated. Since the number of channels is selectable by the user in the configuration file, this approach helps improving the scalability and maintainability of the receiver.
|
||||
A channel encapsulates all signal processing devoted to a single satellite. Thus, it is a large composite object which encapsulates the acquisition, tracking and navigation data decoding modules. As a composite object, it can be treated as a single entity, meaning that it can be easily replicated. Since the number of channels is selectable by the user in the configuration file, this approach helps to improve the scalability and maintainability of the receiver.
|
||||
|
||||
Each channel must be assigned to a GNSS signal, according to the following identifiers:
|
||||
|
||||
@ -1113,6 +1114,7 @@ Each channel must be assigned to a GNSS signal, according to the following ident
|
||||
| Galileo E1b/c | 1B |
|
||||
| Glonass L1 C/A | 1G |
|
||||
| GPS L2 L2C(M) | 2S |
|
||||
| Glonass L2 C/A | 2G |
|
||||
| GPS L5 | L5 |
|
||||
| Galileo E5a | 5X |
|
||||
|
||||
@ -1144,7 +1146,7 @@ Channel6.signal=1B ;
|
||||
Channel7.signal=1B ;
|
||||
~~~~~~
|
||||
|
||||
This module is also in charge of managing the interplay between acquisition and tracking. Acquisition can be initialized in several ways, depending on the prior information available (called cold start when the receiver has no information about its position nor the satellites almanac; warm start when a rough location and the approximate time of day are available, and the receiver has a recently recorded almanac broadcast; or hot start when the receiver was tracking a satellite and the signal line of sight broke for a short period of time, but the ephemeris and almanac data is still valid, or this information is provided by other means), and an acquisition process can finish deciding that the satellite is not present, that longer integration is needed in order to confirm the presence of the satellite, or declaring the satellite present. In the latter case, acquisition process should stop and trigger the tracking module with coarse estimations of the synchronization parameters. The mathematical abstraction used to design this logic is known as finite state machine (FSM), that is a behavior model composed of a finite number of states, transitions between those states, and actions. For the implementation, we use the [Boost.Statechart library](http://www.boost.org/libs/statechart/doc/tutorial.html), which provides desirable features such as support for asynchronous state machines, multi-threading, type-safety, error handling and compile-time validation.
|
||||
This module is also in charge of managing the interplay between acquisition and tracking. Acquisition can be initialized in several ways, depending on the prior information available (called cold start when the receiver has no information about its position nor the satellites' almanac; warm start when a rough location and the approximate time of day are available, and the receiver has a recently recorded almanac broadcast; or hot start when the receiver was tracking a satellite and the signal line of sight broke for a short period of time, but the ephemeris and almanac data is still valid, or this information is provided by other means), and an acquisition process can finish deciding that the satellite is not present, that longer integration is needed in order to confirm the presence of the satellite, or declaring the satellite present. In the latter case, acquisition process should stop and trigger the tracking module with coarse estimations of the synchronization parameters. The mathematical abstraction used to design this logic is known as finite state machine (FSM), that is a behavior model composed of a finite number of states, transitions between those states, and actions.
|
||||
|
||||
The abstract class [ChannelInterface](./src/core/interfaces/channel_interface.h) represents an interface to a channel GNSS block. Check [Channel](./src/algorithms/channel/adapters/channel.h) for an actual implementation.
|
||||
|
||||
@ -1254,7 +1256,7 @@ More documentation at the [Tracking Blocks page](http://gnss-sdr.org/docs/sp-blo
|
||||
|
||||
#### Decoding of the navigation message
|
||||
|
||||
Most of GNSS signal links are modulated by a navigation message containing the time the message was transmitted, orbital parameters of satellites (also known as ephemeris) and an almanac (information about the general system health, rough orbits of all satellites in the network as well as data related to error correction). Navigation data bits are structured in words, pages, subframes, frames and superframes. Sometimes, bits corresponding to a single parameter are spread over different words, and values extracted from different frames are required for proper decoding. Some words are for synchronization purposes, others for error control an others contain actual information. There are also error control mechanisms, from parity checks to forward error correction (FEC) encoding and interleaving, depending on the system. All this decoding complexity is managed by a finite state machine implemented with the [Boost.Statechart library](http://www.boost.org/libs/statechart/doc/tutorial.html).
|
||||
Most of GNSS signal links are modulated by a navigation message containing the time the message was transmitted, orbital parameters of satellites (also known as ephemeris) and an almanac (information about the general system health, rough orbits of all satellites in the network as well as data related to error correction). Navigation data bits are structured in words, pages, subframes, frames and superframes. Sometimes, bits corresponding to a single parameter are spread over different words, and values extracted from different frames are required for proper decoding. Some words are for synchronization purposes, others for error control and others contain actual information. There are also error control mechanisms, from parity checks to forward error correction (FEC) encoding and interleaving, depending on the system. All this decoding complexity is managed by a finite state machine.
|
||||
|
||||
The common interface is [TelemetryDecoderInterface](./src/core/interfaces/telemetry_decoder_interface.h). Check [GpsL1CaTelemetryDecoder](./src/algorithms/telemetry_decoder/adapters/gps_l1_ca_telemetry_decoder.h) for an example of the GPS L1 NAV message decoding adapter, and [gps_l1_ca_telemetry_decoder_cc](./src/algorithms/telemetry_decoder/gnuradio_blocks/gps_l1_ca_telemetry_decoder_cc.h) for an actual implementation of a signal processing block. Configuration example:
|
||||
|
||||
@ -1341,7 +1343,7 @@ PVT.rtcm_MT1077_rate_ms=1000
|
||||
PVT.rinex_version=2
|
||||
~~~~~~
|
||||
|
||||
* **RTCM SC-104** provides standards that define the data structure for differential GNSS correction information for a variety of differential correction applications. Developed by the Radio Technical Commission for Maritime Services ([RTCM](http://www.rtcm.org/overview.php#Standards "Radio Technical Commission for Maritime Services")), they have become an industry standard for communication of correction information. GNSS-SDR implements RTCM version 3.2, defined in the document *RTCM 10403.2, Differential GNSS (Global Navigation Satellite Systems) Services - Version 3* (February 1, 2013), which can be [purchased online](https://ssl29.pair.com/dmarkle/puborder.php?show=3 "RTCM Online Publication Order Form"). By default, the generated RTCM binary messages are dumped into a text file in hexadecimal format. However, GNSS-SDR is equipped with a TCP/IP server, acting as an NTRIP source that can feed an NTRIP server. NTRIP (Networked Transport of RTCM via Internet Protocol) is an open standard protocol that can be freely download from [BKG](http://igs.bkg.bund.de/root_ftp/NTRIP/documentation/NtripDocumentation.pdf "Networked Transport of RTCM via Internet Protocol (Ntrip) Version 1.0"), and it is designed for disseminating differential correction data (*e.g.* in the RTCM-104 format) or other kinds of GNSS streaming data to stationary or mobile users over the Internet. The TCP/IP server can be enabled by setting ```PVT.flag_rtcm_server=true``` in the configuration file, and will be active during the execution of the software receiver. By default, the server will operate on port 2101 (which is the recommended port for RTCM services according to the Internet Assigned Numbers Authority, [IANA](http://www.iana.org/assignments/service-names-port-numbers "Service Name and Transport Protocol Port Number Registry")), and will identify the Reference Station with ID=1234. This behaviour can be changed in the configuration file:
|
||||
* **RTCM SC-104** provides standards that define the data structure for differential GNSS correction information for a variety of differential correction applications. Developed by the Radio Technical Commission for Maritime Services ([RTCM](http://www.rtcm.org/overview.php#Standards "Radio Technical Commission for Maritime Services")), they have become an industry standard for communication of correction information. GNSS-SDR implements RTCM version 3.2, defined in the document *RTCM 10403.2, Differential GNSS (Global Navigation Satellite Systems) Services - Version 3* (February 1, 2013), which can be [purchased online](https://ssl29.pair.com/dmarkle/puborder.php?show=3 "RTCM Online Publication Order Form"). By default, the generated RTCM binary messages are dumped into a text file in hexadecimal format. However, GNSS-SDR is equipped with a TCP/IP server, acting as an NTRIP source that can feed an NTRIP server. NTRIP (Networked Transport of RTCM via Internet Protocol) is an open standard protocol that can be freely downloaded from [BKG](http://igs.bkg.bund.de/root_ftp/NTRIP/documentation/NtripDocumentation.pdf "Networked Transport of RTCM via Internet Protocol (Ntrip) Version 1.0"), and it is designed for disseminating differential correction data (*e.g.* in the RTCM-104 format) or other kinds of GNSS streaming data to stationary or mobile users over the Internet. The TCP/IP server can be enabled by setting ```PVT.flag_rtcm_server=true``` in the configuration file, and will be active during the execution of the software receiver. By default, the server will operate on port 2101 (which is the recommended port for RTCM services according to the Internet Assigned Numbers Authority, [IANA](http://www.iana.org/assignments/service-names-port-numbers "Service Name and Transport Protocol Port Number Registry")), and will identify the Reference Station with ID=1234. This behaviour can be changed in the configuration file:
|
||||
~~~~~~
|
||||
PVT.flag_rtcm_server=true
|
||||
PVT.rtcm_tcp_port=2102
|
||||
@ -1398,9 +1400,9 @@ There is a list of papers related to GNSS-SDR in our [publications page](http://
|
||||
Ok, now what?
|
||||
=============
|
||||
|
||||
In order to start using GNSS-SDR, you may want to populate ```gnss-sdr/data``` folder (or anywhere else on your system) with raw data files. By "raw data" we mean the output of a Radio Frequency front-end's Analog-to-Digital converter. GNSS-SDR needs signal samples already in baseband or in passband, at a suitable intemediate frequency (on the order of MHz). Prepare your configuration file, and then you are ready for running ```gnss-sdr --config_file=your_configuration.conf```, and seeing how the file is processed.
|
||||
In order to start using GNSS-SDR, you may want to populate ```gnss-sdr/data``` folder (or anywhere else on your system) with raw data files. By "raw data" we mean the output of a Radio Frequency front-end's Analog-to-Digital converter. GNSS-SDR needs signal samples already in baseband or in passband, at a suitable intermediate frequency (on the order of MHz). Prepare your configuration file, and then you are ready for running ```gnss-sdr --config_file=your_configuration.conf```, and seeing how the file is processed.
|
||||
|
||||
Another interesting option is working in real-time with a RF front-end. We provide drivers for UHD-compatible hardware such as the [USRP family](http://www.ettus.com/product), for OsmoSDR and other front-ends (HackRF, bladeRF, LimeSDR), for the GN3S v2 USB dongle and for some DVB-T USB dongles. Start with a low number of channels and then increase it in order to test how many channels your processor can handle in real-time.
|
||||
Another interesting option is working in real-time with an RF front-end. We provide drivers for UHD-compatible hardware such as the [USRP family](http://www.ettus.com/product), for OsmoSDR and other front-ends (HackRF, bladeRF, LimeSDR), for the GN3S v2 USB dongle and for some DVB-T USB dongles. Start with a low number of channels and then increase it in order to test how many channels your processor can handle in real-time.
|
||||
|
||||
You can find more information at the [GNSS-SDR Documentation page](http://gnss-sdr.org/docs/) or directly asking to the [GNSS-SDR Developers mailing list](http://lists.sourceforge.net/lists/listinfo/gnss-sdr-developers).
|
||||
|
||||
|
53
cmake/Modules/Findlibiio.cmake
Normal file
53
cmake/Modules/Findlibiio.cmake
Normal file
@ -0,0 +1,53 @@
|
||||
INCLUDE(FindPkgConfig)
|
||||
PKG_CHECK_MODULES(PC_LIBIIO libiio)
|
||||
|
||||
FIND_PATH(
|
||||
LIBIIO_INCLUDE_DIRS
|
||||
NAMES gnuradio/iio/api.h
|
||||
HINTS $ENV{LIBIIO_DIR}/include
|
||||
${PC_LIBIIO_INCLUDEDIR}
|
||||
PATHS ${CMAKE_INSTALL_PREFIX}/include
|
||||
/usr/local/include
|
||||
/usr/include
|
||||
/opt/local/include
|
||||
)
|
||||
|
||||
FIND_LIBRARY(
|
||||
LIBIIO_LIBRARIES
|
||||
NAMES libiio.so iio
|
||||
HINTS $ENV{LIBIIO_DIR}/lib
|
||||
${PC_LIBIIO_LIBDIR}
|
||||
PATHS ${CMAKE_INSTALL_PREFIX}/lib
|
||||
${CMAKE_INSTALL_PREFIX}/lib64
|
||||
/usr/local/lib
|
||||
/usr/local/lib64
|
||||
/usr/lib
|
||||
/usr/lib64
|
||||
/usr/lib/x86_64-linux-gnu
|
||||
/usr/lib/gcc/alpha-linux-gnu
|
||||
/usr/lib/gcc/aarch64-linux-gnu
|
||||
/usr/lib/gcc/arm-linux-gnueabi
|
||||
/usr/lib/gcc/arm-linux-gnueabihf
|
||||
/usr/lib/gcc/hppa-linux-gnu
|
||||
/usr/lib/gcc/i686-gnu
|
||||
/usr/lib/gcc/i686-linux-gnu
|
||||
/usr/lib/gcc/x86_64-kfreebsd-gnu
|
||||
/usr/lib/gcc/i686-kfreebsd-gnu
|
||||
/usr/lib/gcc/m68k-linux-gnu
|
||||
/usr/lib/gcc/mips-linux-gnu
|
||||
/usr/lib/gcc/mips64el-linux-gnuabi64
|
||||
/usr/lib/gcc/mipsel-linux-gnu
|
||||
/usr/lib/gcc/powerpc-linux-gnu
|
||||
/usr/lib/gcc/powerpc-linux-gnuspe
|
||||
/usr/lib/gcc/powerpc64-linux-gnu
|
||||
/usr/lib/gcc/powerpc64le-linux-gnu
|
||||
/usr/lib/gcc/s390x-linux-gnu
|
||||
/usr/lib/gcc/sparc64-linux-gnu
|
||||
/usr/lib/gcc/x86_64-linux-gnux32
|
||||
/usr/lib/gcc/sh4-linux-gnu
|
||||
/Library/Frameworks/iio.framework/
|
||||
)
|
||||
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBIIO DEFAULT_MSG LIBIIO_LIBRARIES LIBIIO_INCLUDE_DIRS)
|
||||
MARK_AS_ADVANCED(LIBIIO_LIBRARIES LIBIIO_INCLUDE_DIRS)
|
@ -5,7 +5,7 @@ GNSS-SDR.internal_fs_sps=6625000
|
||||
|
||||
;######### SIGNAL_SOURCE CONFIG ############
|
||||
SignalSource.implementation=File_Signal_Source
|
||||
SignalSource.filename=/archive/NT1065_GLONASS_L1_20160924_fs6625e6_if0e3_schar.bin ; <- PUT YOUR FILE HERE
|
||||
SignalSource.filename=/media/dmiralles/Seagate Backup Plus Drive/GNSS Data/NT1065_GLONASS_L1_20160923_fs6625e6_if0e3_schar.bin ; <- PUT YOUR FILE HERE ; <- PUT YOUR FILE HERE
|
||||
SignalSource.item_type=ibyte
|
||||
SignalSource.sampling_frequency=6625000
|
||||
SignalSource.samples=0
|
||||
@ -25,11 +25,11 @@ Channel.signal=1G
|
||||
Channels.in_acquisition=1
|
||||
Channels_1G.count=5
|
||||
|
||||
;Channel0.satellite=24 ; k=
|
||||
;Channel1.satellite=1 ; k=1
|
||||
;Channel2.satellite=2 ; k=-4
|
||||
;Channel3.satellite=20 ; k=-5
|
||||
;Channel4.satellite=21 ; k=4
|
||||
Channel0.satellite=24 ; k=
|
||||
Channel1.satellite=1 ; k=1
|
||||
Channel2.satellite=2 ; k=-4
|
||||
Channel3.satellite=20 ; k=-5
|
||||
Channel4.satellite=21 ; k=4
|
||||
|
||||
;######### ACQUISITION GLOBAL CONFIG ############
|
||||
Acquisition_1G.implementation=GLONASS_L1_CA_PCPS_Acquisition
|
||||
|
141
conf/gnss-sdr_GLONASS_L2_CA_GPS_L1_CA_ibyte.conf
Normal file
141
conf/gnss-sdr_GLONASS_L2_CA_GPS_L1_CA_ibyte.conf
Normal file
@ -0,0 +1,141 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
GNSS-SDR.internal_fs_sps=6625000
|
||||
Receiver.sources_count=2
|
||||
|
||||
;######### SIGNAL_SOURCE CONFIG ############
|
||||
SignalSource0.implementation=File_Signal_Source
|
||||
SignalSource0.filename=/media/dmiralles/Seagate Backup Plus Drive/GNSS Data/NT1065_L1_20160923_fs6625e6_if60e3_schar.bin ; <- PUT YOUR FILE HERE
|
||||
SignalSource0.item_type=ibyte
|
||||
SignalSource0.sampling_frequency=6625000
|
||||
SignalSource0.samples=0
|
||||
SignalSource0.dump=false;
|
||||
SignalSource0.dump_filename=/archive/signal_glonass.bin
|
||||
|
||||
SignalSource1.implementation=File_Signal_Source
|
||||
SignalSource1.filename=/media/dmiralles/Seagate Backup Plus Drive/GNSS Data/NT1065_GLONASS_L2_20160923_fs6625e6_if0e3_schar.bin ; <- PUT YOUR FILE HERE
|
||||
SignalSource1.item_type=ibyte
|
||||
SignalSource1.sampling_frequency=6625000
|
||||
SignalSource1.samples=0
|
||||
SignalSource1.dump=false;
|
||||
SignalSource1.dump_filename=/archive/signal_glonass.bin
|
||||
|
||||
;######### SIGNAL_CONDITIONER CONFIG ############
|
||||
SignalConditioner0.implementation=Signal_Conditioner
|
||||
DataTypeAdapter0.implementation=Ibyte_To_Complex
|
||||
InputFilter0.implementation=Freq_Xlating_Fir_Filter
|
||||
InputFilter0.item_type=gr_complex
|
||||
InputFilter0.output_item_type=gr_complex
|
||||
InputFilter0.taps_item_type=float
|
||||
InputFilter0.number_of_taps=5
|
||||
InputFilter0.number_of_bands=2
|
||||
InputFilter0.band1_begin=0.0
|
||||
InputFilter0.band1_end=0.70
|
||||
InputFilter0.band2_begin=0.80
|
||||
InputFilter0.band2_end=1.0
|
||||
InputFilter0.ampl1_begin=1.0
|
||||
InputFilter0.ampl1_end=1.0
|
||||
InputFilter0.ampl2_begin=0.0
|
||||
InputFilter0.ampl2_end=0.0
|
||||
InputFilter0.band1_error=1.0
|
||||
InputFilter0.band2_error=1.0
|
||||
InputFilter0.filter_type=bandpass
|
||||
InputFilter0.grid_density=16
|
||||
InputFilter0.sampling_frequency=6625000
|
||||
InputFilter0.IF=60000
|
||||
Resampler0.implementation=Direct_Resampler
|
||||
Resampler0.sample_freq_in=6625000
|
||||
Resampler0.sample_freq_out=6625000
|
||||
Resampler0.item_type=gr_complex
|
||||
|
||||
SignalConditioner1.implementation=Signal_Conditioner
|
||||
DataTypeAdapter1.implementation=Ibyte_To_Complex
|
||||
InputFilter1.implementation=Pass_Through
|
||||
InputFilter1.item_type=gr_complex
|
||||
Resampler1.implementation=Pass_Through
|
||||
Resampler1.item_type=gr_complex
|
||||
|
||||
;######### CHANNELS GLOBAL CONFIG ############
|
||||
Channels.in_acquisition=1
|
||||
Channels_2G.count=5
|
||||
Channels_1C.count=5
|
||||
|
||||
;# Defining GLONASS satellites
|
||||
Channel0.RF_channel_ID=0
|
||||
Channel1.RF_channel_ID=0
|
||||
Channel2.RF_channel_ID=0
|
||||
Channel3.RF_channel_ID=0
|
||||
Channel4.RF_channel_ID=0
|
||||
Channel5.RF_channel_ID=1
|
||||
Channel6.RF_channel_ID=1
|
||||
Channel7.RF_channel_ID=1
|
||||
Channel8.RF_channel_ID=1
|
||||
Channel9.RF_channel_ID=1
|
||||
|
||||
|
||||
;######### ACQUISITION GLOBAL CONFIG ############
|
||||
Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition
|
||||
Acquisition_1C.item_type=gr_complex
|
||||
Acquisition_1C.threshold=0.0
|
||||
Acquisition_1C.pfa=0.00001
|
||||
Acquisition_1C.if=0
|
||||
Acquisition_1C.doppler_max=10000
|
||||
Acquisition_1C.doppler_step=250
|
||||
Acquisition_1C.dump=false;
|
||||
Acquisition_1C.dump_filename=/archive/gps_acquisition.dat
|
||||
;Acquisition_1C.coherent_integration_time_ms=10
|
||||
|
||||
Acquisition_2G.implementation=GLONASS_L2_CA_PCPS_Acquisition
|
||||
Acquisition_2G.item_type=gr_complex
|
||||
Acquisition_2G.threshold=0.0
|
||||
Acquisition_2G.pfa=0.00001
|
||||
Acquisition_2G.if=0
|
||||
Acquisition_2G.doppler_max=10000
|
||||
Acquisition_2G.doppler_step=250
|
||||
Acquisition_2G.dump=false;
|
||||
Acquisition_2G.dump_filename=/archive/glo_acquisition.dat
|
||||
;Acquisition_2G.coherent_integration_time_ms=10
|
||||
|
||||
;######### TRACKING GLOBAL CONFIG ############
|
||||
Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking
|
||||
Tracking_1C.item_type=gr_complex
|
||||
Tracking_1C.if=0
|
||||
Tracking_1C.early_late_space_chips=0.5
|
||||
Tracking_1C.pll_bw_hz=20.0;
|
||||
Tracking_1C.dll_bw_hz=2.0;
|
||||
Tracking_1C.dump=false;
|
||||
Tracking_1C.dump_filename=/archive/gps_tracking_ch_
|
||||
|
||||
Tracking_2G.implementation=GLONASS_L2_CA_DLL_PLL_Tracking
|
||||
Tracking_2G.item_type=gr_complex
|
||||
Tracking_2G.if=0
|
||||
Tracking_2G.early_late_space_chips=0.5
|
||||
Tracking_2G.pll_bw_hz=25.0;
|
||||
Tracking_2G.dll_bw_hz=2.0;
|
||||
Tracking_2G.dump=false;
|
||||
Tracking_2G.dump_filename=/archive/glo_tracking_ch_
|
||||
|
||||
;######### TELEMETRY DECODER GPS CONFIG ############
|
||||
TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder
|
||||
TelemetryDecoder_2G.implementation=GLONASS_L2_CA_Telemetry_Decoder
|
||||
|
||||
;######### OBSERVABLES CONFIG ############
|
||||
Observables.implementation=Hybrid_Observables
|
||||
Observables.dump=false;
|
||||
Observables.dump_filename=/archive/gnss_observables.dat
|
||||
|
||||
;######### PVT CONFIG ############
|
||||
PVT.implementation=RTKLIB_PVT
|
||||
PVT.output_rate_ms=100
|
||||
PVT.display_rate_ms=500
|
||||
PVT.trop_model=Saastamoinen
|
||||
PVT.flag_rtcm_server=false
|
||||
PVT.flag_rtcm_tty_port=false
|
||||
PVT.rtcm_dump_devname=/dev/pts/1
|
||||
PVT.rtcm_tcp_port=2101
|
||||
PVT.rtcm_MT1019_rate_ms=5000
|
||||
PVT.rtcm_MT1045_rate_ms=5000
|
||||
PVT.rtcm_MT1097_rate_ms=1000
|
||||
PVT.rtcm_MT1077_rate_ms=1000
|
||||
PVT.rinex_version=2
|
142
conf/gnss-sdr_GLONASS_L2_CA_GPS_L2C_ibyte.conf
Normal file
142
conf/gnss-sdr_GLONASS_L2_CA_GPS_L2C_ibyte.conf
Normal file
@ -0,0 +1,142 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
GNSS-SDR.internal_fs_sps=6625000
|
||||
Receiver.sources_count=2
|
||||
|
||||
;######### SIGNAL_SOURCE CONFIG ############
|
||||
SignalSource0.implementation=File_Signal_Source
|
||||
SignalSource0.filename=/archive/NT1065_L2_20160923_fs6625e6_if60e3_schar.bin ; <- PUT YOUR FILE HERE
|
||||
SignalSource0.item_type=ibyte
|
||||
SignalSource0.sampling_frequency=6625000
|
||||
SignalSource0.samples=0
|
||||
SignalSource0.dump=false;
|
||||
SignalSource0.dump_filename=/archive/signal_glonass.bin
|
||||
|
||||
SignalSource1.implementation=File_Signal_Source
|
||||
SignalSource1.filename=/archive/NT1065_GLONASS_L2_20160923_fs6625e6_if0e3_schar.bin ; <- PUT YOUR FILE HERE
|
||||
SignalSource1.item_type=ibyte
|
||||
SignalSource1.sampling_frequency=6625000
|
||||
SignalSource1.samples=0
|
||||
SignalSource1.dump=false;
|
||||
SignalSource1.dump_filename=/archive/signal_glonass.bin
|
||||
|
||||
;######### SIGNAL_CONDITIONER CONFIG ############
|
||||
SignalConditioner0.implementation=Signal_Conditioner
|
||||
DataTypeAdapter0.implementation=Ibyte_To_Complex
|
||||
InputFilter0.implementation=Freq_Xlating_Fir_Filter
|
||||
InputFilter0.item_type=gr_complex
|
||||
InputFilter0.output_item_type=gr_complex
|
||||
InputFilter0.taps_item_type=float
|
||||
InputFilter0.number_of_taps=5
|
||||
InputFilter0.number_of_bands=2
|
||||
InputFilter0.band1_begin=0.0
|
||||
InputFilter0.band1_end=0.70
|
||||
InputFilter0.band2_begin=0.80
|
||||
InputFilter0.band2_end=1.0
|
||||
InputFilter0.ampl1_begin=1.0
|
||||
InputFilter0.ampl1_end=1.0
|
||||
InputFilter0.ampl2_begin=0.0
|
||||
InputFilter0.ampl2_end=0.0
|
||||
InputFilter0.band1_error=1.0
|
||||
InputFilter0.band2_error=1.0
|
||||
InputFilter0.filter_type=bandpass
|
||||
InputFilter0.grid_density=16
|
||||
InputFilter0.sampling_frequency=6625000
|
||||
InputFilter0.IF=60000
|
||||
Resampler0.implementation=Pass_Through
|
||||
Resampler0.item_type=gr_complex
|
||||
|
||||
SignalConditioner1.implementation=Signal_Conditioner
|
||||
DataTypeAdapter1.implementation=Ibyte_To_Complex
|
||||
InputFilter1.implementation=Pass_Through
|
||||
InputFilter1.item_type=gr_complex
|
||||
Resampler1.implementation=Pass_Through
|
||||
Resampler1.item_type=gr_complex
|
||||
|
||||
;######### CHANNELS GLOBAL CONFIG ############
|
||||
Channels.in_acquisition=5
|
||||
Channels_2S.count=5
|
||||
Channels_2G.count=5
|
||||
|
||||
;# Defining GLONASS satellites
|
||||
Channel0.RF_channel_ID=0
|
||||
Channel0.signal=2S
|
||||
Channel1.RF_channel_ID=0
|
||||
Channel1.signal=2S
|
||||
Channel2.RF_channel_ID=0
|
||||
Channel2.signal=2S
|
||||
Channel3.RF_channel_ID=0
|
||||
Channel3.signal=2S
|
||||
Channel4.RF_channel_ID=0
|
||||
Channel4.signal=2S
|
||||
Channel5.RF_channel_ID=1
|
||||
Channel6.RF_channel_ID=1
|
||||
Channel7.RF_channel_ID=1
|
||||
Channel8.RF_channel_ID=1
|
||||
Channel9.RF_channel_ID=1
|
||||
|
||||
|
||||
;######### ACQUISITION GLOBAL CONFIG ############
|
||||
Acquisition_2S.implementation=GPS_L2_M_PCPS_Acquisition
|
||||
Acquisition_2S.item_type=gr_complex
|
||||
Acquisition_2S.threshold=0.0
|
||||
Acquisition_2S.pfa=0.00001
|
||||
Acquisition_2S.if=0
|
||||
Acquisition_2S.doppler_max=10000
|
||||
Acquisition_2S.doppler_step=60
|
||||
Acquisition_2S.max_dwells=1
|
||||
|
||||
Acquisition_2G.implementation=GLONASS_L2_CA_PCPS_Acquisition
|
||||
Acquisition_2G.item_type=gr_complex
|
||||
Acquisition_2G.threshold=0.0
|
||||
Acquisition_2G.pfa=0.00001
|
||||
Acquisition_2G.if=0
|
||||
Acquisition_2G.doppler_max=10000
|
||||
Acquisition_2G.doppler_step=250
|
||||
Acquisition_2G.dump=false;
|
||||
Acquisition_2G.dump_filename=/archive/glo_acquisition.dat
|
||||
|
||||
;######### TRACKING GLOBAL CONFIG ############
|
||||
Tracking_2S.implementation=GPS_L2_M_DLL_PLL_Tracking
|
||||
Tracking_2S.item_type=gr_complex
|
||||
Tracking_2S.if=0
|
||||
Tracking_2S.early_late_space_chips=0.5
|
||||
Tracking_2S.pll_bw_hz=2.0;
|
||||
Tracking_2S.dll_bw_hz=0.250;
|
||||
Tracking_2S.order=2;
|
||||
Tracking_2S.dump=false;
|
||||
Tracking_2S.dump_filename=/archive/gps_tracking_ch_
|
||||
|
||||
Tracking_2G.implementation=GLONASS_L2_CA_DLL_PLL_Tracking
|
||||
Tracking_2G.item_type=gr_complex
|
||||
Tracking_2G.if=0
|
||||
Tracking_2G.early_late_space_chips=0.5
|
||||
Tracking_2G.pll_bw_hz=25.0;
|
||||
Tracking_2G.dll_bw_hz=3.0;
|
||||
Tracking_2G.dump=false;
|
||||
Tracking_2G.dump_filename=/archive/glo_tracking_ch_
|
||||
|
||||
;######### TELEMETRY DECODER GPS CONFIG ############
|
||||
TelemetryDecoder_2S.implementation=GPS_L2C_Telemetry_Decoder
|
||||
TelemetryDecoder_2G.implementation=GLONASS_L2_CA_Telemetry_Decoder
|
||||
|
||||
;######### OBSERVABLES CONFIG ############
|
||||
Observables.implementation=Hybrid_Observables
|
||||
Observables.dump=false;
|
||||
Observables.dump_filename=/archive/gnss_observables.dat
|
||||
|
||||
;######### PVT CONFIG ############
|
||||
PVT.implementation=RTKLIB_PVT
|
||||
PVT.output_rate_ms=100
|
||||
PVT.display_rate_ms=500
|
||||
PVT.trop_model=Saastamoinen
|
||||
PVT.flag_rtcm_server=true
|
||||
PVT.flag_rtcm_tty_port=false
|
||||
PVT.rtcm_dump_devname=/dev/pts/1
|
||||
PVT.rtcm_tcp_port=2101
|
||||
PVT.rtcm_MT1019_rate_ms=5000
|
||||
PVT.rtcm_MT1045_rate_ms=5000
|
||||
PVT.rtcm_MT1097_rate_ms=1000
|
||||
PVT.rtcm_MT1077_rate_ms=1000
|
||||
PVT.rinex_version=3
|
73
conf/gnss-sdr_GLONASS_L2_CA_ibyte.conf
Normal file
73
conf/gnss-sdr_GLONASS_L2_CA_ibyte.conf
Normal file
@ -0,0 +1,73 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
GNSS-SDR.internal_fs_sps=6625000
|
||||
|
||||
;######### SIGNAL_SOURCE CONFIG ############
|
||||
SignalSource.implementation=File_Signal_Source
|
||||
SignalSource.filename=/media/dmiralles/Seagate Backup Plus Drive/GNSS Data/NT1065_GLONASS_L2_20160831_fs6625e6_60e3_schar_1m.bin ; <- PUT YOUR FILE HERE
|
||||
SignalSource.item_type=ibyte
|
||||
SignalSource.sampling_frequency=6625000
|
||||
SignalSource.samples=0
|
||||
SignalSource.dump=false;
|
||||
SignalSource.dump_filename=/archive/signal_glonass.bin
|
||||
|
||||
;######### SIGNAL_CONDITIONER CONFIG ############
|
||||
SignalConditioner.implementation=Signal_Conditioner
|
||||
DataTypeAdapter.implementation=Ibyte_To_Complex
|
||||
InputFilter.implementation=Pass_Through
|
||||
InputFilter.item_type=gr_complex
|
||||
Resampler.implementation=Pass_Through
|
||||
Resampler.item_type=gr_complex
|
||||
|
||||
;######### CHANNELS GLOBAL CONFIG ############
|
||||
Channel.signal=2G
|
||||
Channels.in_acquisition=1
|
||||
Channels_2G.count=5
|
||||
|
||||
;######### ACQUISITION GLOBAL CONFIG ############
|
||||
Acquisition_2G.implementation=GLONASS_L2_CA_PCPS_Acquisition
|
||||
Acquisition_2G.item_type=gr_complex
|
||||
Acquisition_2G.threshold=0.0
|
||||
Acquisition_2G.pfa=0.0001
|
||||
Acquisition_2G.if=0
|
||||
Acquisition_2G.doppler_max=10000
|
||||
Acquisition_2G.doppler_step=250
|
||||
Acquisition_2G.dump=true;
|
||||
Acquisition_2G.dump_filename=/archive/glo_acquisition.dat
|
||||
;Acquisition_2G.coherent_integration_time_ms=1
|
||||
;Acquisition_2G.max_dwells = 5
|
||||
|
||||
;######### TRACKING GLOBAL CONFIG ############
|
||||
Tracking_2G.implementation=GLONASS_L2_CA_DLL_PLL_Tracking
|
||||
Tracking_2G.item_type=gr_complex
|
||||
Tracking_2G.if=0
|
||||
Tracking_2G.early_late_space_chips=0.5
|
||||
Tracking_2G.pll_bw_hz=20.0;
|
||||
Tracking_2G.dll_bw_hz=2.0;
|
||||
Tracking_2G.dump=true;
|
||||
Tracking_2G.dump_filename=/archive/glo_tracking_ch_
|
||||
|
||||
;######### TELEMETRY DECODER GPS CONFIG ############
|
||||
TelemetryDecoder_2G.implementation=GLONASS_L2_CA_Telemetry_Decoder
|
||||
|
||||
;######### OBSERVABLES CONFIG ############
|
||||
Observables.implementation=Hybrid_Observables
|
||||
Observables.dump=true;
|
||||
Observables.dump_filename=/archive/glo_observables.dat
|
||||
|
||||
;######### PVT CONFIG ############
|
||||
PVT.implementation=RTKLIB_PVT
|
||||
PVT.positioning_mode=Single
|
||||
PVT.output_rate_ms=100
|
||||
PVT.display_rate_ms=500
|
||||
PVT.trop_model=Saastamoinen
|
||||
PVT.flag_rtcm_server=false
|
||||
PVT.flag_rtcm_tty_port=false
|
||||
PVT.rtcm_dump_devname=/dev/pts/1
|
||||
PVT.rtcm_tcp_port=2101
|
||||
PVT.rtcm_MT1019_rate_ms=5000
|
||||
PVT.rtcm_MT1045_rate_ms=5000
|
||||
PVT.rtcm_MT1097_rate_ms=1000
|
||||
PVT.rtcm_MT1077_rate_ms=1000
|
||||
PVT.rinex_version=2
|
83
conf/gnss-sdr_GLONASS_L2_CA_ibyte_coh_trk.conf
Normal file
83
conf/gnss-sdr_GLONASS_L2_CA_ibyte_coh_trk.conf
Normal file
@ -0,0 +1,83 @@
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
GNSS-SDR.internal_fs_sps=6625000
|
||||
|
||||
;######### SIGNAL_SOURCE CONFIG ############
|
||||
SignalSource.implementation=File_Signal_Source
|
||||
SignalSource.filename=/archive/NT1065_GLONASS_L1_20160923_fs6625e6_if0e3_schar.bin ; <- PUT YOUR FILE HERE
|
||||
SignalSource.item_type=ibyte
|
||||
SignalSource.sampling_frequency=6625000
|
||||
SignalSource.samples=0
|
||||
SignalSource.dump=false;
|
||||
SignalSource.dump_filename=/archive/signal_glonass.bin
|
||||
|
||||
;######### SIGNAL_CONDITIONER CONFIG ############
|
||||
SignalConditioner.implementation=Signal_Conditioner
|
||||
DataTypeAdapter.implementation=Ibyte_To_Complex
|
||||
InputFilter.implementation=Pass_Through
|
||||
InputFilter.item_type=gr_complex
|
||||
Resampler.implementation=Pass_Through
|
||||
Resampler.item_type=gr_complex
|
||||
|
||||
;######### CHANNELS GLOBAL CONFIG ############
|
||||
Channel.signal=1G
|
||||
Channels.in_acquisition=2
|
||||
Channels_1G.count=8
|
||||
|
||||
;Channel0.satellite=24 ; k=2
|
||||
;Channel1.satellite=1 ; k=1
|
||||
;Channel2.satellite=2 ; k=-4
|
||||
;Channel3.satellite=20 ; k=-5
|
||||
;Channel4.satellite=21 ; k=4
|
||||
|
||||
;######### ACQUISITION GLOBAL CONFIG ############
|
||||
Acquisition_1G.implementation=GLONASS_L1_CA_PCPS_Acquisition
|
||||
Acquisition_1G.item_type=gr_complex
|
||||
Acquisition_1G.threshold=0.0
|
||||
Acquisition_1G.pfa=0.0001
|
||||
Acquisition_1G.if=0
|
||||
Acquisition_1G.doppler_max=10000
|
||||
Acquisition_1G.doppler_step=250
|
||||
Acquisition_1G.dump=false;
|
||||
Acquisition_1G.dump_filename=/archive/glo_acquisition.dat
|
||||
;Acquisition_1G.coherent_integration_time_ms=1
|
||||
;Acquisition_1G.max_dwells = 5
|
||||
|
||||
;######### TRACKING GLOBAL CONFIG ############
|
||||
Tracking_1G.implementation=GLONASS_L1_CA_DLL_PLL_C_Aid_Tracking
|
||||
Tracking_1G.item_type=gr_complex
|
||||
Tracking_1G.if=0
|
||||
Tracking_1G.early_late_space_chips=0.5
|
||||
Tracking_1G.pll_bw_hz=40.0;
|
||||
Tracking_1G.dll_bw_hz=3.0;
|
||||
Tracking_1G.pll_bw_narrow_hz = 25.0;
|
||||
Tracking_1G.dll_bw_narrow_hz = 2.0;
|
||||
Tracking_1G.extend_correlation_ms = 1;
|
||||
Tracking_1G.dump=false;
|
||||
Tracking_1G.dump_filename=/archive/glo_tracking_ch_
|
||||
|
||||
|
||||
;######### TELEMETRY DECODER GPS CONFIG ############
|
||||
TelemetryDecoder_1G.implementation=GLONASS_L1_CA_Telemetry_Decoder
|
||||
|
||||
;######### OBSERVABLES CONFIG ############
|
||||
Observables.implementation=Hybrid_Observables
|
||||
Observables.dump=false
|
||||
Observables.dump_filename=/archive/glo_observables.dat
|
||||
|
||||
;######### PVT CONFIG ############
|
||||
PVT.implementation=RTKLIB_PVT
|
||||
PVT.positioning_mode=Single
|
||||
PVT.output_rate_ms=100
|
||||
PVT.display_rate_ms=500
|
||||
PVT.trop_model=Saastamoinen
|
||||
PVT.flag_rtcm_server=true
|
||||
PVT.flag_rtcm_tty_port=false
|
||||
PVT.rtcm_dump_devname=/dev/pts/1
|
||||
PVT.rtcm_tcp_port=2101
|
||||
PVT.rtcm_MT1019_rate_ms=5000
|
||||
PVT.rtcm_MT1045_rate_ms=5000
|
||||
PVT.rtcm_MT1097_rate_ms=1000
|
||||
PVT.rtcm_MT1077_rate_ms=1000
|
||||
PVT.rinex_version=2
|
112
conf/gnss-sdr_GPS_L1_2ch_fmcomms2_realtime.conf
Normal file
112
conf/gnss-sdr_GPS_L1_2ch_fmcomms2_realtime.conf
Normal file
@ -0,0 +1,112 @@
|
||||
; You can define your own receiver and invoke it by doing
|
||||
; gnss-sdr --config_file=my_GNSS_SDR_configuration.conf
|
||||
;
|
||||
|
||||
[GNSS-SDR]
|
||||
|
||||
;######### GLOBAL OPTIONS ##################
|
||||
;internal_fs_sps: Internal signal sampling frequency after the signal conditioning stage [Sps].
|
||||
GNSS-SDR.internal_fs_sps=7000000
|
||||
|
||||
;######### SIGNAL_SOURCE CONFIG ############
|
||||
SignalSource.implementation=Fmcomms2_Signal_Source
|
||||
SignalSource.item_type=gr_complex
|
||||
SignalSource.device_address=192.168.0.4
|
||||
SignalSource.sampling_frequency=7000000
|
||||
SignalSource.freq=1575420000
|
||||
SignalSource.bandwidth=4000000
|
||||
SignalSource.RF_channels=2
|
||||
SignalSource.rx1_enable=true
|
||||
SignalSource.rx2_enable=true
|
||||
SignalSource.gain_mode_rx1=slow_attack
|
||||
SignalSource.gain_mode_rx2=slow_attack
|
||||
SignalSource.rf_port_select=A_BALANCED
|
||||
SignalSource.gain_rx1=64
|
||||
SignalSource.gain_rx2=64
|
||||
SignalSource.samples=0
|
||||
SignalSource.repeat=false
|
||||
SignalSource.dump=false
|
||||
SignalSource.dump_filename=../data/signal_source.dat
|
||||
SignalSource.enable_throttle_control=false
|
||||
SignalSource.enable_dds_lo=false
|
||||
SignalSource.freq_rf_tx_hz=1260000000
|
||||
SignalSource.freq_dds_tx_hz=1000
|
||||
SignalSource.scale_dds_dbfs=0.0
|
||||
SignalSource.phase_dds_deg=0.0
|
||||
SignalSource.tx_attenuation_db=0.0
|
||||
|
||||
|
||||
;######### SIGNAL_CONDITIONER CONFIG ############
|
||||
SignalConditioner0.implementation=Pass_Through
|
||||
SignalConditioner1.implementation=Pass_Through
|
||||
|
||||
;######### CHANNELS GLOBAL CONFIG ############
|
||||
Channels_1C.count=8
|
||||
Channels.in_acquisition=1
|
||||
|
||||
;# CHANNEL CONNECTION
|
||||
Channel0.RF_channel_ID=0
|
||||
Channel0.signal=1C
|
||||
Channel1.RF_channel_ID=0
|
||||
Channel1.signal=1C
|
||||
Channel2.RF_channel_ID=0
|
||||
Channel2.signal=1C
|
||||
Channel3.RF_channel_ID=0
|
||||
Channel3.signal=1C
|
||||
Channel4.RF_channel_ID=1
|
||||
Channel4.signal=1C
|
||||
Channel5.RF_channel_ID=1
|
||||
Channel5.signal=1C
|
||||
Channel6.RF_channel_ID=1
|
||||
Channel6.signal=1C
|
||||
Channel7.RF_channel_ID=1
|
||||
Channel7.signal=1C
|
||||
|
||||
;######### ACQUISITION GLOBAL CONFIG ############
|
||||
Acquisition_1C.implementation=GPS_L1_CA_PCPS_Acquisition
|
||||
Acquisition_1C.item_type=gr_complex
|
||||
Acquisition_1C.threshold=20
|
||||
Acquisition_1C.use_CFAR_algorithm=false
|
||||
Acquisition_1C.blocking=true
|
||||
Acquisition_1C.doppler_max=10000
|
||||
Acquisition_1C.doppler_step=250
|
||||
Acquisition_1C.dump=false
|
||||
Acquisition_1C.dump_filename=./acq_dump.dat
|
||||
|
||||
|
||||
;######### TRACKING GLOBAL CONFIG ############
|
||||
Tracking_1C.implementation=GPS_L1_CA_DLL_PLL_Tracking
|
||||
Tracking_1C.item_type=gr_complex
|
||||
Tracking_1C.dump=false
|
||||
Tracking_1C.dump_filename=./tracking_ch_
|
||||
Tracking_1C.pll_bw_hz=35.0;
|
||||
Tracking_1C.dll_bw_hz=2.0;
|
||||
Tracking_1C.early_late_space_chips=0.5;
|
||||
|
||||
|
||||
;######### TELEMETRY DECODER GPS CONFIG ############
|
||||
TelemetryDecoder_1C.implementation=GPS_L1_CA_Telemetry_Decoder
|
||||
TelemetryDecoder_1C.dump=false
|
||||
|
||||
|
||||
;######### OBSERVABLES CONFIG ############
|
||||
Observables.implementation=Hybrid_Observables
|
||||
Observables.dump=false
|
||||
Observables.dump_filename=./observables.dat
|
||||
|
||||
|
||||
;######### PVT CONFIG ############
|
||||
PVT.implementation=RTKLIB_PVT
|
||||
PVT.positioning_mode=Single ; options: Single, Static, Kinematic, PPP_Static, PPP_Kinematic
|
||||
PVT.iono_model=Broadcast ; options: OFF, Broadcast, SBAS, Iono-Free-LC, Estimate_STEC, IONEX
|
||||
PVT.trop_model=Saastamoinen ; options: OFF, Saastamoinen, SBAS, Estimate_ZTD, Estimate_ZTD_Grad
|
||||
PVT.output_rate_ms=100
|
||||
PVT.display_rate_ms=500
|
||||
PVT.dump_filename=./PVT
|
||||
PVT.nmea_dump_filename=./gnss_sdr_pvt.nmea;
|
||||
PVT.flag_nmea_tty_port=false;
|
||||
PVT.nmea_dump_devname=/dev/pts/4
|
||||
PVT.flag_rtcm_server=false
|
||||
PVT.flag_rtcm_tty_port=false
|
||||
PVT.rtcm_dump_devname=/dev/pts/1
|
||||
PVT.dump=false
|
@ -129,7 +129,7 @@ INLINE_INHERITED_MEMB = NO
|
||||
# path before files name in the file list and in the header files. If set
|
||||
# to NO the shortest path that makes the file name unique will be used.
|
||||
|
||||
FULL_PATH_NAMES = YES
|
||||
FULL_PATH_NAMES = NO
|
||||
|
||||
# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
|
||||
# can be used to strip a user-defined part of the path. Stripping is
|
||||
@ -703,7 +703,7 @@ EXAMPLE_RECURSIVE = NO
|
||||
# directories that contain image that are included in the documentation (see
|
||||
# the \image command).
|
||||
|
||||
IMAGE_PATH = @top_srcdir@/docs/doxygen/images/
|
||||
IMAGE_PATH = @top_srcdir@/docs/doxygen/images/
|
||||
|
||||
# The INPUT_FILTER tag can be used to specify a program that doxygen should
|
||||
# invoke to filter for each input file. Doxygen will invoke the filter program
|
||||
@ -791,7 +791,7 @@ REFERENCES_LINK_SOURCE = YES
|
||||
# The default value is: YES.
|
||||
# This tag requires that the tag SOURCE_BROWSER is set to YES.
|
||||
|
||||
SOURCE_TOOLTIPS = YES
|
||||
SOURCE_TOOLTIPS = YES
|
||||
|
||||
# If the USE_HTAGS tag is set to YES then the references to source code
|
||||
# will point to the HTML generated by the htags(1) tool instead of doxygen
|
||||
@ -901,7 +901,7 @@ HTML_COLORSTYLE_GAMMA = 80
|
||||
# page will contain the date and time when the page was generated. Setting
|
||||
# this to NO can help when comparing the output of multiple runs.
|
||||
|
||||
HTML_TIMESTAMP = YES
|
||||
HTML_TIMESTAMP = NO
|
||||
|
||||
# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
|
||||
# files or namespaces will be aligned in HTML using tables. If set to
|
||||
@ -1164,7 +1164,7 @@ MATHJAX_EXTENSIONS =
|
||||
# example see the documentation.
|
||||
# This tag requires that the tag USE_MATHJAX is set to YES.
|
||||
|
||||
MATHJAX_CODEFILE =
|
||||
MATHJAX_CODEFILE =
|
||||
|
||||
# When the SEARCHENGINE tag is enabled doxygen will generate a search box
|
||||
# for the HTML output. The underlying search engine uses javascript
|
||||
@ -1677,7 +1677,7 @@ DOT_FONTSIZE = 10
|
||||
# different font using DOT_FONTNAME you can set the path where dot
|
||||
# can find it using this tag.
|
||||
|
||||
DOT_FONTPATH =
|
||||
DOT_FONTPATH =
|
||||
|
||||
# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
|
||||
# will generate a graph for each documented class showing the direct and
|
||||
|
@ -178,40 +178,44 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
|
||||
int gal_E5a_count = configuration->property("Channels_5X.count", 0);
|
||||
int gal_E5b_count = configuration->property("Channels_7X.count", 0);
|
||||
int glo_1G_count = configuration->property("Channels_1G.count", 0);
|
||||
int glo_2G_count = configuration->property("Channels_2G.count", 0);
|
||||
|
||||
unsigned int type_of_receiver = 0;
|
||||
|
||||
// *******************WARNING!!!!!!!***********
|
||||
// GPS L5 only configurable for single frequency, single system at the moment!!!!!!
|
||||
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 1;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 2;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 3;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 4;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 5;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0)) type_of_receiver = 6;
|
||||
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 1;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 2;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count != 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 3;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 4;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 5;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 6;
|
||||
|
||||
if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 7;
|
||||
if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 7;
|
||||
//if( (gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) type_of_receiver = 8;
|
||||
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 9;
|
||||
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 10;
|
||||
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0)) type_of_receiver = 11;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 12;
|
||||
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 9;
|
||||
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 10;
|
||||
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 11;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 12;
|
||||
//if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) type_of_receiver = 13;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 14;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0)) type_of_receiver = 15;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 14;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 15;
|
||||
//if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) type_of_receiver = 16;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 17;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0)) type_of_receiver = 18;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count != 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 17;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count != 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 18;
|
||||
//if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) type_of_receiver = 19;
|
||||
//if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0)) type_of_receiver = 20;
|
||||
if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0)) type_of_receiver = 21;
|
||||
if ((gps_1C_count != 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count == 0)) type_of_receiver = 21;
|
||||
//if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count = 0)) type_of_receiver = 22;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0)) type_of_receiver = 23;
|
||||
//if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2R_count != 0)) type_of_receiver = 24;
|
||||
//if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_1G_count != 0)) type_of_receiver = 25;
|
||||
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0)) type_of_receiver = 26;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0)) type_of_receiver = 27;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0)) type_of_receiver = 28;
|
||||
if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) type_of_receiver = 24;
|
||||
if( (gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count != 0)) type_of_receiver = 25;
|
||||
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0)) type_of_receiver = 26;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0)) type_of_receiver = 27;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count != 0) && (glo_2G_count == 0)) type_of_receiver = 28;
|
||||
if ((gps_1C_count != 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) type_of_receiver = 29;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count == 0) && (gps_L5_count == 0) && (gal_1B_count != 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) type_of_receiver = 30;
|
||||
if ((gps_1C_count == 0) && (gps_2S_count != 0) && (gps_L5_count == 0) && (gal_1B_count == 0) && (gal_E5a_count == 0) && (gal_E5b_count == 0) && (glo_1G_count == 0) && (glo_2G_count != 0)) type_of_receiver = 31;
|
||||
//RTKLIB PVT solver options
|
||||
// Settings 1
|
||||
int positioning_mode = -1;
|
||||
@ -236,9 +240,9 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
|
||||
int num_bands = 0;
|
||||
|
||||
if ((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0)) num_bands = 1;
|
||||
if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0)) && (gps_2S_count > 0)) num_bands = 2;
|
||||
if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0)) && ((gps_2S_count > 0) || (glo_2G_count > 0))) num_bands = 2;
|
||||
if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0)) && ((gal_E5a_count > 0) || (gal_E5b_count > 0) || (gps_L5_count > 0))) num_bands = 2;
|
||||
if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0)) && (gps_2S_count > 0) && ((gal_E5a_count > 0) || (gal_E5b_count > 0) || (gps_L5_count > 0))) num_bands = 3;
|
||||
if (((gps_1C_count > 0) || (gal_1B_count > 0) || (glo_1G_count > 0)) && ((gps_2S_count > 0) || (glo_2G_count > 0)) && ((gal_E5a_count > 0) || (gal_E5b_count > 0) || (gps_L5_count > 0))) num_bands = 3;
|
||||
|
||||
int number_of_frequencies = configuration->property(role + ".num_bands", num_bands); /* (1:L1, 2:L1+L2, 3:L1+L2+L5) */
|
||||
if ((number_of_frequencies < 1) || (number_of_frequencies > 3))
|
||||
@ -321,7 +325,7 @@ RtklibPvt::RtklibPvt(ConfigurationInterface* configuration,
|
||||
int nsys = 0;
|
||||
if ((gps_1C_count > 0) || (gps_2S_count > 0) || (gps_L5_count > 0)) nsys += SYS_GPS;
|
||||
if ((gal_1B_count > 0) || (gal_E5a_count > 0) || (gal_E5b_count > 0)) nsys += SYS_GAL;
|
||||
if ((glo_1G_count > 0)) nsys += SYS_GLO;
|
||||
if ((glo_1G_count > 0) || (glo_2G_count > 0)) nsys += SYS_GLO;
|
||||
int navigation_system = configuration->property(role + ".navigation_system", nsys); /* (SYS_XXX) see src/algorithms/libs/rtklib/rtklib.h */
|
||||
if ((navigation_system < 1) || (navigation_system > 255)) /* GPS: 1 SBAS: 2 GPS+SBAS: 3 Galileo: 8 Galileo+GPS: 9 GPS+SBAS+Galileo: 11 All: 255 */
|
||||
{
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -57,7 +57,7 @@
|
||||
#include "glonass_gnav_navigation_message.h"
|
||||
#include "GPS_L1_CA.h"
|
||||
#include "Galileo_E1.h"
|
||||
#include "GLONASS_L1_CA.h"
|
||||
#include "GLONASS_L1_L2_CA.h"
|
||||
#include "gnss_synchro.h"
|
||||
#include <boost/date_time/posix_time/posix_time.hpp>
|
||||
#include <string>
|
||||
|
@ -55,7 +55,7 @@
|
||||
#include "rtklib_conversions.h"
|
||||
#include "GPS_L1_CA.h"
|
||||
#include "Galileo_E1.h"
|
||||
#include "GLONASS_L1_CA.h"
|
||||
#include "GLONASS_L1_L2_CA.h"
|
||||
#include <glog/logging.h>
|
||||
|
||||
|
||||
|
@ -33,6 +33,7 @@ set(ACQ_ADAPTER_SOURCES
|
||||
galileo_e5a_noncoherent_iq_acquisition_caf.cc
|
||||
galileo_e5a_pcps_acquisition.cc
|
||||
glonass_l1_ca_pcps_acquisition.cc
|
||||
glonass_l2_ca_pcps_acquisition.cc
|
||||
)
|
||||
|
||||
if(ENABLE_FPGA)
|
||||
|
@ -34,8 +34,8 @@
|
||||
#include "glonass_l1_ca_pcps_acquisition.h"
|
||||
#include "configuration_interface.h"
|
||||
#include "glonass_l1_signal_processing.h"
|
||||
#include "GLONASS_L1_CA.h"
|
||||
#include "gnss_sdr_flags.h"
|
||||
#include "GLONASS_L1_L2_CA.h"
|
||||
#include <boost/math/distributions/exponential.hpp>
|
||||
#include <glog/logging.h>
|
||||
|
||||
|
@ -0,0 +1,312 @@
|
||||
/*!
|
||||
* \file glonass_l2_ca_pcps_acquisition.cc
|
||||
* \brief Adapts a PCPS acquisition block to an AcquisitionInterface for
|
||||
* Glonass L2 C/A signals
|
||||
* \author Damian Miralles, 2018, dmiralles2009@gmail.com
|
||||
*
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* GNSS-SDR is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNSS-SDR is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "glonass_l2_ca_pcps_acquisition.h"
|
||||
#include "configuration_interface.h"
|
||||
#include "glonass_l2_signal_processing.h"
|
||||
#include "GLONASS_L1_L2_CA.h"
|
||||
#include "gnss_sdr_flags.h"
|
||||
#include <boost/math/distributions/exponential.hpp>
|
||||
#include <glog/logging.h>
|
||||
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
GlonassL2CaPcpsAcquisition::GlonassL2CaPcpsAcquisition(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
configuration_ = configuration;
|
||||
std::string default_item_type = "gr_complex";
|
||||
std::string default_dump_filename = "./data/acquisition.dat";
|
||||
|
||||
DLOG(INFO) << "role " << role;
|
||||
|
||||
item_type_ = configuration_->property(role + ".item_type", default_item_type);
|
||||
|
||||
long fs_in_deprecated = configuration_->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
fs_in_ = configuration_->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
if_ = configuration_->property(role + ".if", 0);
|
||||
dump_ = configuration_->property(role + ".dump", false);
|
||||
blocking_ = configuration_->property(role + ".blocking", true);
|
||||
doppler_max_ = configuration_->property(role + ".doppler_max", 5000);
|
||||
if (FLAGS_doppler_max != 0) doppler_max_ = FLAGS_doppler_max;
|
||||
sampled_ms_ = configuration_->property(role + ".coherent_integration_time_ms", 1);
|
||||
|
||||
bit_transition_flag_ = configuration_->property(role + ".bit_transition_flag", false);
|
||||
use_CFAR_algorithm_flag_ = configuration_->property(role + ".use_CFAR_algorithm", true); //will be false in future versions
|
||||
|
||||
max_dwells_ = configuration_->property(role + ".max_dwells", 1);
|
||||
|
||||
dump_filename_ = configuration_->property(role + ".dump_filename", default_dump_filename);
|
||||
|
||||
//--- Find number of samples per spreading code -------------------------
|
||||
code_length_ = round(fs_in_ / (GLONASS_L2_CA_CODE_RATE_HZ / GLONASS_L2_CA_CODE_LENGTH_CHIPS));
|
||||
|
||||
vector_length_ = code_length_ * sampled_ms_;
|
||||
|
||||
if (bit_transition_flag_)
|
||||
{
|
||||
vector_length_ *= 2;
|
||||
}
|
||||
|
||||
code_ = new gr_complex[vector_length_];
|
||||
|
||||
if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
item_size_ = sizeof(lv_16sc_t);
|
||||
}
|
||||
else
|
||||
{
|
||||
item_size_ = sizeof(gr_complex);
|
||||
}
|
||||
acquisition_ = pcps_make_acquisition(sampled_ms_, max_dwells_,
|
||||
doppler_max_, if_, fs_in_, code_length_, code_length_,
|
||||
bit_transition_flag_, use_CFAR_algorithm_flag_, dump_, blocking_, dump_filename_, item_size_);
|
||||
DLOG(INFO) << "acquisition(" << acquisition_->unique_id() << ")";
|
||||
|
||||
stream_to_vector_ = gr::blocks::stream_to_vector::make(item_size_, vector_length_);
|
||||
DLOG(INFO) << "stream_to_vector(" << stream_to_vector_->unique_id() << ")";
|
||||
|
||||
if (item_type_.compare("cbyte") == 0)
|
||||
{
|
||||
cbyte_to_float_x2_ = make_complex_byte_to_float_x2();
|
||||
float_to_complex_ = gr::blocks::float_to_complex::make();
|
||||
}
|
||||
|
||||
channel_ = 0;
|
||||
threshold_ = 0.0;
|
||||
doppler_step_ = 0;
|
||||
gnss_synchro_ = 0;
|
||||
}
|
||||
|
||||
|
||||
GlonassL2CaPcpsAcquisition::~GlonassL2CaPcpsAcquisition()
|
||||
{
|
||||
delete[] code_;
|
||||
}
|
||||
|
||||
|
||||
void GlonassL2CaPcpsAcquisition::set_channel(unsigned int channel)
|
||||
{
|
||||
channel_ = channel;
|
||||
acquisition_->set_channel(channel_);
|
||||
}
|
||||
|
||||
|
||||
void GlonassL2CaPcpsAcquisition::set_threshold(float threshold)
|
||||
{
|
||||
float pfa = configuration_->property(role_ + ".pfa", 0.0);
|
||||
|
||||
if (pfa == 0.0)
|
||||
{
|
||||
threshold_ = threshold;
|
||||
}
|
||||
else
|
||||
{
|
||||
threshold_ = calculate_threshold(pfa);
|
||||
}
|
||||
|
||||
DLOG(INFO) << "Channel " << channel_ << " Threshold = " << threshold_;
|
||||
|
||||
acquisition_->set_threshold(threshold_);
|
||||
}
|
||||
|
||||
|
||||
void GlonassL2CaPcpsAcquisition::set_doppler_max(unsigned int doppler_max)
|
||||
{
|
||||
doppler_max_ = doppler_max;
|
||||
|
||||
acquisition_->set_doppler_max(doppler_max_);
|
||||
}
|
||||
|
||||
|
||||
void GlonassL2CaPcpsAcquisition::set_doppler_step(unsigned int doppler_step)
|
||||
{
|
||||
doppler_step_ = doppler_step;
|
||||
|
||||
acquisition_->set_doppler_step(doppler_step_);
|
||||
}
|
||||
|
||||
|
||||
void GlonassL2CaPcpsAcquisition::set_gnss_synchro(Gnss_Synchro* gnss_synchro)
|
||||
{
|
||||
gnss_synchro_ = gnss_synchro;
|
||||
|
||||
acquisition_->set_gnss_synchro(gnss_synchro_);
|
||||
}
|
||||
|
||||
|
||||
signed int GlonassL2CaPcpsAcquisition::mag()
|
||||
{
|
||||
return acquisition_->mag();
|
||||
}
|
||||
|
||||
|
||||
void GlonassL2CaPcpsAcquisition::init()
|
||||
{
|
||||
acquisition_->init();
|
||||
|
||||
set_local_code();
|
||||
}
|
||||
|
||||
|
||||
void GlonassL2CaPcpsAcquisition::set_local_code()
|
||||
{
|
||||
std::complex<float>* code = new std::complex<float>[code_length_];
|
||||
|
||||
glonass_l2_ca_code_gen_complex_sampled(code, /* gnss_synchro_->PRN,*/ fs_in_, 0);
|
||||
|
||||
for (unsigned int i = 0; i < sampled_ms_; i++)
|
||||
{
|
||||
memcpy(&(code_[i * code_length_]), code,
|
||||
sizeof(gr_complex) * code_length_);
|
||||
}
|
||||
|
||||
acquisition_->set_local_code(code_);
|
||||
delete[] code;
|
||||
}
|
||||
|
||||
|
||||
void GlonassL2CaPcpsAcquisition::reset()
|
||||
{
|
||||
acquisition_->set_active(true);
|
||||
}
|
||||
|
||||
|
||||
void GlonassL2CaPcpsAcquisition::set_state(int state)
|
||||
{
|
||||
acquisition_->set_state(state);
|
||||
}
|
||||
|
||||
|
||||
float GlonassL2CaPcpsAcquisition::calculate_threshold(float pfa)
|
||||
{
|
||||
//Calculate the threshold
|
||||
unsigned int frequency_bins = 0;
|
||||
/*
|
||||
for (int doppler = (int)(-doppler_max_); doppler <= (int)doppler_max_; doppler += doppler_step_)
|
||||
{
|
||||
frequency_bins++;
|
||||
}
|
||||
*/
|
||||
|
||||
frequency_bins = (2 * doppler_max_ + doppler_step_) / doppler_step_;
|
||||
|
||||
DLOG(INFO) << "Channel " << channel_ << " Pfa = " << pfa;
|
||||
unsigned int ncells = vector_length_ * frequency_bins;
|
||||
double exponent = 1 / static_cast<double>(ncells);
|
||||
double val = pow(1.0 - pfa, exponent);
|
||||
double lambda = static_cast<double>(vector_length_);
|
||||
boost::math::exponential_distribution<double> mydist(lambda);
|
||||
float threshold = static_cast<float>(quantile(mydist, val));
|
||||
|
||||
return threshold;
|
||||
}
|
||||
|
||||
|
||||
void GlonassL2CaPcpsAcquisition::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
top_block->connect(stream_to_vector_, 0, acquisition_, 0);
|
||||
}
|
||||
else if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
top_block->connect(stream_to_vector_, 0, acquisition_, 0);
|
||||
}
|
||||
else if (item_type_.compare("cbyte") == 0)
|
||||
{
|
||||
top_block->connect(cbyte_to_float_x2_, 0, float_to_complex_, 0);
|
||||
top_block->connect(cbyte_to_float_x2_, 1, float_to_complex_, 1);
|
||||
top_block->connect(float_to_complex_, 0, stream_to_vector_, 0);
|
||||
top_block->connect(stream_to_vector_, 0, acquisition_, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(WARNING) << item_type_ << " unknown acquisition item type";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GlonassL2CaPcpsAcquisition::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
top_block->disconnect(stream_to_vector_, 0, acquisition_, 0);
|
||||
}
|
||||
else if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
top_block->disconnect(stream_to_vector_, 0, acquisition_, 0);
|
||||
}
|
||||
else if (item_type_.compare("cbyte") == 0)
|
||||
{
|
||||
// Since a byte-based acq implementation is not available,
|
||||
// we just convert cshorts to gr_complex
|
||||
top_block->disconnect(cbyte_to_float_x2_, 0, float_to_complex_, 0);
|
||||
top_block->disconnect(cbyte_to_float_x2_, 1, float_to_complex_, 1);
|
||||
top_block->disconnect(float_to_complex_, 0, stream_to_vector_, 0);
|
||||
top_block->disconnect(stream_to_vector_, 0, acquisition_, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(WARNING) << item_type_ << " unknown acquisition item type";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
gr::basic_block_sptr GlonassL2CaPcpsAcquisition::get_left_block()
|
||||
{
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
return stream_to_vector_;
|
||||
}
|
||||
else if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
return stream_to_vector_;
|
||||
}
|
||||
else if (item_type_.compare("cbyte") == 0)
|
||||
{
|
||||
return cbyte_to_float_x2_;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(WARNING) << item_type_ << " unknown acquisition item type";
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
gr::basic_block_sptr GlonassL2CaPcpsAcquisition::get_right_block()
|
||||
{
|
||||
return acquisition_;
|
||||
}
|
@ -0,0 +1,166 @@
|
||||
/*!
|
||||
* \file glonass_l2_ca_pcps_acquisition.h
|
||||
* \brief Adapts a PCPS acquisition block to an AcquisitionInterface for
|
||||
* Glonass L2 C/A signals
|
||||
* \author Damian Miralles, 2018, dmiralles2009@gmail.com
|
||||
*
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* GNSS-SDR is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNSS-SDR is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef GNSS_SDR_GLONASS_L2_CA_PCPS_ACQUISITION_H_
|
||||
#define GNSS_SDR_GLONASS_L2_CA_PCPS_ACQUISITION_H_
|
||||
|
||||
#include "acquisition_interface.h"
|
||||
#include "gnss_synchro.h"
|
||||
#include "pcps_acquisition.h"
|
||||
#include "complex_byte_to_float_x2.h"
|
||||
#include <gnuradio/blocks/stream_to_vector.h>
|
||||
#include <gnuradio/blocks/float_to_complex.h>
|
||||
#include <string>
|
||||
|
||||
class ConfigurationInterface;
|
||||
|
||||
/*!
|
||||
* \brief This class adapts a PCPS acquisition block to an AcquisitionInterface
|
||||
* for GLONASS L2 C/A signals
|
||||
*/
|
||||
class GlonassL2CaPcpsAcquisition : public AcquisitionInterface
|
||||
{
|
||||
public:
|
||||
GlonassL2CaPcpsAcquisition(ConfigurationInterface* configuration,
|
||||
std::string role, unsigned int in_streams,
|
||||
unsigned int out_streams);
|
||||
|
||||
virtual ~GlonassL2CaPcpsAcquisition();
|
||||
|
||||
inline std::string role() override
|
||||
{
|
||||
return role_;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Returns "GLONASS_L2_CA_PCPS_Acquisition"
|
||||
*/
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "GLONASS_L2_CA_PCPS_Acquisition";
|
||||
}
|
||||
|
||||
inline size_t item_size() override
|
||||
{
|
||||
return item_size_;
|
||||
}
|
||||
|
||||
void connect(gr::top_block_sptr top_block) override;
|
||||
void disconnect(gr::top_block_sptr top_block) override;
|
||||
gr::basic_block_sptr get_left_block() override;
|
||||
gr::basic_block_sptr get_right_block() override;
|
||||
|
||||
/*!
|
||||
* \brief Set acquisition/tracking common Gnss_Synchro object pointer
|
||||
* to efficiently exchange synchronization data between acquisition and
|
||||
* tracking blocks
|
||||
*/
|
||||
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
||||
|
||||
/*!
|
||||
* \brief Set acquisition channel unique ID
|
||||
*/
|
||||
void set_channel(unsigned int channel) override;
|
||||
|
||||
/*!
|
||||
* \brief Set statistics threshold of PCPS algorithm
|
||||
*/
|
||||
void set_threshold(float threshold) override;
|
||||
|
||||
/*!
|
||||
* \brief Set maximum Doppler off grid search
|
||||
*/
|
||||
void set_doppler_max(unsigned int doppler_max) override;
|
||||
|
||||
/*!
|
||||
* \brief Set Doppler steps for the grid search
|
||||
*/
|
||||
void set_doppler_step(unsigned int doppler_step) override;
|
||||
|
||||
/*!
|
||||
* \brief Initializes acquisition algorithm.
|
||||
*/
|
||||
void init() override;
|
||||
|
||||
/*!
|
||||
* \brief Sets local code for GLONASS L2/CA PCPS acquisition algorithm.
|
||||
*/
|
||||
void set_local_code() override;
|
||||
|
||||
/*!
|
||||
* \brief Returns the maximum peak of grid search
|
||||
*/
|
||||
signed int mag() override;
|
||||
|
||||
/*!
|
||||
* \brief Restart acquisition algorithm
|
||||
*/
|
||||
void reset() override;
|
||||
|
||||
/*!
|
||||
* \brief If state = 1, it forces the block to start acquiring from the first sample
|
||||
*/
|
||||
void set_state(int state);
|
||||
|
||||
private:
|
||||
ConfigurationInterface* configuration_;
|
||||
pcps_acquisition_sptr acquisition_;
|
||||
gr::blocks::stream_to_vector::sptr stream_to_vector_;
|
||||
gr::blocks::float_to_complex::sptr float_to_complex_;
|
||||
complex_byte_to_float_x2_sptr cbyte_to_float_x2_;
|
||||
size_t item_size_;
|
||||
std::string item_type_;
|
||||
unsigned int vector_length_;
|
||||
unsigned int code_length_;
|
||||
bool bit_transition_flag_;
|
||||
bool use_CFAR_algorithm_flag_;
|
||||
unsigned int channel_;
|
||||
float threshold_;
|
||||
unsigned int doppler_max_;
|
||||
unsigned int doppler_step_;
|
||||
unsigned int sampled_ms_;
|
||||
unsigned int max_dwells_;
|
||||
long fs_in_;
|
||||
long if_;
|
||||
bool dump_;
|
||||
bool blocking_;
|
||||
std::string dump_filename_;
|
||||
std::complex<float>* code_;
|
||||
Gnss_Synchro* gnss_synchro_;
|
||||
std::string role_;
|
||||
unsigned int in_streams_;
|
||||
unsigned int out_streams_;
|
||||
|
||||
float calculate_threshold(float pfa);
|
||||
};
|
||||
|
||||
#endif /* GNSS_SDR_GLONASS_L2_CA_PCPS_ACQUISITION_H_ */
|
@ -34,8 +34,8 @@
|
||||
*/
|
||||
|
||||
#include "pcps_acquisition.h"
|
||||
#include "GPS_L1_CA.h" // for GPS_TWO_PI
|
||||
#include "GLONASS_L1_CA.h" // for GLONASS_TWO_PI
|
||||
#include "GPS_L1_CA.h" // for GPS_TWO_PI
|
||||
#include "GLONASS_L1_L2_CA.h" // for GLONASS_TWO_PI"
|
||||
#include <glog/logging.h>
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <matio.h>
|
||||
@ -210,6 +210,12 @@ bool pcps_acquisition::is_fdma()
|
||||
LOG(INFO) << "Trying to acquire SV PRN " << d_gnss_synchro->PRN << " with freq " << d_freq << " in Glonass Channel " << GLONASS_PRN.at(d_gnss_synchro->PRN) << std::endl;
|
||||
return true;
|
||||
}
|
||||
else if (strcmp(d_gnss_synchro->Signal, "2G") == 0)
|
||||
{
|
||||
d_freq += DFRQ2_GLO * GLONASS_PRN.at(d_gnss_synchro->PRN);
|
||||
LOG(INFO) << "Trying to acquire SV PRN " << d_gnss_synchro->PRN << " with freq " << d_freq << " in Glonass Channel " << GLONASS_PRN.at(d_gnss_synchro->PRN) << std::endl;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
|
@ -316,7 +316,7 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items,
|
||||
gr_complex* corr_output = static_cast<gr_complex*>(volk_gnsssdr_malloc(d_samples_per_code * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
|
||||
|
||||
/*Stores a copy of the folded version of the signal.This is used for
|
||||
the FFT operations in future steps of excecution*/
|
||||
the FFT operations in future steps of execution*/
|
||||
// gr_complex in_folded[d_fft_size];
|
||||
float fft_normalization_factor = static_cast<float>(d_fft_size) * static_cast<float>(d_fft_size);
|
||||
|
||||
@ -468,7 +468,7 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items,
|
||||
if (d_dump)
|
||||
{
|
||||
/*Since QuickSYnc performs a folded correlation in frequency by means
|
||||
of the FFT, it is esential to also keep the values obtained from the
|
||||
of the FFT, it is essential to also keep the values obtained from the
|
||||
possible delay to show how it is maximize*/
|
||||
std::stringstream filename;
|
||||
std::streamsize n = sizeof(float) * (d_fft_size); // complex file write
|
||||
|
@ -16,40 +16,11 @@
|
||||
# along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
|
||||
#if(ENABLE_CUDA)
|
||||
# # Append current NVCC flags by something, eg comput capability
|
||||
# # set(CUDA_NVCC_FLAGS ${CUDA_NVCC_FLAGS} --gpu-architecture sm_30)
|
||||
# list(APPEND CUDA_NVCC_FLAGS "-gencode arch=compute_30,code=sm_30; -std=c++11;-O3; -use_fast_math -default-stream per-thread")
|
||||
# set(CUDA_PROPAGATE_HOST_FLAGS OFF)
|
||||
# CUDA_INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
# set(LIB_TYPE STATIC) #set the lib type
|
||||
# CUDA_ADD_LIBRARY(CUDA_CORRELATOR_LIB ${LIB_TYPE} cuda_multicorrelator.h cuda_multicorrelator.cu)
|
||||
# set(OPT_TRACKING_LIBRARIES ${OPT_TRACKING_LIBRARIES} CUDA_CORRELATOR_LIB)
|
||||
# set(OPT_TRACKING_INCLUDES ${OPT_TRACKING_INCLUDES} ${CUDA_INCLUDE_DIRS} )
|
||||
#endif(ENABLE_CUDA)
|
||||
|
||||
|
||||
|
||||
#set(TRACKING_LIB_SOURCES
|
||||
|
||||
set(ACQUISITION_LIB_SOURCES
|
||||
gps_fpga_acquisition_8sc.cc
|
||||
# cpu_multicorrelator.cc
|
||||
# cpu_multicorrelator_16sc.cc
|
||||
# lock_detectors.cc
|
||||
# tcp_communication.cc
|
||||
# tcp_packet_data.cc
|
||||
# tracking_2nd_DLL_filter.cc
|
||||
# tracking_2nd_PLL_filter.cc
|
||||
# tracking_discriminators.cc
|
||||
# tracking_FLL_PLL_filter.cc
|
||||
# tracking_loop_filter.cc
|
||||
)
|
||||
|
||||
#if(ENABLE_FPGA)
|
||||
# SET(ACQUISITION_LIB_SOURCES ${ACQUISITION_LIB_SOURCES} fpga_acquisition_8sc.cc)
|
||||
#endif(ENABLE_FPGA)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_SOURCE_DIR}/src/core/system_parameters
|
||||
@ -59,34 +30,17 @@ include_directories(
|
||||
${VOLK_INCLUDE_DIRS}
|
||||
${GLOG_INCLUDE_DIRS}
|
||||
${GFlags_INCLUDE_DIRS}
|
||||
${OPT_TRACKING_INCLUDES}
|
||||
${VOLK_GNSSSDR_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
if(ENABLE_GENERIC_ARCH)
|
||||
add_definitions( -DGENERIC_ARCH=1 )
|
||||
endif(ENABLE_GENERIC_ARCH)
|
||||
|
||||
if (SSE3_AVAILABLE)
|
||||
add_definitions( -DHAVE_SSE3=1 )
|
||||
endif(SSE3_AVAILABLE)
|
||||
|
||||
|
||||
#file(GLOB TRACKING_LIB_HEADERS "*.h")
|
||||
file(GLOB ACQUISITION_LIB_HEADERS "*.h")
|
||||
#list(SORT TRACKING_LIB_HEADERS)
|
||||
list(SORT ACQUISITION_LIB_HEADERS)
|
||||
#add_library(tracking_lib ${TRACKING_LIB_SOURCES} ${TRACKING_LIB_HEADERS})
|
||||
add_library(acquisition_lib ${ACQUISITION_LIB_SOURCES} ${ACQUISITION_LIB_HEADERS})
|
||||
#source_group(Headers FILES ${TRACKING_LIB_HEADERS})
|
||||
source_group(Headers FILES ${ACQUISITION_LIB_HEADERS})
|
||||
#target_link_libraries(tracking_lib ${OPT_TRACKING_LIBRARIES} ${VOLK_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES})
|
||||
target_link_libraries(acquisition_lib ${OPT_ACQUISITION_LIBRARIES} ${VOLK_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES})
|
||||
target_link_libraries(acquisition_lib ${VOLK_LIBRARIES} ${VOLK_GNSSSDR_LIBRARIES} ${GNURADIO_RUNTIME_LIBRARIES})
|
||||
if(VOLK_GNSSSDR_FOUND)
|
||||
# add_dependencies(tracking_lib glog-${glog_RELEASE})
|
||||
add_dependencies(acquisition_lib glog-${glog_RELEASE})
|
||||
else(VOLK_GNSSSDR_FOUND)
|
||||
# add_dependencies(tracking_lib glog-${glog_RELEASE} volk_gnsssdr_module)
|
||||
add_dependencies(acquisition_lib glog-${glog_RELEASE} volk_gnsssdr_module)
|
||||
endif()
|
||||
|
||||
|
@ -35,34 +35,32 @@
|
||||
|
||||
#include "gps_fpga_acquisition_8sc.h"
|
||||
#include "gps_sdr_signal_processing.h"
|
||||
#include "GPS_L1_CA.h"
|
||||
#include <cmath>
|
||||
#include <volk/volk.h>
|
||||
|
||||
// allocate memory dynamically
|
||||
#include <new>
|
||||
|
||||
// libraries used by DMA test code and GIPO test code
|
||||
#include <stdio.h>
|
||||
#include <cstdio>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <errno.h>
|
||||
#include <cerrno>
|
||||
|
||||
// libraries used by DMA test code
|
||||
#include <sys/stat.h>
|
||||
#include <stdint.h>
|
||||
#include <unistd.h>
|
||||
#include <assert.h>
|
||||
#include <cstdint>
|
||||
#include <cassert>
|
||||
|
||||
// libraries used by GPIO test code
|
||||
#include <stdlib.h>
|
||||
#include <signal.h>
|
||||
#include <cstdlib>
|
||||
#include <csignal>
|
||||
#include <sys/mman.h>
|
||||
|
||||
// logging
|
||||
#include <glog/logging.h>
|
||||
|
||||
#include <volk/volk.h>
|
||||
|
||||
#include "GPS_L1_CA.h"
|
||||
|
||||
#define PAGE_SIZE 0x10000
|
||||
#define MAX_PHASE_STEP_RAD 0.999999999534339 // 1 - pow(2,-31);
|
||||
@ -110,7 +108,7 @@ gps_fpga_acquisition_8sc::gps_fpga_acquisition_8sc(std::string device_name,
|
||||
// allocate memory to compute all the PRNs
|
||||
// and compute all the possible codes
|
||||
std::complex<float>* code = new std::complex<float>[nsamples_total]; // buffer for the local code
|
||||
std::complex<float>* code_total = new gr_complex[vector_length]; // buffer for the local code repeate every number of ms
|
||||
std::complex<float>* code_total = new gr_complex[vector_length]; // buffer for the local code repeat every number of ms
|
||||
|
||||
gr_complex* d_fft_codes_padded = static_cast<gr_complex*>(volk_gnsssdr_malloc(vector_length * sizeof(gr_complex), volk_gnsssdr_get_alignment()));
|
||||
|
||||
@ -252,8 +250,8 @@ void gps_fpga_acquisition_8sc::set_phase_step(unsigned int doppler_index)
|
||||
{
|
||||
phase_step_rad_real = MAX_PHASE_STEP_RAD;
|
||||
}
|
||||
phase_step_rad_int_temp = phase_step_rad_real * 4; // * 2^2
|
||||
phase_step_rad_int = (int32_t)(phase_step_rad_int_temp * (536870912)); // * 2^29 (in total it makes x2^31 in two steps to avoid the warnings
|
||||
phase_step_rad_int_temp = phase_step_rad_real * 4; // * 2^2
|
||||
phase_step_rad_int = static_cast<int32_t>(phase_step_rad_int_temp * (536870912)); // * 2^29 (in total it makes x2^31 in two steps to avoid the warnings
|
||||
|
||||
d_map_base[3] = phase_step_rad_int;
|
||||
}
|
||||
|
@ -92,7 +92,7 @@ private:
|
||||
int d_fd; // driver descriptor
|
||||
volatile unsigned *d_map_base; // driver memory map
|
||||
lv_16sc_t *d_all_fft_codes; // memory that contains all the code ffts
|
||||
unsigned int d_vector_length; // number of samples incluing padding and number of ms
|
||||
unsigned int d_vector_length; // number of samples including padding and number of ms
|
||||
unsigned int d_nsamples; // number of samples not including padding
|
||||
unsigned int d_select_queue; // queue selection
|
||||
std::string d_device_name; // HW device name
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* \file notch_filter_lite.h
|
||||
* \brief Adapts a ligth version of a multistate notch filter
|
||||
* \brief Adapts a light version of a multistate notch filter
|
||||
* \author Antonio Ramos, 2017. antonio.ramosdet(at)gmail.com
|
||||
*
|
||||
* Detailed description of the file here if needed.
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*!
|
||||
* \file notch_lite_cc.h
|
||||
* \brief Implements a notch filter ligth algorithm
|
||||
* \brief Implements a notch filter light algorithm
|
||||
* \author Antonio Ramos (antonio.ramosdet(at)gmail.com)
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
@ -43,7 +43,7 @@ typedef boost::shared_ptr<NotchLite> notch_lite_sptr;
|
||||
notch_lite_sptr make_notch_filter_lite(float p_c_factor, float pfa, int length_, int n_segments_est, int n_segments_reset, int n_segments_coeff);
|
||||
|
||||
/*!
|
||||
* \brief This class implements a real-time software-defined multi state notch filter ligth version
|
||||
* \brief This class implements a real-time software-defined multi state notch filter light version
|
||||
*/
|
||||
|
||||
class NotchLite : public gr::block
|
||||
|
@ -27,6 +27,7 @@ set(GNSS_SPLIBS_SOURCES
|
||||
gnss_signal_processing.cc
|
||||
gps_sdr_signal_processing.cc
|
||||
glonass_l1_signal_processing.cc
|
||||
glonass_l2_signal_processing.cc
|
||||
pass_through.cc
|
||||
galileo_e5_signal_processing.cc
|
||||
complex_byte_to_float_x2.cc
|
||||
|
@ -53,7 +53,7 @@ void galileo_e1_code_gen_int(int* _dest, char _Signal[3], signed int _prn)
|
||||
for (size_t i = 0; i < Galileo_E1_B_PRIMARY_CODE[prn].length(); i++)
|
||||
{
|
||||
hex_to_binary_converter(&_dest[index], Galileo_E1_B_PRIMARY_CODE[prn].at(i));
|
||||
index = index + 4;
|
||||
index += 4;
|
||||
}
|
||||
}
|
||||
else if (_galileo_signal.rfind("1C") != std::string::npos && _galileo_signal.length() >= 2)
|
||||
@ -61,13 +61,9 @@ void galileo_e1_code_gen_int(int* _dest, char _Signal[3], signed int _prn)
|
||||
for (size_t i = 0; i < Galileo_E1_C_PRIMARY_CODE[prn].length(); i++)
|
||||
{
|
||||
hex_to_binary_converter(&_dest[index], Galileo_E1_C_PRIMARY_CODE[prn].at(i));
|
||||
index = index + 4;
|
||||
index += 4;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -107,6 +103,18 @@ void galileo_e1_sinboc_61_gen_int(int* _dest, int* _prn, unsigned int _length_ou
|
||||
}
|
||||
}
|
||||
|
||||
void galileo_e1_code_gen_sinboc11_float(float* _dest, char _Signal[3], unsigned int _prn)
|
||||
{
|
||||
std::string _galileo_signal = _Signal;
|
||||
unsigned int _codeLength = static_cast<unsigned int>(Galileo_E1_B_CODE_LENGTH_CHIPS);
|
||||
int primary_code_E1_chips[4092]; // _codeLength not accepted by Clang
|
||||
galileo_e1_code_gen_int(primary_code_E1_chips, _Signal, _prn); //generate Galileo E1 code, 1 sample per chip
|
||||
for (unsigned int i = 0; i < _codeLength; i++)
|
||||
{
|
||||
_dest[2 * i] = static_cast<float>(primary_code_E1_chips[i]);
|
||||
_dest[2 * i + 1] = -_dest[2 * i];
|
||||
}
|
||||
}
|
||||
|
||||
void galileo_e1_gen_float(float* _dest, int* _prn, char _Signal[3])
|
||||
{
|
||||
@ -137,8 +145,6 @@ void galileo_e1_gen_float(float* _dest, int* _prn, char _Signal[3])
|
||||
beta * static_cast<float>(sinboc_61[i]);
|
||||
}
|
||||
}
|
||||
else
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
|
@ -34,6 +34,11 @@
|
||||
|
||||
#include <complex>
|
||||
|
||||
/*!
|
||||
* \brief This function generates Galileo E1 code (can select E1B or E1C sinboc).
|
||||
*
|
||||
*/
|
||||
void galileo_e1_code_gen_sinboc11_float(float* _dest, char _Signal[3], unsigned int _prn);
|
||||
|
||||
/*!
|
||||
* \brief This function generates Galileo E1 code (can select E1B or E1C, cboc or sinboc
|
||||
|
152
src/algorithms/libs/glonass_l2_signal_processing.cc
Normal file
152
src/algorithms/libs/glonass_l2_signal_processing.cc
Normal file
@ -0,0 +1,152 @@
|
||||
/*!
|
||||
* \file glonass_l2_signal_processing.cc
|
||||
* \brief This class implements various functions for GLONASS L2 CA signals
|
||||
* \author Damian Miralles, 2018, dmiralles2009(at)gmail.com
|
||||
*
|
||||
* Detailed description of the file here if needed.
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* GNSS-SDR is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNSS-SDR is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "glonass_l2_signal_processing.h"
|
||||
|
||||
auto auxCeil = [](float x) { return static_cast<int>(static_cast<long>((x) + 1)); };
|
||||
|
||||
void glonass_l2_ca_code_gen_complex(std::complex<float>* _dest, /* signed int _prn,*/ unsigned int _chip_shift)
|
||||
{
|
||||
const unsigned int _code_length = 511;
|
||||
bool G1[_code_length];
|
||||
bool G1_register[9];
|
||||
bool feedback1;
|
||||
bool aux;
|
||||
unsigned int delay;
|
||||
unsigned int lcv, lcv2;
|
||||
|
||||
for (lcv = 0; lcv < 9; lcv++)
|
||||
{
|
||||
G1_register[lcv] = 1;
|
||||
}
|
||||
|
||||
/* Generate G1 Register */
|
||||
for (lcv = 0; lcv < _code_length; lcv++)
|
||||
{
|
||||
G1[lcv] = G1_register[2];
|
||||
|
||||
feedback1 = G1_register[4] ^ G1_register[0];
|
||||
|
||||
for (lcv2 = 0; lcv2 < 8; lcv2++)
|
||||
{
|
||||
G1_register[lcv2] = G1_register[lcv2 + 1];
|
||||
}
|
||||
|
||||
G1_register[8] = feedback1;
|
||||
}
|
||||
|
||||
/* Generate PRN from G1 Register */
|
||||
for (lcv = 0; lcv < _code_length; lcv++)
|
||||
{
|
||||
aux = G1[lcv];
|
||||
if (aux == true)
|
||||
{
|
||||
_dest[lcv] = std::complex<float>(1, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
_dest[lcv] = std::complex<float>(-1, 0);
|
||||
}
|
||||
}
|
||||
|
||||
/* Set the delay */
|
||||
delay = _code_length;
|
||||
delay += _chip_shift;
|
||||
delay %= _code_length;
|
||||
|
||||
/* Generate PRN from G1 and G2 Registers */
|
||||
for (lcv = 0; lcv < _code_length; lcv++)
|
||||
{
|
||||
aux = G1[(lcv + _chip_shift) % _code_length];
|
||||
if (aux == true)
|
||||
{
|
||||
_dest[lcv] = std::complex<float>(1, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
_dest[lcv] = std::complex<float>(-1, 0);
|
||||
}
|
||||
delay++;
|
||||
delay %= _code_length;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Generates complex GLONASS L2 C/A code for the desired SV ID and sampled to specific sampling frequency
|
||||
*/
|
||||
void glonass_l2_ca_code_gen_complex_sampled(std::complex<float>* _dest, /* unsigned int _prn,*/ signed int _fs, unsigned int _chip_shift)
|
||||
{
|
||||
// This function is based on the GNU software GPS for MATLAB in the Kay Borre book
|
||||
std::complex<float> _code[511];
|
||||
signed int _samplesPerCode, _codeValueIndex;
|
||||
float _ts;
|
||||
float _tc;
|
||||
float aux;
|
||||
const signed int _codeFreqBasis = 511000; //Hz
|
||||
const signed int _codeLength = 511;
|
||||
|
||||
//--- Find number of samples per spreading code ----------------------------
|
||||
_samplesPerCode = static_cast<signed int>(static_cast<double>(_fs) / static_cast<double>(_codeFreqBasis / _codeLength));
|
||||
|
||||
//--- Find time constants --------------------------------------------------
|
||||
_ts = 1.0 / static_cast<float>(_fs); // Sampling period in sec
|
||||
_tc = 1.0 / static_cast<float>(_codeFreqBasis); // C/A chip period in sec
|
||||
glonass_l2_ca_code_gen_complex(_code, _chip_shift); //generate C/A code 1 sample per chip
|
||||
|
||||
for (signed int i = 0; i < _samplesPerCode; i++)
|
||||
{
|
||||
//=== Digitizing =======================================================
|
||||
|
||||
//--- Make index array to read C/A code values -------------------------
|
||||
// The length of the index array depends on the sampling frequency -
|
||||
// number of samples per millisecond (because one C/A code period is one
|
||||
// millisecond).
|
||||
|
||||
// _codeValueIndex = ceil((_ts * ((float)i + 1)) / _tc) - 1;
|
||||
aux = (_ts * (i + 1)) / _tc;
|
||||
_codeValueIndex = auxCeil(aux) - 1;
|
||||
|
||||
//--- Make the digitized version of the C/A code -----------------------
|
||||
// The "upsampled" code is made by selecting values form the CA code
|
||||
// chip array (caCode) for the time instances of each sample.
|
||||
if (i == _samplesPerCode - 1)
|
||||
{
|
||||
//--- Correct the last index (due to number rounding issues) -----------
|
||||
_dest[i] = _code[_codeLength - 1];
|
||||
}
|
||||
else
|
||||
{
|
||||
_dest[i] = _code[_codeValueIndex]; //repeat the chip -> upsample
|
||||
}
|
||||
}
|
||||
}
|
47
src/algorithms/libs/glonass_l2_signal_processing.h
Normal file
47
src/algorithms/libs/glonass_l2_signal_processing.h
Normal file
@ -0,0 +1,47 @@
|
||||
/*!
|
||||
* \file glonass_l2_signal_processing.h
|
||||
* \brief This class implements various functions for GLONASS L2 CA signals
|
||||
* \author Damian Miralles, 2018, dmiralles2009(at)gmail.com
|
||||
*
|
||||
* Detailed description of the file here if needed.
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* GNSS-SDR is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNSS-SDR is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef GNSS_SDR_GLONASS_L2_SIGNAL_PROCESSING_H_
|
||||
#define GNSS_SDR_GLONASS_L2_SIGNAL_PROCESSING_H_
|
||||
|
||||
#include <complex>
|
||||
|
||||
//!Generates complex GLONASS L2 C/A code for the desired SV ID and code shift, and sampled to specific sampling frequency
|
||||
void glonass_l2_ca_code_gen_complex(std::complex<float>* _dest, /*signed int _prn,*/ unsigned int _chip_shift);
|
||||
|
||||
//! Generates N complex GLONASS L2 C/A codes for the desired SV ID and code shift
|
||||
void glonass_l2_ca_code_gen_complex_sampled(std::complex<float>* _dest, /* unsigned int _prn,*/ signed int _fs, unsigned int _chip_shift, unsigned int _ncodes);
|
||||
|
||||
//! Generates complex GLONASS L2 C/A code for the desired SV ID and code shift
|
||||
void glonass_l2_ca_code_gen_complex_sampled(std::complex<float>* _dest, /* unsigned int _prn,*/ signed int _fs, unsigned int _chip_shift);
|
||||
|
||||
#endif /* GNSS_SDR_GLONASS_L2_SIGNAL_PROCESSING_H_ */
|
@ -71,6 +71,23 @@ void gps_l2c_m_code_gen_complex(std::complex<float>* _dest, unsigned int _prn)
|
||||
delete[] _code;
|
||||
}
|
||||
|
||||
void gps_l2c_m_code_gen_float(float* _dest, unsigned int _prn)
|
||||
{
|
||||
int32_t* _code = new int32_t[GPS_L2_M_CODE_LENGTH_CHIPS];
|
||||
|
||||
if (_prn > 0 and _prn < 51)
|
||||
{
|
||||
gps_l2c_m_code(_code, _prn);
|
||||
}
|
||||
|
||||
for (signed int i = 0; i < GPS_L2_M_CODE_LENGTH_CHIPS; i++)
|
||||
{
|
||||
_dest[i] = 1.0 - 2.0 * static_cast<float>(_code[i]);
|
||||
}
|
||||
|
||||
delete[] _code;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Generates complex GPS L2C M code for the desired SV ID and sampled to specific sampling frequency
|
||||
|
@ -38,7 +38,7 @@
|
||||
|
||||
//!Generates complex GPS L2C M code for the desired SV ID
|
||||
void gps_l2c_m_code_gen_complex(std::complex<float>* _dest, unsigned int _prn);
|
||||
|
||||
void gps_l2c_m_code_gen_float(float* _dest, unsigned int _prn);
|
||||
|
||||
//! Generates complex GPS L2C M code for the desired SV ID, and sampled to specific sampling frequency
|
||||
void gps_l2c_m_code_gen_complex_sampled(std::complex<float>* _dest, unsigned int _prn, signed int _fs);
|
||||
|
@ -197,6 +197,22 @@ void gps_l5i_code_gen_complex(std::complex<float>* _dest, unsigned int _prn)
|
||||
delete[] _code;
|
||||
}
|
||||
|
||||
void gps_l5i_code_gen_float(float* _dest, unsigned int _prn)
|
||||
{
|
||||
int32_t* _code = new int32_t[GPS_L5i_CODE_LENGTH_CHIPS];
|
||||
|
||||
if (_prn > 0 and _prn < 51)
|
||||
{
|
||||
make_l5i(_code, _prn - 1);
|
||||
}
|
||||
|
||||
for (signed int i = 0; i < GPS_L5i_CODE_LENGTH_CHIPS; i++)
|
||||
{
|
||||
_dest[i] = 1.0 - 2.0 * static_cast<float>(_code[i]);
|
||||
}
|
||||
|
||||
delete[] _code;
|
||||
}
|
||||
|
||||
/*
|
||||
* Generates complex GPS L5i code for the desired SV ID and sampled to specific sampling frequency
|
||||
@ -264,7 +280,22 @@ void gps_l5q_code_gen_complex(std::complex<float>* _dest, unsigned int _prn)
|
||||
delete[] _code;
|
||||
}
|
||||
|
||||
void gps_l5q_code_gen_float(float* _dest, unsigned int _prn)
|
||||
{
|
||||
int32_t* _code = new int32_t[GPS_L5q_CODE_LENGTH_CHIPS];
|
||||
|
||||
if (_prn > 0 and _prn < 51)
|
||||
{
|
||||
make_l5q(_code, _prn - 1);
|
||||
}
|
||||
|
||||
for (signed int i = 0; i < GPS_L5q_CODE_LENGTH_CHIPS; i++)
|
||||
{
|
||||
_dest[i] = 1.0 - 2.0 * static_cast<float>(_code[i]);
|
||||
}
|
||||
|
||||
delete[] _code;
|
||||
}
|
||||
/*
|
||||
* Generates complex GPS L5i code for the desired SV ID and sampled to specific sampling frequency
|
||||
*/
|
||||
|
@ -38,9 +38,11 @@
|
||||
|
||||
//!Generates complex GPS L5i M code for the desired SV ID
|
||||
void gps_l5i_code_gen_complex(std::complex<float>* _dest, unsigned int _prn);
|
||||
void gps_l5i_code_gen_float(float* _dest, unsigned int _prn);
|
||||
|
||||
//!Generates complex GPS L5q M code for the desired SV ID
|
||||
void gps_l5q_code_gen_complex(std::complex<float>* _dest, unsigned int _prn);
|
||||
void gps_l5q_code_gen_float(float* _dest, unsigned int _prn);
|
||||
|
||||
//! Generates complex GPS L5i M code for the desired SV ID, and sampled to specific sampling frequency
|
||||
void gps_l5i_code_gen_complex_sampled(std::complex<float>* _dest, unsigned int _prn, signed int _fs);
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -663,7 +663,7 @@ int satpos_sbas(gtime_t time, gtime_t teph, int sat, const nav_t *nav,
|
||||
*svh = -1;
|
||||
return 0;
|
||||
}
|
||||
/* satellite postion and clock by broadcast ephemeris */
|
||||
/* satellite position and clock by broadcast ephemeris */
|
||||
if (!ephpos(time, teph, sat, nav, sbs->lcorr.iode, rs, dts, var, svh)) return 0;
|
||||
|
||||
/* sbas satellite correction (long term and fast) */
|
||||
@ -734,7 +734,7 @@ int satpos_ssr(gtime_t time, gtime_t teph, int sat, const nav_t *nav,
|
||||
*svh = -1;
|
||||
return 0;
|
||||
}
|
||||
/* satellite postion and clock by broadcast ephemeris */
|
||||
/* satellite position and clock by broadcast ephemeris */
|
||||
if (!ephpos(time, teph, sat, nav, ssr->iode, rs, dts, var, svh)) return 0;
|
||||
|
||||
/* satellite clock for gps, galileo and qzss */
|
||||
|
@ -768,7 +768,7 @@ int pntpos(const obsd_t *obs, int n, const nav_t *nav,
|
||||
opt_.ionoopt = IONOOPT_BRDC;
|
||||
opt_.tropopt = TROPOPT_SAAS;
|
||||
}
|
||||
/* satellite positons, velocities and clocks */
|
||||
/* satellite positions, velocities and clocks */
|
||||
satposs(sol->time, obs, n, nav, opt_.sateph, rs, dts, var, svh);
|
||||
|
||||
/* estimate receiver position with pseudorange */
|
||||
|
@ -425,7 +425,7 @@ int fix_amb_ROUND(rtk_t *rtk, int *sat1, int *sat2, const int *NW, int n)
|
||||
sat2[m] = sat2[i];
|
||||
NC[m++] = BC;
|
||||
}
|
||||
/* select fixed ambiguities by dependancy check */
|
||||
/* select fixed ambiguities by dependency check */
|
||||
m = sel_amb(sat1, sat2, NC, var, m);
|
||||
|
||||
/* fixed solution */
|
||||
|
@ -79,7 +79,7 @@
|
||||
|
||||
const double MIN_ARC_GAP = 300.0; /* min arc gap (s) */
|
||||
const double CONST_AMB = 0.001; /* constraint to fixed ambiguity */
|
||||
const double THRES_RES = 0.3; /* threashold of residuals test (m) */
|
||||
const double THRES_RES = 0.3; /* threshold of residuals test (m) */
|
||||
const double LOG_PI = 1.14472988584940017; /* log(pi) */
|
||||
const double SQRT2 = 1.41421356237309510; /* sqrt(2) */
|
||||
|
||||
|
@ -843,7 +843,7 @@ void satantoff(gtime_t time, const double *rs, int sat, const nav_t *nav,
|
||||
* args : gtime_t time I time (gpst)
|
||||
* int sat I satellite number
|
||||
* nav_t *nav I navigation data
|
||||
* int opt I sat postion option
|
||||
* int opt I sat position option
|
||||
* (0: center of mass, 1: antenna phase center)
|
||||
* double *rs O sat position and velocity (ecef)
|
||||
* {x,y,z,vx,vy,vz} (m|m/s)
|
||||
|
@ -315,7 +315,7 @@ int input_rtcm3(rtcm_t *rtcm, unsigned char data)
|
||||
|
||||
|
||||
/* input rtcm 2 message from file ----------------------------------------------
|
||||
* fetch next rtcm 2 message and input a messsage from file
|
||||
* fetch next rtcm 2 message and input a message from file
|
||||
* args : rtcm_t *rtcm IO rtcm control struct
|
||||
* FILE *fp I file pointer
|
||||
* return : status (-2: end of file, -1...10: same as above)
|
||||
@ -337,7 +337,7 @@ int input_rtcm2f(rtcm_t *rtcm, FILE *fp)
|
||||
|
||||
|
||||
/* input rtcm 3 message from file ----------------------------------------------
|
||||
* fetch next rtcm 3 message and input a messsage from file
|
||||
* fetch next rtcm 3 message and input a message from file
|
||||
* args : rtcm_t *rtcm IO rtcm control struct
|
||||
* FILE *fp I file pointer
|
||||
* return : status (-2: end of file, -1...10: same as above)
|
||||
|
@ -1056,7 +1056,7 @@ int decode_type1021(rtcm_t *rtcm __attribute__((unused)))
|
||||
}
|
||||
|
||||
|
||||
/* decode type 1022: moledenski-badekas transfromation -----------------------*/
|
||||
/* decode type 1022: moledenski-badekas transformation -----------------------*/
|
||||
int decode_type1022(rtcm_t *rtcm __attribute__((unused)))
|
||||
{
|
||||
trace(2, "rtcm3 1022: not supported message\n");
|
||||
@ -2699,7 +2699,7 @@ void save_msm_obs(rtcm_t *rtcm, int sys, msm_h_t *h, const double *r,
|
||||
/* signal to rinex obs type */
|
||||
code[i] = obs2code(sig[i], freq + i);
|
||||
|
||||
/* freqency index for beidou */
|
||||
/* frequency index for beidou */
|
||||
if (sys == SYS_BDS)
|
||||
{
|
||||
if (freq[i] == 5)
|
||||
|
@ -1819,7 +1819,7 @@ unsigned int tickget(void)
|
||||
|
||||
/* sleep ms --------------------------------------------------------------------
|
||||
* sleep ms
|
||||
* args : int ms I miliseconds to sleep (<0:no sleep)
|
||||
* args : int ms I milliseconds to sleep (<0:no sleep)
|
||||
* return : none
|
||||
*-----------------------------------------------------------------------------*/
|
||||
void sleepms(int ms)
|
||||
@ -1884,7 +1884,7 @@ double dms2deg(const double *dms)
|
||||
}
|
||||
|
||||
|
||||
/* transform ecef to geodetic postion ------------------------------------------
|
||||
/* transform ecef to geodetic position ------------------------------------------
|
||||
* transform ecef position to geodetic position
|
||||
* args : double *r I ecef position {x,y,z} (m)
|
||||
* double *pos O geodetic position {lat,lon,h} (rad,m)
|
||||
@ -1926,8 +1926,8 @@ void pos2ecef(const double *pos, double *r)
|
||||
}
|
||||
|
||||
|
||||
/* ecef to local coordinate transfromation matrix ------------------------------
|
||||
* compute ecef to local coordinate transfromation matrix
|
||||
/* ecef to local coordinate transformation matrix ------------------------------
|
||||
* compute ecef to local coordinate transformation matrix
|
||||
* args : double *pos I geodetic position {lat,lon} (rad)
|
||||
* double *E O ecef to local coord transformation matrix (3x3)
|
||||
* return : none
|
||||
@ -2223,7 +2223,7 @@ void eci2ecef(gtime_t tutc, const double *erpv, double *U, double *gmst)
|
||||
matmul("NN", 3, 3, 3, 1.0, R1, R2, 0.0, R);
|
||||
matmul("NN", 3, 3, 3, 1.0, R, R3, 0.0, N); /* N=Rx(-eps)*Rz(-dspi)*Rx(eps) */
|
||||
|
||||
/* greenwich aparent sidereal time (rad) */
|
||||
/* greenwich apparent sidereal time (rad) */
|
||||
gmst_ = utc2gmst(tutc_, erpv[2]);
|
||||
gast = gmst_ + dpsi * cos(eps);
|
||||
gast += (0.00264 * sin(f[4]) + 0.000063 * sin(2.0 * f[4])) * AS2R;
|
||||
@ -4166,7 +4166,7 @@ void sunmoonpos(gtime_t tutc, const double *erpv, double *rsun,
|
||||
/* eci to ecef transformation matrix */
|
||||
eci2ecef(tutc, erpv, U, &gmst_);
|
||||
|
||||
/* sun and moon postion in ecef */
|
||||
/* sun and moon position in ecef */
|
||||
if (rsun) matmul("NN", 3, 1, 3, 1.0, U, rs, 0.0, rsun);
|
||||
if (rmoon) matmul("NN", 3, 1, 3, 1.0, U, rm, 0.0, rmoon);
|
||||
if (gmst) *gmst = gmst_;
|
||||
|
@ -599,7 +599,7 @@ void udpos(rtk_t *rtk, double tt)
|
||||
for (i = 0; i < 3; i++) initx_rtk(rtk, rtk->sol.rr[i], VAR_POS, i);
|
||||
return;
|
||||
}
|
||||
/* check variance of estimated postion */
|
||||
/* check variance of estimated position */
|
||||
for (i = 0; i < 3; i++)
|
||||
{
|
||||
var += rtk->P[i + i * rtk->nx];
|
||||
@ -2223,7 +2223,7 @@ void rtkfree(rtk_t *rtk)
|
||||
* .vs [r] O data valid single (r=0:rover,1:base)
|
||||
* .resp [f] O freq(f+1) pseudorange residual (m)
|
||||
* .resc [f] O freq(f+1) carrier-phase residual (m)
|
||||
* .vsat [f] O freq(f+1) data vaild (0:invalid,1:valid)
|
||||
* .vsat [f] O freq(f+1) data valid (0:invalid,1:valid)
|
||||
* .fix [f] O freq(f+1) ambiguity flag
|
||||
* (0:nodata,1:float,2:fix,3:hold)
|
||||
* .slip [f] O freq(f+1) slip flag
|
||||
@ -2262,7 +2262,7 @@ int rtkpos(rtk_t *rtk, const obsd_t *obs, int n, const nav_t *nav)
|
||||
traceobs(4, obs, n);
|
||||
/*trace(5,"nav=\n"); tracenav(5,nav);*/
|
||||
|
||||
/* set base staion position */
|
||||
/* set base station position */
|
||||
if (opt->refpos <= POSOPT_RINEX && opt->mode != PMODE_SINGLE &&
|
||||
opt->mode != PMODE_MOVEB)
|
||||
{
|
||||
|
@ -210,7 +210,7 @@ void updatesvr(rtksvr_t *svr, int ret, obs_t *obs, nav_t *nav, int sat,
|
||||
svr->nmsg[index][2]++;
|
||||
}
|
||||
else if (ret == 5)
|
||||
{ /* antenna postion parameters */
|
||||
{ /* antenna position parameters */
|
||||
if (svr->rtk.opt.refpos == 4 && index == 1)
|
||||
{
|
||||
for (i = 0; i < 3; i++)
|
||||
|
@ -616,10 +616,10 @@ int cmpmsgs(const void *p1, const void *p2)
|
||||
* (gtime_t te I end time )
|
||||
* sbs_t *sbs IO sbas messages
|
||||
* return : number of sbas messages
|
||||
* notes : sbas message are appended and sorted. before calling the funciton,
|
||||
* notes : sbas message are appended and sorted. before calling the function,
|
||||
* sbs->n, sbs->nmax and sbs->msgs must be set properly. (initially
|
||||
* sbs->n=sbs->nmax=0, sbs->msgs=NULL)
|
||||
* only the following file extentions after wild card expanded are valid
|
||||
* only the following file extensions after wild card expanded are valid
|
||||
* to read. others are skipped
|
||||
* .sbs, .SBS, .ems, .EMS
|
||||
*-----------------------------------------------------------------------------*/
|
||||
|
@ -150,7 +150,7 @@ void covtosol(const double *P, sol_t *sol)
|
||||
}
|
||||
|
||||
|
||||
/* decode nmea gprmc: recommended minumum data for gps -----------------------*/
|
||||
/* decode nmea gprmc: recommended minimum data for gps -----------------------*/
|
||||
int decode_nmearmc(char **val, int n, sol_t *sol)
|
||||
{
|
||||
double tod = 0.0, lat = 0.0, lon = 0.0, vel = 0.0, dir = 0.0, date = 0.0, ang = 0.0, ep[6];
|
||||
@ -219,7 +219,7 @@ int decode_nmearmc(char **val, int n, sol_t *sol)
|
||||
sol->stat = mode == 'D' ? SOLQ_DGPS : SOLQ_SINGLE;
|
||||
sol->ns = 0;
|
||||
|
||||
sol->type = 0; /* postion type = xyz */
|
||||
sol->type = 0; /* position type = xyz */
|
||||
|
||||
trace(5, "decode_nmearmc: %s rr=%.3f %.3f %.3f stat=%d ns=%d vel=%.2f dir=%.0f ang=%.0f mew=%c mode=%c\n",
|
||||
time_str(sol->time, 0), sol->rr[0], sol->rr[1], sol->rr[2], sol->stat, sol->ns,
|
||||
@ -310,7 +310,7 @@ int decode_nmeagga(char **val, int n, sol_t *sol)
|
||||
sol->stat = 0 <= solq && solq <= 8 ? solq_nmea[solq] : SOLQ_NONE;
|
||||
sol->ns = nrcv;
|
||||
|
||||
sol->type = 0; /* postion type = xyz */
|
||||
sol->type = 0; /* position type = xyz */
|
||||
|
||||
trace(5, "decode_nmeagga: %s rr=%.3f %.3f %.3f stat=%d ns=%d hdop=%.1f ua=%c um=%c\n",
|
||||
time_str(sol->time, 0), sol->rr[0], sol->rr[1], sol->rr[2], sol->stat, sol->ns,
|
||||
@ -453,7 +453,7 @@ int decode_solxyz(char *buff, const solopt_t *opt, sol_t *sol)
|
||||
if (i < n) sol->age = (float)val[i++];
|
||||
if (i < n) sol->ratio = (float)val[i];
|
||||
|
||||
sol->type = 0; /* postion type = xyz */
|
||||
sol->type = 0; /* position type = xyz */
|
||||
|
||||
if (MAXSOLQ < sol->stat) sol->stat = SOLQ_NONE;
|
||||
return 1;
|
||||
@ -512,7 +512,7 @@ int decode_solllh(char *buff, const solopt_t *opt, sol_t *sol)
|
||||
if (i < n) sol->age = (float)val[i++];
|
||||
if (i < n) sol->ratio = (float)val[i];
|
||||
|
||||
sol->type = 0; /* postion type = xyz */
|
||||
sol->type = 0; /* position type = xyz */
|
||||
|
||||
if (MAXSOLQ < sol->stat) sol->stat = SOLQ_NONE;
|
||||
return 1;
|
||||
@ -558,7 +558,7 @@ int decode_solenu(char *buff, const solopt_t *opt, sol_t *sol)
|
||||
if (i < n) sol->age = (float)val[i++];
|
||||
if (i < n) sol->ratio = (float)val[i];
|
||||
|
||||
sol->type = 1; /* postion type = enu */
|
||||
sol->type = 1; /* position type = enu */
|
||||
|
||||
if (MAXSOLQ < sol->stat) sol->stat = SOLQ_NONE;
|
||||
return 1;
|
||||
@ -1798,7 +1798,7 @@ int outsols(unsigned char *buff, const sol_t *sol, const double *rb,
|
||||
|
||||
|
||||
/* output solution extended ----------------------------------------------------
|
||||
* output solution exteneded infomation
|
||||
* output solution exteneded information
|
||||
* args : unsigned char *buff IO output buffer
|
||||
* sol_t *sol I solution
|
||||
* ssat_t *ssat I satellite status
|
||||
@ -1892,7 +1892,7 @@ void outsol(FILE *fp, const sol_t *sol, const double *rb,
|
||||
|
||||
|
||||
/* output solution extended ----------------------------------------------------
|
||||
* output solution exteneded infomation to file
|
||||
* output solution exteneded information to file
|
||||
* args : FILE *fp I output file pointer
|
||||
* sol_t *sol I solution
|
||||
* ssat_t *ssat I satellite status
|
||||
|
@ -1916,7 +1916,7 @@ void strunlock(stream_t *stream) { rtk_unlock(&stream->lock); }
|
||||
/* read stream -----------------------------------------------------------------
|
||||
* read data from stream (unblocked)
|
||||
* args : stream_t *stream I stream
|
||||
* unsinged char *buff O data buffer
|
||||
* unsigned char *buff O data buffer
|
||||
* int n I maximum data length
|
||||
* return : read data length
|
||||
* notes : if no data, return immediately with no data
|
||||
@ -1978,7 +1978,7 @@ int strread(stream_t *stream, unsigned char *buff, int n)
|
||||
/* write stream ----------------------------------------------------------------
|
||||
* write data to stream (unblocked)
|
||||
* args : stream_t *stream I stream
|
||||
* unsinged char *buff I data buffer
|
||||
* unsigned char *buff I data buffer
|
||||
* int n I data length
|
||||
* return : status (0:error, 1:ok)
|
||||
* notes : write data to buffer and return immediately
|
||||
|
@ -145,7 +145,7 @@ INLINE_INHERITED_MEMB = NO
|
||||
# shortest path that makes the file name unique will be used
|
||||
# The default value is: YES.
|
||||
|
||||
FULL_PATH_NAMES = YES
|
||||
FULL_PATH_NAMES = NO
|
||||
|
||||
# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path.
|
||||
# Stripping is only done if one of the specified strings matches the left-hand
|
||||
|
@ -7,8 +7,8 @@ and contact information about the original VOLK library.
|
||||
|
||||
The boilerplate of this code was initially generated with
|
||||
```volk_modtool```, an application provided by VOLK that creates the
|
||||
skeleton than can then be filled with custom kernels. Some modifications
|
||||
were added to accomodate the specificities of Global Navigation
|
||||
skeleton that can then be filled with custom kernels. Some modifications
|
||||
were added to accommodate the specificities of Global Navigation
|
||||
Satellite Systems (GNSS) signal processing. Those changes are clearly
|
||||
indicated in the source code, and do not break compatibility.
|
||||
|
||||
@ -39,7 +39,7 @@ This library is automatically built and installed along with GNSS-SDR if
|
||||
it is not found by CMake on your system at configure time.
|
||||
|
||||
However, you can install and use VOLK_GNSSSDR kernels as you use VOLK's,
|
||||
independently from GNSS-SDR.
|
||||
independently of GNSS-SDR.
|
||||
|
||||
First, make sure that the required dependencies are installed in your
|
||||
machine:
|
||||
|
@ -16,8 +16,8 @@
|
||||
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef VOLK_VOLK_OPTION_HELPERS_H
|
||||
#define VOLK_VOLK_OPTION_HELPERS_H
|
||||
#ifndef VOLK_GNSSSDR_OPTION_HELPERS_H
|
||||
#define VOLK_GNSSSDR_OPTION_HELPERS_H
|
||||
|
||||
#include <climits>
|
||||
#include <cstring>
|
||||
@ -71,4 +71,4 @@ private:
|
||||
};
|
||||
|
||||
|
||||
#endif //VOLK_VOLK_OPTION_HELPERS_H
|
||||
#endif //VOLK_GNSSSDR_OPTION_HELPERS_H
|
||||
|
@ -148,7 +148,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
catch (std::string &error)
|
||||
{
|
||||
std::cerr << "Caught Exception in 'run_volk_gnssdr_tests': " << error << std::endl;
|
||||
std::cerr << "Caught Exception in 'run_volk_gnsssdr_tests': " << error << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -32,7 +32,7 @@
|
||||
#include <string> // for string
|
||||
#include <vector> // for vector
|
||||
|
||||
class volk_test_results_t;
|
||||
class volk_gnsssdr_test_results_t;
|
||||
|
||||
|
||||
void read_results(std::vector<volk_gnsssdr_test_results_t> *results);
|
||||
|
@ -22,24 +22,40 @@ if(DEFINED __INCLUDED_VOLK_ADD_TEST)
|
||||
endif()
|
||||
set(__INCLUDED_VOLK_ADD_TEST TRUE)
|
||||
|
||||
########################################################################
|
||||
# Generate a test executable which can be used in ADD_TEST to call
|
||||
# various subtests.
|
||||
#
|
||||
# SOURCES - sources for the test
|
||||
# TARGET_DEPS - build target dependencies (e.g., libraries)
|
||||
########################################################################
|
||||
|
||||
function(VOLK_GEN_TEST executable_name)
|
||||
include(CMakeParseArgumentsCopy)
|
||||
CMAKE_PARSE_ARGUMENTS(VOLK_TEST "" "" "SOURCES;TARGET_DEPS;EXTRA_LIB_DIRS;ENVIRONS;ARGS" ${ARGN})
|
||||
add_executable(${executable_name} ${VOLK_TEST_SOURCES})
|
||||
target_link_libraries(${executable_name} ${VOLK_TEST_TARGET_DEPS})
|
||||
endfunction()
|
||||
|
||||
########################################################################
|
||||
# Add a unit test and setup the environment for it.
|
||||
# Encloses ADD_TEST, with additional functionality to create a shell
|
||||
# script that sets the environment to gain access to in-build binaries
|
||||
# properly. The following variables are used to pass in settings:
|
||||
# A test executable has to be generated with VOLK_GEN_TEST beforehand.
|
||||
# The executable name has to be passed as argument.
|
||||
#
|
||||
# NAME - the test name
|
||||
# SOURCES - sources for the test
|
||||
# TARGET_DEPS - build target dependencies (e.g., libraries)
|
||||
# EXTRA_LIB_DIRS - other directories for the library path
|
||||
# ENVIRONS - other environment key/value pairs
|
||||
# ARGS - arguments for the test
|
||||
########################################################################
|
||||
function(VOLK_ADD_TEST test_name)
|
||||
function(VOLK_ADD_TEST test_name executable_name)
|
||||
|
||||
#parse the arguments for component names
|
||||
include(CMakeParseArgumentsCopy)
|
||||
CMAKE_PARSE_ARGUMENTS(VOLK_TEST "" "" "SOURCES;TARGET_DEPS;EXTRA_LIB_DIRS;ENVIRONS;ARGS" ${ARGN})
|
||||
CMAKE_PARSE_ARGUMENTS(VOLK_TEST "" "" "TARGET_DEPS;EXTRA_LIB_DIRS;ENVIRONS;ARGS" ${ARGN})
|
||||
|
||||
#set the initial environs to use
|
||||
set(environs ${VOLK_TEST_ENVIRONS})
|
||||
@ -65,7 +81,7 @@ function(VOLK_ADD_TEST test_name)
|
||||
#"add_test" command, via the $<FOO:BAR> operator; make sure the
|
||||
#test's directory is first, since it ($1) is prepended to PATH.
|
||||
unset(TARGET_DIR_LIST)
|
||||
foreach(target ${test_name} ${VOLK_TEST_TARGET_DEPS})
|
||||
foreach(target ${executable_name} ${VOLK_TEST_TARGET_DEPS})
|
||||
list(APPEND TARGET_DIR_LIST "\$<TARGET_FILE_DIR:${target}>")
|
||||
endforeach()
|
||||
|
||||
@ -134,18 +150,17 @@ function(VOLK_ADD_TEST test_name)
|
||||
file(APPEND ${sh_file} "export ${environ}\n")
|
||||
endforeach(environ)
|
||||
|
||||
set(VOLK_TEST_ARGS "${test_name}")
|
||||
|
||||
#redo the test args to have a space between each
|
||||
string(REPLACE ";" " " VOLK_TEST_ARGS "${VOLK_TEST_ARGS}")
|
||||
|
||||
#finally: append the test name to execute
|
||||
file(APPEND ${sh_file} ${test_name} " " ${VOLK_TEST_ARGS} "\n")
|
||||
file(APPEND ${sh_file} "${CMAKE_CROSSCOMPILING_EMULATOR} ${executable_name} ${VOLK_TEST_ARGS}\n")
|
||||
|
||||
#make the shell file executable
|
||||
execute_process(COMMAND chmod +x ${sh_file})
|
||||
|
||||
add_executable(${test_name} ${VOLK_TEST_SOURCES})
|
||||
target_link_libraries(${test_name} ${VOLK_TEST_TARGET_DEPS})
|
||||
|
||||
#add the shell file as the test to execute;
|
||||
#use the form that allows for $<FOO:BAR> substitutions,
|
||||
#then combine the script arguments inside the script.
|
||||
@ -196,10 +211,8 @@ function(VOLK_ADD_TEST test_name)
|
||||
file(APPEND ${bat_file} ${test_name} " " ${VOLK_TEST_ARGS} "\n")
|
||||
file(APPEND ${bat_file} "\n")
|
||||
|
||||
add_executable(${test_name} ${VOLK_TEST_SOURCES})
|
||||
target_link_libraries(${test_name} ${VOLK_TEST_TARGET_DEPS})
|
||||
|
||||
add_test(${test_name} ${bat_file})
|
||||
endif(WIN32)
|
||||
|
||||
endfunction(VOLK_ADD_TEST)
|
||||
|
||||
|
@ -187,7 +187,7 @@ static inline void volk_gnsssdr_16ic_x2_dot_prod_16ic_u_sse2(lv_16sc_t* out, con
|
||||
for (number = 0; number < sse_iters; number++)
|
||||
{
|
||||
//std::complex<T> memory structure: real part -> reinterpret_cast<cv T*>(a)[2*i]
|
||||
//imaginery part -> reinterpret_cast<cv T*>(a)[2*i + 1]
|
||||
//imaginary part -> reinterpret_cast<cv T*>(a)[2*i + 1]
|
||||
// a[127:0]=[a3.i,a3.r,a2.i,a2.r,a1.i,a1.r,a0.i,a0.r]
|
||||
a = _mm_loadu_si128((__m128i*)_in_a); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg
|
||||
__VOLK_GNSSSDR_PREFETCH(_in_a + 8);
|
||||
|
@ -94,7 +94,7 @@ static inline void volk_gnsssdr_16ic_x2_multiply_16ic_a_sse2(lv_16sc_t* out, con
|
||||
for (number = 0; number < sse_iters; number++)
|
||||
{
|
||||
//std::complex<T> memory structure: real part -> reinterpret_cast<cv T*>(a)[2*i]
|
||||
//imaginery part -> reinterpret_cast<cv T*>(a)[2*i + 1]
|
||||
//imaginary part -> reinterpret_cast<cv T*>(a)[2*i + 1]
|
||||
// a[127:0]=[a3.i,a3.r,a2.i,a2.r,a1.i,a1.r,a0.i,a0.r]
|
||||
a = _mm_load_si128((__m128i*)_in_a); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg
|
||||
b = _mm_load_si128((__m128i*)_in_b);
|
||||
@ -148,7 +148,7 @@ static inline void volk_gnsssdr_16ic_x2_multiply_16ic_u_sse2(lv_16sc_t* out, con
|
||||
for (number = 0; number < sse_iters; number++)
|
||||
{
|
||||
//std::complex<T> memory structure: real part -> reinterpret_cast<cv T*>(a)[2*i]
|
||||
//imaginery part -> reinterpret_cast<cv T*>(a)[2*i + 1]
|
||||
//imaginary part -> reinterpret_cast<cv T*>(a)[2*i + 1]
|
||||
// a[127:0]=[a3.i,a3.r,a2.i,a2.r,a1.i,a1.r,a0.i,a0.r]
|
||||
a = _mm_loadu_si128((__m128i*)_in_a); //load (2 byte imag, 2 byte real) x 4 into 128 bits reg
|
||||
b = _mm_loadu_si128((__m128i*)_in_b);
|
||||
|
@ -6,7 +6,7 @@
|
||||
* </ul>
|
||||
*
|
||||
* VOLK_GNSSSDR kernel that esamples N 16 bits integer short complex vectors using zero hold resample algorithm.
|
||||
* It is optimized to resample a sigle GNSS local code signal replica into N vectors fractional-resampled and fractional-delayed
|
||||
* It is optimized to resample a single GNSS local code signal replica into N vectors fractional-resampled and fractional-delayed
|
||||
* (i.e. it creates the Early, Prompt, and Late code replicas)
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
@ -145,7 +145,7 @@ static inline void volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn_a_sse2(lv_16sc_t*
|
||||
//common to all outputs
|
||||
_code_phase_out = _mm_mul_ps(_code_phase_step_chips, _4output_index); //compute the code phase point with the phase step
|
||||
|
||||
//output vector dependant (different code phase offset)
|
||||
//output vector dependent (different code phase offset)
|
||||
for (current_vector = 0; current_vector < num_out_vectors; current_vector++)
|
||||
{
|
||||
tmp_rem_code_phase_chips = rem_code_phase_chips[current_vector] - 0.5f; // adjust offset to perform correct rounding (chip transition at 0)
|
||||
@ -241,7 +241,7 @@ static inline void volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn_u_sse2(lv_16sc_t*
|
||||
//common to all outputs
|
||||
_code_phase_out = _mm_mul_ps(_code_phase_step_chips, _4output_index); //compute the code phase point with the phase step
|
||||
|
||||
//output vector dependant (different code phase offset)
|
||||
//output vector dependent (different code phase offset)
|
||||
for (current_vector = 0; current_vector < num_out_vectors; current_vector++)
|
||||
{
|
||||
tmp_rem_code_phase_chips = rem_code_phase_chips[current_vector] - 0.5f; // adjust offset to perform correct rounding (chip transition at 0)
|
||||
@ -339,7 +339,7 @@ static inline void volk_gnsssdr_16ic_xn_resampler_fast_16ic_xn_neon(lv_16sc_t**
|
||||
//common to all outputs
|
||||
_code_phase_out = vmulq_f32(_code_phase_step_chips, _4output_index); //compute the code phase point with the phase step
|
||||
|
||||
//output vector dependant (different code phase offset)
|
||||
//output vector dependent (different code phase offset)
|
||||
for (current_vector = 0; current_vector < num_out_vectors; current_vector++)
|
||||
{
|
||||
tmp_rem_code_phase_chips = rem_code_phase_chips[current_vector] - 0.5f; // adjust offset to perform correct rounding (chip transition at 0)
|
||||
|
@ -345,7 +345,7 @@ macro(gen_template tmpl output)
|
||||
)
|
||||
endmacro(gen_template)
|
||||
|
||||
make_directory(${PROJECT_BINARY_DIR}/include/volk_gnsssdr)
|
||||
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/include/volk_gnsssdr)
|
||||
|
||||
gen_template(${PROJECT_SOURCE_DIR}/tmpl/volk_gnsssdr.tmpl.h ${PROJECT_BINARY_DIR}/include/volk_gnsssdr/volk_gnsssdr.h)
|
||||
gen_template(${PROJECT_SOURCE_DIR}/tmpl/volk_gnsssdr.tmpl.c ${PROJECT_BINARY_DIR}/lib/volk_gnsssdr.c)
|
||||
@ -604,18 +604,24 @@ if(ENABLE_TESTING)
|
||||
|
||||
#include Boost headers
|
||||
include_directories(${Boost_INCLUDE_DIRS})
|
||||
link_directories(${Boost_LIBRARY_DIRS})
|
||||
make_directory(${CMAKE_CURRENT_BINARY_DIR}/.unittest)
|
||||
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/.unittest)
|
||||
set_source_files_properties(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/testqa.cc PROPERTIES
|
||||
COMPILE_DEFINITIONS "BOOST_TEST_DYN_LINK;BOOST_TEST_MAIN"
|
||||
)
|
||||
|
||||
include(VolkAddTest)
|
||||
VOLK_ADD_TEST(test_all
|
||||
VOLK_GEN_TEST("volk_gnsssdr_test_all"
|
||||
SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/testqa.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/qa_utils.cc
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/qa_utils.cc
|
||||
TARGET_DEPS volk_gnsssdr
|
||||
)
|
||||
)
|
||||
foreach(kernel ${h_files})
|
||||
get_filename_component(kernel ${kernel} NAME)
|
||||
string(REPLACE ".h" "" kernel ${kernel})
|
||||
if(NOT ${kernel} MATCHES puppet*)
|
||||
VOLK_ADD_TEST(${kernel} "volk_gnsssdr_test_all")
|
||||
endif(NOT ${kernel} MATCHES puppet*)
|
||||
endforeach()
|
||||
|
||||
endif(ENABLE_TESTING)
|
||||
|
@ -16,14 +16,10 @@
|
||||
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "volk_gnsssdr/volk_gnsssdr.h" // for volk_gnsssdr_func_desc_t
|
||||
#include "qa_utils.h"
|
||||
#include "volk_gnsssdr/volk_gnsssdr.h" // for volk_gnsssdr_func_desc_t
|
||||
#include "volk_gnsssdr/volk_gnsssdr_malloc.h" // for volk_gnsssdr_free, volk_gnsssdr_malloc
|
||||
#include <boost/foreach.hpp> // for auto_any_base
|
||||
#include <boost/lexical_cast.hpp> // for lexical_cast
|
||||
#include <boost/token_functions.hpp> // for char_separator
|
||||
#include <boost/token_iterator.hpp> // for token_iterator
|
||||
#include <boost/tokenizer.hpp> // for tokenizer
|
||||
|
||||
#include <volk_gnsssdr/volk_gnsssdr_malloc.h> // for volk_gnsssdr_free, volk_gnsssdr_malloc
|
||||
#include <cassert> // for assert
|
||||
#include <chrono> // for system_clock, duration,...
|
||||
#include <cmath> // for sqrt, fabs, abs
|
||||
@ -122,6 +118,24 @@ static std::vector<std::string> get_arch_list(volk_gnsssdr_func_desc_t desc)
|
||||
return archlist;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T volk_lexical_cast(const std::string &str)
|
||||
{
|
||||
for (unsigned int c_index = 0; c_index < str.size(); ++c_index)
|
||||
{
|
||||
if (str.at(c_index) < '0' || str.at(c_index) > '9')
|
||||
{
|
||||
throw "not all numbers!";
|
||||
}
|
||||
}
|
||||
T var;
|
||||
std::istringstream iss;
|
||||
iss.str(str);
|
||||
iss >> var;
|
||||
// deal with any error bits that may have been set on the stream
|
||||
return var;
|
||||
}
|
||||
|
||||
volk_gnsssdr_type_t volk_gnsssdr_type_from_string(std::string name)
|
||||
{
|
||||
volk_gnsssdr_type_t type;
|
||||
@ -151,7 +165,7 @@ volk_gnsssdr_type_t volk_gnsssdr_type_from_string(std::string name)
|
||||
throw std::string("no size spec in type ").append(name);
|
||||
}
|
||||
//will throw if malformed
|
||||
int size = boost::lexical_cast<int>(name.substr(0, last_size_pos + 1));
|
||||
int size = volk_lexical_cast<int>(name.substr(0, last_size_pos + 1));
|
||||
|
||||
assert(((size % 8) == 0) && (size <= 64) && (size != 0));
|
||||
type.size = size / 8; //in bytes
|
||||
@ -180,21 +194,42 @@ volk_gnsssdr_type_t volk_gnsssdr_type_from_string(std::string name)
|
||||
return type;
|
||||
}
|
||||
|
||||
std::vector<std::string> split_signature(const std::string &protokernel_signature)
|
||||
{
|
||||
std::vector<std::string> signature_tokens;
|
||||
std::string token;
|
||||
for (unsigned int loc = 0; loc < protokernel_signature.size(); ++loc)
|
||||
{
|
||||
if (protokernel_signature.at(loc) == '_')
|
||||
{
|
||||
if (protokernel_signature.substr(loc + 1, 7).compare("gnsssdr") == 0) // jump the "gnsssdr" part of "volk_gnsssdr"
|
||||
{
|
||||
loc += 7;
|
||||
}
|
||||
else
|
||||
{
|
||||
// this is a break
|
||||
signature_tokens.push_back(token);
|
||||
token = "";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
token.push_back(protokernel_signature.at(loc));
|
||||
}
|
||||
}
|
||||
// Get the last one to the end of the string
|
||||
signature_tokens.push_back(token);
|
||||
return signature_tokens;
|
||||
}
|
||||
|
||||
static void get_signatures_from_name(std::vector<volk_gnsssdr_type_t> &inputsig,
|
||||
std::vector<volk_gnsssdr_type_t> &outputsig,
|
||||
std::string name)
|
||||
{
|
||||
boost::char_separator<char> sep("_");
|
||||
boost::tokenizer<boost::char_separator<char> > tok(name, sep);
|
||||
std::vector<std::string> toked;
|
||||
tok.assign(name);
|
||||
toked.assign(tok.begin(), tok.end());
|
||||
std::vector<std::string> toked = split_signature(name);
|
||||
assert(toked[0] == "volk");
|
||||
toked.erase(toked.begin());
|
||||
toked.erase(toked.begin());
|
||||
|
||||
//ok. we're assuming a string in the form
|
||||
//(sig)_(multiplier-opt)_..._(name)_(sig)_(multiplier-opt)_..._(alignment)
|
||||
|
||||
enum
|
||||
{
|
||||
@ -204,8 +239,9 @@ static void get_signatures_from_name(std::vector<volk_gnsssdr_type_t> &inputsig,
|
||||
} side = SIDE_INPUT;
|
||||
std::string fn_name;
|
||||
volk_gnsssdr_type_t type;
|
||||
BOOST_FOREACH (std::string token, toked)
|
||||
for (unsigned int token_index = 0; token_index < toked.size(); ++token_index)
|
||||
{
|
||||
std::string token = toked[token_index];
|
||||
try
|
||||
{
|
||||
type = volk_gnsssdr_type_from_string(token);
|
||||
@ -224,7 +260,7 @@ static void get_signatures_from_name(std::vector<volk_gnsssdr_type_t> &inputsig,
|
||||
assert(inputsig.size() > 0);
|
||||
else
|
||||
assert(outputsig.size() > 0);
|
||||
int multiplier = boost::lexical_cast<int>(token.substr(1, token.size() - 1)); //will throw if invalid ///////////
|
||||
int multiplier = volk_lexical_cast<int>(token.substr(1, token.size() - 1)); // will throw if invalid
|
||||
for (int i = 1; i < multiplier; i++)
|
||||
{
|
||||
if (side == SIDE_INPUT)
|
||||
@ -523,7 +559,7 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc,
|
||||
{
|
||||
get_signatures_from_name(inputsig, outputsig, name);
|
||||
}
|
||||
catch (boost::bad_lexical_cast &error)
|
||||
catch (std::exception &error)
|
||||
{
|
||||
std::cerr << "Error: unable to get function signature from kernel name" << std::endl;
|
||||
std::cerr << " - " << name << std::endl;
|
||||
@ -542,8 +578,9 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc,
|
||||
}
|
||||
}
|
||||
std::vector<void *> inbuffs;
|
||||
BOOST_FOREACH (volk_gnsssdr_type_t sig, inputsig)
|
||||
for (unsigned int inputsig_index = 0; inputsig_index < inputsig.size(); ++inputsig_index)
|
||||
{
|
||||
volk_gnsssdr_type_t sig = inputsig[inputsig_index];
|
||||
if (!sig.is_scalar) //we don't make buffers for scalars
|
||||
inbuffs.push_back(mem_pool.get_new(vlen * sig.size * (sig.is_complex ? 2 : 1)));
|
||||
}
|
||||
@ -703,6 +740,9 @@ bool run_volk_gnsssdr_tests(volk_gnsssdr_func_desc_t desc,
|
||||
else
|
||||
throw "unsupported 3 arg function >1 scalars";
|
||||
break;
|
||||
case 4:
|
||||
run_cast_test4((volk_gnsssdr_fn_4arg)(manual_func), test_data[i], vlen, iter, arch_list[i]);
|
||||
break;
|
||||
default:
|
||||
throw "no function handler for this signature";
|
||||
break;
|
||||
|
@ -31,7 +31,7 @@
|
||||
|
||||
void print_qa_xml(std::vector<volk_gnsssdr_test_results_t> results, unsigned int nfails);
|
||||
|
||||
int main()
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
bool qa_ret_val = 0;
|
||||
|
||||
@ -45,47 +45,78 @@ int main()
|
||||
volk_gnsssdr_test_params_t test_params(def_tol, def_scalar, def_vlen, def_iter,
|
||||
def_benchmark_mode, def_kernel_regex);
|
||||
std::vector<volk_gnsssdr_test_case_t> test_cases = init_test_list(test_params);
|
||||
|
||||
std::vector<std::string> qa_failures;
|
||||
std::vector<volk_gnsssdr_test_results_t> results;
|
||||
// Test every kernel reporting failures when they occur
|
||||
for (unsigned int ii = 0; ii < test_cases.size(); ++ii)
|
||||
if (argc > 1)
|
||||
{
|
||||
bool qa_result = false;
|
||||
volk_gnsssdr_test_case_t test_case = test_cases[ii];
|
||||
try
|
||||
const size_t len = std::char_traits<char>::length(argv[1]);
|
||||
if (len == 0 || len > 2046)
|
||||
{
|
||||
qa_result = run_volk_gnsssdr_tests(test_case.desc(), test_case.kernel_ptr(), test_case.name(),
|
||||
test_case.test_parameters(), &results, test_case.puppet_master_name());
|
||||
std::cerr << "Test name is too long." << std::endl;
|
||||
return 0;
|
||||
}
|
||||
catch (...)
|
||||
for (unsigned int ii = 0; ii < test_cases.size(); ++ii)
|
||||
{
|
||||
// TODO: what exceptions might we need to catch and how do we handle them?
|
||||
std::cerr << "Exception found on kernel: " << test_case.name() << std::endl;
|
||||
qa_result = false;
|
||||
}
|
||||
|
||||
if (qa_result)
|
||||
{
|
||||
std::cerr << "Failure on " << test_case.name() << std::endl;
|
||||
qa_failures.push_back(test_case.name());
|
||||
if (std::string(argv[1]) == test_cases[ii].name())
|
||||
{
|
||||
volk_gnsssdr_test_case_t test_case = test_cases[ii];
|
||||
if (run_volk_gnsssdr_tests(test_case.desc(), test_case.kernel_ptr(),
|
||||
test_case.name(),
|
||||
test_case.test_parameters(), &results,
|
||||
test_case.puppet_master_name()))
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
std::cerr << "Did not run a test for kernel: " << std::string(argv[1]) << " !" << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Generate XML results
|
||||
print_qa_xml(results, qa_failures.size());
|
||||
|
||||
// Summarize QA results
|
||||
std::cerr << "Kernel QA finished: " << qa_failures.size() << " failures out of "
|
||||
<< test_cases.size() << " tests." << std::endl;
|
||||
if (qa_failures.size() > 0)
|
||||
else
|
||||
{
|
||||
std::cerr << "The following kernels failed QA:" << std::endl;
|
||||
for (unsigned int ii = 0; ii < qa_failures.size(); ++ii)
|
||||
std::vector<std::string> qa_failures;
|
||||
// Test every kernel reporting failures when they occur
|
||||
for (unsigned int ii = 0; ii < test_cases.size(); ++ii)
|
||||
{
|
||||
std::cerr << " " << qa_failures[ii] << std::endl;
|
||||
bool qa_result = false;
|
||||
volk_gnsssdr_test_case_t test_case = test_cases[ii];
|
||||
try
|
||||
{
|
||||
qa_result = run_volk_gnsssdr_tests(test_case.desc(), test_case.kernel_ptr(), test_case.name(),
|
||||
test_case.test_parameters(), &results, test_case.puppet_master_name());
|
||||
}
|
||||
catch (...)
|
||||
{
|
||||
// TODO: what exceptions might we need to catch and how do we handle them?
|
||||
std::cerr << "Exception found on kernel: " << test_case.name() << std::endl;
|
||||
qa_result = false;
|
||||
}
|
||||
|
||||
if (qa_result)
|
||||
{
|
||||
std::cerr << "Failure on " << test_case.name() << std::endl;
|
||||
qa_failures.push_back(test_case.name());
|
||||
}
|
||||
}
|
||||
|
||||
// Generate XML results
|
||||
print_qa_xml(results, qa_failures.size());
|
||||
|
||||
// Summarize QA results
|
||||
std::cerr << "Kernel QA finished: " << qa_failures.size() << " failures out of "
|
||||
<< test_cases.size() << " tests." << std::endl;
|
||||
if (qa_failures.size() > 0)
|
||||
{
|
||||
std::cerr << "The following kernels failed QA:" << std::endl;
|
||||
for (unsigned int ii = 0; ii < qa_failures.size(); ++ii)
|
||||
{
|
||||
std::cerr << " " << qa_failures[ii] << std::endl;
|
||||
}
|
||||
qa_ret_val = 1;
|
||||
}
|
||||
qa_ret_val = 1;
|
||||
}
|
||||
|
||||
return qa_ret_val;
|
||||
@ -128,7 +159,6 @@ void print_qa_xml(std::vector<volk_gnsssdr_test_results_t> results, unsigned int
|
||||
qa_file << " </testsuite>" << std::endl;
|
||||
}
|
||||
|
||||
|
||||
qa_file << "</testsuites>" << std::endl;
|
||||
qa_file.close();
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ typedef struct volk_gnsssdr_func_desc
|
||||
const char **impl_names;
|
||||
const int *impl_deps;
|
||||
const bool *impl_alignment;
|
||||
const size_t n_impls;
|
||||
size_t n_impls;
|
||||
} volk_gnsssdr_func_desc_t;
|
||||
|
||||
//! Prints a list of machines available
|
||||
@ -68,12 +68,12 @@ VOLK_API size_t volk_gnsssdr_get_alignment(void);
|
||||
*/
|
||||
VOLK_API bool volk_gnsssdr_is_aligned(const void *ptr);
|
||||
|
||||
// clang-format off
|
||||
%for kern in kernels:
|
||||
|
||||
//! A function pointer to the dispatcher implementation
|
||||
extern VOLK_API ${kern.pname} ${kern.name};
|
||||
|
||||
// clang-format off
|
||||
//! A function pointer to the fastest aligned implementation
|
||||
extern VOLK_API ${kern.pname} ${kern.name}_a;
|
||||
|
||||
@ -86,9 +86,7 @@ extern VOLK_API void ${kern.name}_manual(${kern.arglist_full}, const char* impl_
|
||||
//! Get description parameters for this kernel
|
||||
extern VOLK_API volk_gnsssdr_func_desc_t ${kern.name}_get_func_desc(void);
|
||||
%endfor
|
||||
// clang-format off
|
||||
|
||||
__VOLK_DECL_END
|
||||
|
||||
// clang-format on
|
||||
|
||||
#endif /*INCLUDED_VOLK_GNSSSDR_RUNTIME*/
|
||||
|
@ -32,9 +32,9 @@ include_directories(
|
||||
)
|
||||
|
||||
|
||||
if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13" )
|
||||
if(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.15" )
|
||||
add_definitions( -DGR_GREATER_38=1 )
|
||||
endif(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.13" )
|
||||
endif(${PC_GNURADIO_RUNTIME_VERSION} VERSION_GREATER "3.7.15" )
|
||||
|
||||
|
||||
file(GLOB RESAMPLER_ADAPTER_HEADERS "*.h")
|
||||
|
@ -35,7 +35,7 @@
|
||||
#include "Galileo_E1.h"
|
||||
#include "GPS_L1_CA.h"
|
||||
#include "Galileo_E5a.h"
|
||||
#include "GLONASS_L1_CA.h"
|
||||
#include "GLONASS_L1_L2_CA.h"
|
||||
#include <glog/logging.h>
|
||||
|
||||
|
||||
@ -100,7 +100,14 @@ SignalGenerator::SignalGenerator(ConfigurationInterface* configuration,
|
||||
}
|
||||
else if (std::find(system.begin(), system.end(), "R") != system.end())
|
||||
{
|
||||
vector_length = round((float)fs_in / (GLONASS_L1_CA_CODE_RATE_HZ / GLONASS_L1_CA_CODE_LENGTH_CHIPS));
|
||||
if (signal1[0].at(0) == '1')
|
||||
{
|
||||
vector_length = round((float)fs_in / (GLONASS_L1_CA_CODE_RATE_HZ / GLONASS_L1_CA_CODE_LENGTH_CHIPS));
|
||||
}
|
||||
else
|
||||
{
|
||||
vector_length = round((float)fs_in / (GLONASS_L2_CA_CODE_RATE_HZ / GLONASS_L2_CA_CODE_LENGTH_CHIPS));
|
||||
}
|
||||
}
|
||||
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
|
@ -36,11 +36,12 @@
|
||||
#include "Galileo_E1.h"
|
||||
#include "Galileo_E5a.h"
|
||||
#include "GPS_L1_CA.h"
|
||||
#include "GLONASS_L1_CA.h"
|
||||
#include "GLONASS_L1_L2_CA.h"
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <volk_gnsssdr/volk_gnsssdr.h>
|
||||
#include <fstream>
|
||||
|
||||
|
||||
/*
|
||||
* Create a new instance of signal_generator_c and return
|
||||
* a boost shared_ptr. This is effectively the public constructor.
|
||||
|
@ -32,7 +32,9 @@
|
||||
#include "fmcomms2_signal_source.h"
|
||||
#include "configuration_interface.h"
|
||||
#include "gnss_sdr_valve.h"
|
||||
#include "ad9361_manager.h"
|
||||
#include "GPS_L1_CA.h"
|
||||
#include "GPS_L2C.h"
|
||||
#include <glog/logging.h>
|
||||
#include <iostream>
|
||||
|
||||
@ -55,6 +57,7 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface* configuration
|
||||
quadrature_ = configuration->property(role + ".quadrature", true);
|
||||
rf_dc_ = configuration->property(role + ".rf_dc", true);
|
||||
bb_dc_ = configuration->property(role + ".bb_dc", true);
|
||||
RF_channels_ = configuration->property(role + ".RF_channels", 1);
|
||||
gain_mode_rx1_ = configuration->property(role + ".gain_mode_rx1", std::string("manual"));
|
||||
gain_mode_rx2_ = configuration->property(role + ".gain_mode_rx2", std::string("manual"));
|
||||
rf_gain_rx1_ = configuration->property(role + ".gain_rx1", 64.0);
|
||||
@ -67,6 +70,14 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface* configuration
|
||||
dump_ = configuration->property(role + ".dump", false);
|
||||
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_file);
|
||||
|
||||
//AD9361 Local Oscillator generation for dual band operation
|
||||
enable_dds_lo_ = configuration->property(role + ".enable_dds_lo", false);
|
||||
freq_rf_tx_hz_ = configuration->property(role + ".freq_rf_tx_hz", GPS_L1_FREQ_HZ - GPS_L2_FREQ_HZ - 1000);
|
||||
freq_dds_tx_hz_ = configuration->property(role + ".freq_dds_tx_hz", 1000);
|
||||
scale_dds_dbfs_ = configuration->property(role + ".scale_dds_dbfs", 0.0);
|
||||
phase_dds_deg_ = configuration->property(role + ".phase_dds_deg", 0.0);
|
||||
tx_attenuation_db_ = configuration->property(role + ".tx_attenuation_db", 0.0);
|
||||
|
||||
item_size_ = sizeof(gr_complex);
|
||||
|
||||
std::cout << "device address: " << uri_ << std::endl;
|
||||
@ -75,15 +86,73 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface* configuration
|
||||
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
fmcomms2_source_f32c_ = gr::iio::fmcomms2_source_f32c::make(
|
||||
uri_.c_str(), freq_, sample_rate_,
|
||||
bandwidth_,
|
||||
rx1_en_, rx2_en_,
|
||||
buffer_size_, quadrature_, rf_dc_,
|
||||
bb_dc_, gain_mode_rx1_.c_str(), rf_gain_rx1_,
|
||||
gain_mode_rx2_.c_str(), rf_gain_rx2_,
|
||||
rf_port_select_.c_str(), filter_file_.c_str(),
|
||||
filter_auto_);
|
||||
if (RF_channels_ == 1)
|
||||
{
|
||||
if (rx1_en_ and rx2_en_)
|
||||
{
|
||||
LOG(FATAL) << "Configuration error: both rx1 and rx2 are enabled but RF_channels=1 !";
|
||||
}
|
||||
else
|
||||
{
|
||||
fmcomms2_source_f32c_ = gr::iio::fmcomms2_source_f32c::make(
|
||||
uri_.c_str(), freq_, sample_rate_,
|
||||
bandwidth_,
|
||||
rx1_en_, rx2_en_,
|
||||
buffer_size_, quadrature_, rf_dc_,
|
||||
bb_dc_, gain_mode_rx1_.c_str(), rf_gain_rx1_,
|
||||
gain_mode_rx2_.c_str(), rf_gain_rx2_,
|
||||
rf_port_select_.c_str(), filter_file_.c_str(),
|
||||
filter_auto_);
|
||||
|
||||
//configure LO
|
||||
if (enable_dds_lo_ == true)
|
||||
{
|
||||
std::cout << "Enabling Local Oscillator generator in FMCOMMS2\n";
|
||||
config_ad9361_lo_remote(uri_,
|
||||
bandwidth_,
|
||||
sample_rate_,
|
||||
freq_rf_tx_hz_,
|
||||
tx_attenuation_db_,
|
||||
freq_dds_tx_hz_,
|
||||
scale_dds_dbfs_);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (RF_channels_ == 2)
|
||||
{
|
||||
if (!(rx1_en_ and rx2_en_))
|
||||
{
|
||||
LOG(FATAL) << "Configuration error: RF_channels=2 but are not enabled both receivers in FMCOMMS2 !";
|
||||
}
|
||||
else
|
||||
{
|
||||
fmcomms2_source_f32c_ = gr::iio::fmcomms2_source_f32c::make(
|
||||
uri_.c_str(), freq_, sample_rate_,
|
||||
bandwidth_,
|
||||
rx1_en_, rx2_en_,
|
||||
buffer_size_, quadrature_, rf_dc_,
|
||||
bb_dc_, gain_mode_rx1_.c_str(), rf_gain_rx1_,
|
||||
gain_mode_rx2_.c_str(), rf_gain_rx2_,
|
||||
rf_port_select_.c_str(), filter_file_.c_str(),
|
||||
filter_auto_);
|
||||
//configure LO
|
||||
if (enable_dds_lo_ == true)
|
||||
{
|
||||
std::cout << "Enabling Local Oscillator generator in FMCOMMS2\n";
|
||||
config_ad9361_lo_remote(uri_,
|
||||
bandwidth_,
|
||||
sample_rate_,
|
||||
freq_rf_tx_hz_,
|
||||
tx_attenuation_db_,
|
||||
freq_dds_tx_hz_,
|
||||
scale_dds_dbfs_);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(FATAL) << "Configuration error: Unsupported number of RF_channels !";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -108,6 +177,10 @@ Fmcomms2SignalSource::Fmcomms2SignalSource(ConfigurationInterface* configuration
|
||||
|
||||
Fmcomms2SignalSource::~Fmcomms2SignalSource()
|
||||
{
|
||||
if (enable_dds_lo_ == true)
|
||||
{
|
||||
ad9361_disable_lo_remote(uri_);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -88,6 +88,7 @@ private:
|
||||
bool quadrature_;
|
||||
bool rf_dc_;
|
||||
bool bb_dc_;
|
||||
int RF_channels_;
|
||||
std::string gain_mode_rx1_;
|
||||
std::string gain_mode_rx2_;
|
||||
double rf_gain_rx1_;
|
||||
@ -96,6 +97,14 @@ private:
|
||||
std::string filter_file_;
|
||||
bool filter_auto_;
|
||||
|
||||
//DDS configuration for LO generation for external mixer
|
||||
bool enable_dds_lo_;
|
||||
unsigned long freq_rf_tx_hz_;
|
||||
unsigned long freq_dds_tx_hz_;
|
||||
double scale_dds_dbfs_;
|
||||
double phase_dds_deg_;
|
||||
double tx_attenuation_db_;
|
||||
|
||||
unsigned int in_stream_;
|
||||
unsigned int out_stream_;
|
||||
|
||||
|
@ -55,7 +55,7 @@ RtlTcpSignalSource::RtlTcpSignalSource(ConfigurationInterface* configuration,
|
||||
dump_filename_ = configuration->property(role + ".dump_filename",
|
||||
default_dump_file);
|
||||
|
||||
// rtl_tcp PARAMTERS
|
||||
// rtl_tcp PARAMETERS
|
||||
std::string default_address = "127.0.0.1";
|
||||
short default_port = 1234;
|
||||
AGC_enabled_ = configuration->property(role + ".AGC_enabled", true);
|
||||
|
@ -121,7 +121,7 @@ unpack_2bit_samples::unpack_2bit_samples(bool big_endian_bytes,
|
||||
bool big_endian_system = systemIsBigEndian();
|
||||
|
||||
// Only swap the item bytes if the item size > 1 byte and the system
|
||||
// endianess is not the same as the item endianness:
|
||||
// endianness is not the same as the item endianness:
|
||||
swap_endian_items_ = (item_size_ > 1) &&
|
||||
(big_endian_system != big_endian_items);
|
||||
|
||||
|
@ -16,16 +16,61 @@
|
||||
# along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
if(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2)
|
||||
find_package(iio REQUIRED)
|
||||
if(NOT IIO_FOUND)
|
||||
message(STATUS "gnuradio-iio not found, its installation is required.")
|
||||
message(STATUS "Please build and install the following projects:")
|
||||
message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio")
|
||||
message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio")
|
||||
message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio")
|
||||
message(FATAL_ERROR "gnuradio-iio required for building gnss-sdr with this option enabled")
|
||||
endif(NOT IIO_FOUND)
|
||||
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${IIO_LIBRARIES})
|
||||
set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${IIO_INCLUDE_DIRS})
|
||||
|
||||
find_package(libiio REQUIRED)
|
||||
if(NOT LIBIIO_FOUND)
|
||||
message(STATUS "gnuradio-iio not found, its installation is required.")
|
||||
message(STATUS "Please build and install the following projects:")
|
||||
message(STATUS " * libiio from https://github.com/analogdevicesinc/libiio")
|
||||
message(STATUS " * libad9361-iio from https://github.com/analogdevicesinc/libad9361-iio")
|
||||
message(STATUS " * gnuradio-iio from https://github.com/analogdevicesinc/gr-iio")
|
||||
message(FATAL_ERROR "gnuradio-iio required for building gnss-sdr with this option enabled")
|
||||
endif(NOT LIBIIO_FOUND)
|
||||
set(OPT_LIBRARIES ${OPT_LIBRARIES} ${LIBIIO_LIBRARIES})
|
||||
set(OPT_DRIVER_INCLUDE_DIRS ${OPT_DRIVER_INCLUDE_DIRS} ${LIBIIO_INCLUDE_DIRS})
|
||||
|
||||
endif(ENABLE_PLUTOSDR OR ENABLE_FMCOMMS2)
|
||||
|
||||
if(ENABLE_FMCOMMS2)
|
||||
###############################################
|
||||
# FMCOMMS2 based SDR Hardware
|
||||
###############################################
|
||||
if(IIO_FOUND)
|
||||
set(OPT_SIGNAL_SOURCE_LIB_SOURCES ad9361_manager.cc)
|
||||
endif(IIO_FOUND)
|
||||
endif(ENABLE_FMCOMMS2)
|
||||
|
||||
set (SIGNAL_SOURCE_LIB_SOURCES
|
||||
rtl_tcp_commands.cc
|
||||
rtl_tcp_dongle_info.cc)
|
||||
rtl_tcp_dongle_info.cc
|
||||
${OPT_SIGNAL_SOURCE_LIB_SOURCES})
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${Boost_INCLUDE_DIRS}
|
||||
${GLOG_INCLUDE_DIRS}
|
||||
${GFlags_INCLUDE_DIRS}
|
||||
${OPT_DRIVER_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
|
||||
file(GLOB SIGNAL_SOURCE_LIB_HEADERS "*.h")
|
||||
list(SORT SIGNAL_SOURCE_LIB_HEADERS)
|
||||
list(SORT SIGNAL_SOURCE_LIB_SOURCES)
|
||||
add_library(signal_source_lib ${SIGNAL_SOURCE_LIB_SOURCES} ${SIGNAL_SOURCE_LIB_HEADERS})
|
||||
source_group(Headers FILES ${SIGNAL_SOURCE_LIB_HEADERS})
|
||||
source_group(Headers FILES ${SIGNAL_SOURCE_LIB_HEADERS})
|
||||
add_dependencies(signal_source_lib glog-${glog_RELEASE})
|
||||
target_link_libraries(signal_source_lib ${OPT_LIBRARIES})
|
||||
|
||||
|
764
src/algorithms/signal_source/libs/ad9361_manager.cc
Normal file
764
src/algorithms/signal_source/libs/ad9361_manager.cc
Normal file
@ -0,0 +1,764 @@
|
||||
/*!
|
||||
* \file ad9361_manager.cc
|
||||
* \brief An Analog Devices AD9361 front-end configuration library wrapper for configure some functions via iiod link.
|
||||
* \author Javier Arribas, jarribas(at)cttc.es
|
||||
*
|
||||
* This file contains information taken from librtlsdr:
|
||||
* http://git.osmocom.org/rtl-sdr/
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* GNSS-SDR is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNSS-SDR is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
#include "ad9361_manager.h"
|
||||
#include <glog/logging.h>
|
||||
#include <cmath>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
|
||||
/* check return value of attr_write function */
|
||||
void errchk(int v, const char *what)
|
||||
{
|
||||
if (v < 0)
|
||||
{
|
||||
LOG(WARNING) << "Error " << v << " writing to channel " << what << " value may not be supported. ";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* write attribute: long long int */
|
||||
void wr_ch_lli(struct iio_channel *chn, const char *what, long long val)
|
||||
{
|
||||
errchk(iio_channel_attr_write_longlong(chn, what, val), what);
|
||||
}
|
||||
|
||||
|
||||
/* write attribute: string */
|
||||
void wr_ch_str(struct iio_channel *chn, const char *what, const char *str)
|
||||
{
|
||||
errchk(iio_channel_attr_write(chn, what, str), what);
|
||||
}
|
||||
|
||||
|
||||
/* returns ad9361 phy device */
|
||||
struct iio_device *get_ad9361_phy(struct iio_context *ctx)
|
||||
{
|
||||
struct iio_device *dev = iio_context_find_device(ctx, "ad9361-phy");
|
||||
return dev;
|
||||
}
|
||||
|
||||
|
||||
/* finds AD9361 streaming IIO devices */
|
||||
bool get_ad9361_stream_dev(struct iio_context *ctx, enum iodev d, struct iio_device **dev)
|
||||
{
|
||||
switch (d)
|
||||
{
|
||||
case TX:
|
||||
*dev = iio_context_find_device(ctx, "cf-ad9361-dds-core-lpc");
|
||||
return *dev != NULL;
|
||||
case RX:
|
||||
*dev = iio_context_find_device(ctx, "cf-ad9361-lpc");
|
||||
return *dev != NULL;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* finds AD9361 streaming IIO channels */
|
||||
bool get_ad9361_stream_ch(struct iio_context *ctx, enum iodev d, struct iio_device *dev, int chid, struct iio_channel **chn)
|
||||
{
|
||||
std::stringstream name;
|
||||
name.str("");
|
||||
name << "voltage";
|
||||
name << chid;
|
||||
*chn = iio_device_find_channel(dev, name.str().c_str(), d == TX);
|
||||
if (!*chn)
|
||||
{
|
||||
name.str("");
|
||||
name << "altvoltage";
|
||||
name << chid;
|
||||
*chn = iio_device_find_channel(dev, name.str().c_str(), d == TX);
|
||||
}
|
||||
return *chn != NULL;
|
||||
}
|
||||
|
||||
|
||||
/* finds AD9361 phy IIO configuration channel with id chid */
|
||||
bool get_phy_chan(struct iio_context *ctx, enum iodev d, int chid, struct iio_channel **chn)
|
||||
{
|
||||
std::stringstream name;
|
||||
switch (d)
|
||||
{
|
||||
case RX:
|
||||
name.str("");
|
||||
name << "voltage";
|
||||
name << chid;
|
||||
*chn = iio_device_find_channel(get_ad9361_phy(ctx), name.str().c_str(), false);
|
||||
return *chn != NULL;
|
||||
break;
|
||||
case TX:
|
||||
name.str("");
|
||||
name << "voltage";
|
||||
name << chid;
|
||||
*chn = iio_device_find_channel(get_ad9361_phy(ctx), name.str().c_str(), true);
|
||||
return *chn != NULL;
|
||||
break;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* finds AD9361 local oscillator IIO configuration channels */
|
||||
bool get_lo_chan(struct iio_context *ctx, enum iodev d, struct iio_channel **chn)
|
||||
{
|
||||
switch (d)
|
||||
{
|
||||
// LO chan is always output, i.e. true
|
||||
case RX:
|
||||
*chn = iio_device_find_channel(get_ad9361_phy(ctx), "altvoltage0", true);
|
||||
return *chn != NULL;
|
||||
case TX:
|
||||
*chn = iio_device_find_channel(get_ad9361_phy(ctx), "altvoltage1", true);
|
||||
return *chn != NULL;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* applies streaming configuration through IIO */
|
||||
bool cfg_ad9361_streaming_ch(struct iio_context *ctx, struct stream_cfg *cfg, enum iodev type, int chid)
|
||||
{
|
||||
struct iio_channel *chn = NULL;
|
||||
|
||||
// Configure phy and lo channels
|
||||
//LOG(INFO)<<"* Acquiring AD9361 phy channel"<<chid;
|
||||
std::cout << "* Acquiring AD9361 phy channel" << chid << std::endl;
|
||||
if (!get_phy_chan(ctx, type, chid, &chn))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
wr_ch_str(chn, "rf_port_select", cfg->rfport);
|
||||
wr_ch_lli(chn, "rf_bandwidth", cfg->bw_hz);
|
||||
wr_ch_lli(chn, "sampling_frequency", cfg->fs_hz);
|
||||
|
||||
// Configure LO channel
|
||||
//LOG(INFO)<<"* Acquiring AD9361 "<<type == TX ? "TX" : "RX";
|
||||
std::cout << "* Acquiring AD9361 " << (type == TX ? "TX" : "RX") << std::endl;
|
||||
if (!get_lo_chan(ctx, type, &chn))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
wr_ch_lli(chn, "frequency", cfg->lo_hz);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool config_ad9361_rx_local(unsigned long bandwidth_,
|
||||
unsigned long sample_rate_,
|
||||
unsigned long freq_,
|
||||
std::string rf_port_select_,
|
||||
std::string gain_mode_rx1_,
|
||||
std::string gain_mode_rx2_,
|
||||
double rf_gain_rx1_,
|
||||
double rf_gain_rx2_)
|
||||
|
||||
{
|
||||
// RX stream config
|
||||
// Stream configurations
|
||||
struct stream_cfg rxcfg;
|
||||
rxcfg.bw_hz = bandwidth_; // 2 MHz rf bandwidth
|
||||
rxcfg.fs_hz = sample_rate_; // 2.5 MS/s rx sample rate
|
||||
rxcfg.lo_hz = freq_; // 2.5 GHz rf frequency
|
||||
rxcfg.rfport = rf_port_select_.c_str(); // port A (select for rf freq.)
|
||||
|
||||
std::cout << "AD9361 Acquiring IIO LOCAL context\n";
|
||||
struct iio_context *ctx;
|
||||
// Streaming devices
|
||||
struct iio_device *rx;
|
||||
struct iio_channel *rx0_i;
|
||||
struct iio_channel *rx0_q;
|
||||
|
||||
ctx = iio_create_default_context();
|
||||
if (!ctx)
|
||||
{
|
||||
std::cout << "No context\n";
|
||||
throw std::runtime_error("AD9361 IIO No context");
|
||||
}
|
||||
|
||||
if (iio_context_get_devices_count(ctx) <= 0)
|
||||
{
|
||||
std::cout << "No devices\n";
|
||||
throw std::runtime_error("AD9361 IIO No devices");
|
||||
}
|
||||
|
||||
std::cout << "* Acquiring AD9361 streaming devices\n";
|
||||
|
||||
if (!get_ad9361_stream_dev(ctx, RX, &rx))
|
||||
{
|
||||
std::cout << "No rx dev found\n";
|
||||
throw std::runtime_error("AD9361 IIO No rx dev found");
|
||||
};
|
||||
|
||||
std::cout << "* Configuring AD9361 for streaming\n";
|
||||
if (!cfg_ad9361_streaming_ch(ctx, &rxcfg, RX, 0))
|
||||
{
|
||||
std::cout << "RX port 0 not found\n";
|
||||
throw std::runtime_error("AD9361 IIO RX port 0 not found");
|
||||
}
|
||||
|
||||
std::cout << "* Initializing AD9361 IIO streaming channels\n";
|
||||
if (!get_ad9361_stream_ch(ctx, RX, rx, 0, &rx0_i))
|
||||
{
|
||||
std::cout << "RX chan i not found\n";
|
||||
throw std::runtime_error("RX chan i not found");
|
||||
}
|
||||
|
||||
if (!get_ad9361_stream_ch(ctx, RX, rx, 1, &rx0_q))
|
||||
{
|
||||
std::cout << "RX chan q not found\n";
|
||||
throw std::runtime_error("RX chan q not found");
|
||||
}
|
||||
|
||||
std::cout << "* Enabling IIO streaming channels\n";
|
||||
iio_channel_enable(rx0_i);
|
||||
iio_channel_enable(rx0_q);
|
||||
|
||||
struct iio_device *ad9361_phy;
|
||||
ad9361_phy = iio_context_find_device(ctx, "ad9361-phy");
|
||||
int ret;
|
||||
ret = iio_device_attr_write(ad9361_phy, "trx_rate_governor", "nominal");
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set trx_rate_governor: " << ret << std::endl;
|
||||
}
|
||||
ret = iio_device_attr_write(ad9361_phy, "ensm_mode", "fdd");
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set ensm_mode: " << ret << std::endl;
|
||||
}
|
||||
ret = iio_device_attr_write(ad9361_phy, "calib_mode", "auto");
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set calib_mode: " << ret << std::endl;
|
||||
}
|
||||
ret = iio_device_attr_write(ad9361_phy, "in_voltage0_gain_control_mode", gain_mode_rx1_.c_str());
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set in_voltage0_gain_control_mode: " << ret << std::endl;
|
||||
}
|
||||
ret = iio_device_attr_write(ad9361_phy, "in_voltage1_gain_control_mode", gain_mode_rx2_.c_str());
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set in_voltage1_gain_control_mode: " << ret << std::endl;
|
||||
}
|
||||
ret = iio_device_attr_write_double(ad9361_phy, "in_voltage0_hardwaregain", rf_gain_rx1_);
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set in_voltage0_hardwaregain: " << ret << std::endl;
|
||||
}
|
||||
ret = iio_device_attr_write_double(ad9361_phy, "in_voltage1_hardwaregain", rf_gain_rx2_);
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set in_voltage1_hardwaregain: " << ret << std::endl;
|
||||
}
|
||||
|
||||
std::cout << "End of AD9361 RX configuration.\n";
|
||||
iio_context_destroy(ctx);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool config_ad9361_rx_remote(std::string remote_host,
|
||||
unsigned long bandwidth_,
|
||||
unsigned long sample_rate_,
|
||||
unsigned long freq_,
|
||||
std::string rf_port_select_,
|
||||
std::string gain_mode_rx1_,
|
||||
std::string gain_mode_rx2_,
|
||||
double rf_gain_rx1_,
|
||||
double rf_gain_rx2_)
|
||||
{
|
||||
// RX stream config
|
||||
// Stream configurations
|
||||
struct stream_cfg rxcfg;
|
||||
rxcfg.bw_hz = bandwidth_; // 2 MHz rf bandwidth
|
||||
rxcfg.fs_hz = sample_rate_; // 2.5 MS/s rx sample rate
|
||||
rxcfg.lo_hz = freq_; // 2.5 GHz rf frequency
|
||||
rxcfg.rfport = rf_port_select_.c_str(); // port A (select for rf freq.)
|
||||
|
||||
std::cout << "AD9361 Acquiring IIO REMOTE context in host " << remote_host << std::endl;
|
||||
struct iio_context *ctx;
|
||||
// Streaming devices
|
||||
struct iio_device *rx;
|
||||
struct iio_channel *rx0_i;
|
||||
struct iio_channel *rx0_q;
|
||||
|
||||
ctx = iio_create_network_context(remote_host.c_str());
|
||||
if (!ctx)
|
||||
{
|
||||
std::cout << "No context\n";
|
||||
throw std::runtime_error("AD9361 IIO No context");
|
||||
}
|
||||
|
||||
if (iio_context_get_devices_count(ctx) <= 0)
|
||||
{
|
||||
std::cout << "No devices\n";
|
||||
throw std::runtime_error("AD9361 IIO No devices");
|
||||
}
|
||||
|
||||
std::cout << "* Acquiring AD9361 streaming devices\n";
|
||||
|
||||
if (!get_ad9361_stream_dev(ctx, RX, &rx))
|
||||
{
|
||||
std::cout << "No rx dev found\n";
|
||||
throw std::runtime_error("AD9361 IIO No rx dev found");
|
||||
};
|
||||
|
||||
std::cout << "* Configuring AD9361 for streaming\n";
|
||||
if (!cfg_ad9361_streaming_ch(ctx, &rxcfg, RX, 0))
|
||||
{
|
||||
std::cout << "RX port 0 not found\n";
|
||||
throw std::runtime_error("AD9361 IIO RX port 0 not found");
|
||||
}
|
||||
|
||||
std::cout << "* Initializing AD9361 IIO streaming channels\n";
|
||||
if (!get_ad9361_stream_ch(ctx, RX, rx, 0, &rx0_i))
|
||||
{
|
||||
std::cout << "RX chan i not found\n";
|
||||
throw std::runtime_error("RX chan i not found");
|
||||
}
|
||||
|
||||
if (!get_ad9361_stream_ch(ctx, RX, rx, 1, &rx0_q))
|
||||
{
|
||||
std::cout << "RX chan q not found\n";
|
||||
throw std::runtime_error("RX chan q not found");
|
||||
}
|
||||
|
||||
std::cout << "* Enabling IIO streaming channels\n";
|
||||
iio_channel_enable(rx0_i);
|
||||
iio_channel_enable(rx0_q);
|
||||
|
||||
struct iio_device *ad9361_phy;
|
||||
ad9361_phy = iio_context_find_device(ctx, "ad9361-phy");
|
||||
int ret;
|
||||
ret = iio_device_attr_write(ad9361_phy, "trx_rate_governor", "nominal");
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set trx_rate_governor: " << ret << std::endl;
|
||||
}
|
||||
ret = iio_device_attr_write(ad9361_phy, "ensm_mode", "fdd");
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set ensm_mode: " << ret << std::endl;
|
||||
}
|
||||
ret = iio_device_attr_write(ad9361_phy, "calib_mode", "auto");
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set calib_mode: " << ret << std::endl;
|
||||
}
|
||||
ret = iio_device_attr_write(ad9361_phy, "in_voltage0_gain_control_mode", gain_mode_rx1_.c_str());
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set in_voltage0_gain_control_mode: " << ret << std::endl;
|
||||
}
|
||||
ret = iio_device_attr_write(ad9361_phy, "in_voltage1_gain_control_mode", gain_mode_rx2_.c_str());
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set in_voltage1_gain_control_mode: " << ret << std::endl;
|
||||
}
|
||||
ret = iio_device_attr_write_double(ad9361_phy, "in_voltage0_hardwaregain", rf_gain_rx1_);
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set in_voltage0_hardwaregain: " << ret << std::endl;
|
||||
}
|
||||
ret = iio_device_attr_write_double(ad9361_phy, "in_voltage1_hardwaregain", rf_gain_rx2_);
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set in_voltage1_hardwaregain: " << ret << std::endl;
|
||||
}
|
||||
|
||||
std::cout << "End of AD9361 RX configuration.\n";
|
||||
|
||||
iio_context_destroy(ctx);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool config_ad9361_lo_local(unsigned long bandwidth_,
|
||||
unsigned long sample_rate_,
|
||||
unsigned long freq_rf_tx_hz_,
|
||||
double tx_attenuation_db_,
|
||||
long long freq_dds_tx_hz_,
|
||||
double scale_dds_dbfs_)
|
||||
{
|
||||
// TX stream config
|
||||
std::cout << "Start of AD9361 TX Local Oscillator DDS configuration\n";
|
||||
struct stream_cfg txcfg;
|
||||
txcfg.bw_hz = bandwidth_;
|
||||
txcfg.fs_hz = sample_rate_;
|
||||
txcfg.lo_hz = freq_rf_tx_hz_;
|
||||
txcfg.rfport = "A";
|
||||
|
||||
std::cout << "AD9361 Acquiring IIO LOCAL context\n";
|
||||
struct iio_context *ctx;
|
||||
ctx = iio_create_default_context();
|
||||
if (!ctx)
|
||||
{
|
||||
std::cout << "No context\n";
|
||||
throw std::runtime_error("AD9361 IIO No context");
|
||||
}
|
||||
|
||||
//find tx device
|
||||
struct iio_device *tx;
|
||||
|
||||
std::cout << "* Acquiring AD9361 TX streaming devices\n";
|
||||
|
||||
if (!get_ad9361_stream_dev(ctx, TX, &tx))
|
||||
{
|
||||
std::cout << "No tx dev found\n";
|
||||
throw std::runtime_error("AD9361 IIO No tx dev found");
|
||||
};
|
||||
|
||||
std::cout << "* Configuring AD9361 for streaming TX\n";
|
||||
if (!cfg_ad9361_streaming_ch(ctx, &txcfg, TX, 0))
|
||||
{
|
||||
std::cout << "TX port 0 not found\n";
|
||||
throw std::runtime_error("AD9361 IIO TX port 0 not found");
|
||||
}
|
||||
|
||||
//ENABLE DDS on TX1
|
||||
struct iio_device *ad9361_phy;
|
||||
ad9361_phy = iio_context_find_device(ctx, "ad9361-phy");
|
||||
int ret;
|
||||
//set output amplifier attenuation
|
||||
ret = iio_device_attr_write_double(ad9361_phy, "out_voltage0_hardwaregain", -tx_attenuation_db_);
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set out_voltage0_hardwaregain value " << -tx_attenuation_db_ << " error " << ret << std::endl;
|
||||
}
|
||||
|
||||
struct iio_device *dds;
|
||||
dds = iio_context_find_device(ctx, "cf-ad9361-dds-core-lpc");
|
||||
struct iio_channel *dds_channel0_I;
|
||||
dds_channel0_I = iio_device_find_channel(dds, "TX1_I_F1", true);
|
||||
|
||||
struct iio_channel *dds_channel0_Q;
|
||||
dds_channel0_Q = iio_device_find_channel(dds, "TX1_Q_F1", true);
|
||||
|
||||
ret = iio_channel_attr_write_bool(dds_channel0_I, "raw", true);
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to toggle DDS: " << ret << std::endl;
|
||||
}
|
||||
|
||||
//set frequency, scale and phase
|
||||
|
||||
ret = iio_channel_attr_write_longlong(dds_channel0_I, "frequency", (long long)freq_dds_tx_hz_);
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set TX DDS frequency I: " << ret << std::endl;
|
||||
}
|
||||
|
||||
ret = iio_channel_attr_write_longlong(dds_channel0_Q, "frequency", (long long)freq_dds_tx_hz_);
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set TX DDS frequency Q: " << ret << std::endl;
|
||||
}
|
||||
|
||||
ret = iio_channel_attr_write_double(dds_channel0_I, "phase", 0.0);
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set TX DDS phase I: " << ret << std::endl;
|
||||
}
|
||||
|
||||
ret = iio_channel_attr_write_double(dds_channel0_Q, "phase", 270000.0);
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set TX DDS phase Q: " << ret << std::endl;
|
||||
}
|
||||
|
||||
ret = iio_channel_attr_write_double(dds_channel0_I, "scale", pow(10, scale_dds_dbfs_ / 20.0));
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set TX DDS scale I: " << ret << std::endl;
|
||||
}
|
||||
|
||||
ret = iio_channel_attr_write_double(dds_channel0_Q, "scale", pow(10, scale_dds_dbfs_ / 20.0));
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set TX DDS scale Q: " << ret << std::endl;
|
||||
}
|
||||
|
||||
//disable TX2
|
||||
|
||||
ret = iio_device_attr_write_double(ad9361_phy, "out_voltage1_hardwaregain", -89.0);
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set out_voltage1_hardwaregain value " << -89.0 << " error " << ret << std::endl;
|
||||
}
|
||||
|
||||
struct iio_channel *dds_channel1_I;
|
||||
dds_channel1_I = iio_device_find_channel(dds, "TX2_I_F1", true);
|
||||
|
||||
struct iio_channel *dds_channel1_Q;
|
||||
dds_channel1_Q = iio_device_find_channel(dds, "TX2_Q_F1", true);
|
||||
|
||||
ret = iio_channel_attr_write_double(dds_channel1_I, "scale", 0);
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set TX2 DDS scale I: " << ret << std::endl;
|
||||
}
|
||||
|
||||
ret = iio_channel_attr_write_double(dds_channel1_Q, "scale", 0);
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set TX2 DDS scale Q: " << ret << std::endl;
|
||||
}
|
||||
|
||||
iio_context_destroy(ctx);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool config_ad9361_lo_remote(std::string remote_host,
|
||||
unsigned long bandwidth_,
|
||||
unsigned long sample_rate_,
|
||||
unsigned long freq_rf_tx_hz_,
|
||||
double tx_attenuation_db_,
|
||||
long long freq_dds_tx_hz_,
|
||||
double scale_dds_dbfs_)
|
||||
{
|
||||
// TX stream config
|
||||
std::cout << "Start of AD9361 TX Local Oscillator DDS configuration\n";
|
||||
struct stream_cfg txcfg;
|
||||
txcfg.bw_hz = bandwidth_;
|
||||
txcfg.fs_hz = sample_rate_;
|
||||
txcfg.lo_hz = freq_rf_tx_hz_;
|
||||
txcfg.rfport = "A";
|
||||
|
||||
std::cout << "AD9361 Acquiring IIO REMOTE context in host " << remote_host << std::endl;
|
||||
struct iio_context *ctx;
|
||||
ctx = iio_create_network_context(remote_host.c_str());
|
||||
if (!ctx)
|
||||
{
|
||||
std::cout << "No context\n";
|
||||
throw std::runtime_error("AD9361 IIO No context");
|
||||
}
|
||||
|
||||
//find tx device
|
||||
struct iio_device *tx;
|
||||
|
||||
std::cout << "* Acquiring AD9361 TX streaming devices\n";
|
||||
|
||||
if (!get_ad9361_stream_dev(ctx, TX, &tx))
|
||||
{
|
||||
std::cout << "No tx dev found\n";
|
||||
throw std::runtime_error("AD9361 IIO No tx dev found");
|
||||
};
|
||||
|
||||
std::cout << "* Configuring AD9361 for streaming TX\n";
|
||||
if (!cfg_ad9361_streaming_ch(ctx, &txcfg, TX, 0))
|
||||
{
|
||||
std::cout << "TX port 0 not found\n";
|
||||
throw std::runtime_error("AD9361 IIO TX port 0 not found");
|
||||
}
|
||||
|
||||
//ENABLE DDS on TX1
|
||||
struct iio_device *ad9361_phy;
|
||||
ad9361_phy = iio_context_find_device(ctx, "ad9361-phy");
|
||||
int ret;
|
||||
//set output amplifier attenuation
|
||||
ret = iio_device_attr_write_double(ad9361_phy, "out_voltage0_hardwaregain", -tx_attenuation_db_);
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set out_voltage0_hardwaregain value " << -tx_attenuation_db_ << " error " << ret << std::endl;
|
||||
}
|
||||
|
||||
struct iio_device *dds;
|
||||
dds = iio_context_find_device(ctx, "cf-ad9361-dds-core-lpc");
|
||||
struct iio_channel *dds_channel0_I;
|
||||
dds_channel0_I = iio_device_find_channel(dds, "TX1_I_F1", true);
|
||||
|
||||
struct iio_channel *dds_channel0_Q;
|
||||
dds_channel0_Q = iio_device_find_channel(dds, "TX1_Q_F1", true);
|
||||
|
||||
ret = iio_channel_attr_write_bool(dds_channel0_I, "raw", true);
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to toggle DDS: " << ret << std::endl;
|
||||
}
|
||||
|
||||
//set frequency, scale and phase
|
||||
|
||||
ret = iio_channel_attr_write_longlong(dds_channel0_I, "frequency", (long long)freq_dds_tx_hz_);
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set TX DDS frequency I: " << ret << std::endl;
|
||||
}
|
||||
|
||||
ret = iio_channel_attr_write_longlong(dds_channel0_Q, "frequency", (long long)freq_dds_tx_hz_);
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set TX DDS frequency Q: " << ret << std::endl;
|
||||
}
|
||||
|
||||
ret = iio_channel_attr_write_double(dds_channel0_I, "phase", 0.0);
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set TX DDS phase I: " << ret << std::endl;
|
||||
}
|
||||
|
||||
ret = iio_channel_attr_write_double(dds_channel0_Q, "phase", 270000.0);
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set TX DDS phase Q: " << ret << std::endl;
|
||||
}
|
||||
|
||||
ret = iio_channel_attr_write_double(dds_channel0_I, "scale", pow(10, scale_dds_dbfs_ / 20.0));
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set TX DDS scale I: " << ret << std::endl;
|
||||
}
|
||||
|
||||
ret = iio_channel_attr_write_double(dds_channel0_Q, "scale", pow(10, scale_dds_dbfs_ / 20.0));
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set TX DDS scale Q: " << ret << std::endl;
|
||||
}
|
||||
|
||||
//disable TX2
|
||||
|
||||
ret = iio_device_attr_write_double(ad9361_phy, "out_voltage1_hardwaregain", -89.0);
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set out_voltage1_hardwaregain value " << -89.0 << " error " << ret << std::endl;
|
||||
}
|
||||
|
||||
struct iio_channel *dds_channel1_I;
|
||||
dds_channel1_I = iio_device_find_channel(dds, "TX2_I_F1", true);
|
||||
|
||||
struct iio_channel *dds_channel1_Q;
|
||||
dds_channel1_Q = iio_device_find_channel(dds, "TX2_Q_F1", true);
|
||||
|
||||
ret = iio_channel_attr_write_double(dds_channel1_I, "scale", 0);
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set TX2 DDS scale I: " << ret << std::endl;
|
||||
}
|
||||
|
||||
ret = iio_channel_attr_write_double(dds_channel1_Q, "scale", 0);
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set TX2 DDS scale Q: " << ret << std::endl;
|
||||
}
|
||||
|
||||
iio_context_destroy(ctx);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool ad9361_disable_lo_remote(std::string remote_host)
|
||||
{
|
||||
std::cout << "AD9361 Acquiring IIO REMOTE context in host " << remote_host << std::endl;
|
||||
struct iio_context *ctx;
|
||||
ctx = iio_create_network_context(remote_host.c_str());
|
||||
if (!ctx)
|
||||
{
|
||||
std::cout << "No context\n";
|
||||
throw std::runtime_error("AD9361 IIO No context");
|
||||
}
|
||||
struct iio_device *dds;
|
||||
dds = iio_context_find_device(ctx, "cf-ad9361-dds-core-lpc");
|
||||
struct iio_channel *dds_channel0_I;
|
||||
dds_channel0_I = iio_device_find_channel(dds, "TX1_I_F1", true);
|
||||
|
||||
struct iio_channel *dds_channel0_Q;
|
||||
dds_channel0_Q = iio_device_find_channel(dds, "TX1_Q_F1", true);
|
||||
int ret;
|
||||
ret = iio_channel_attr_write_bool(dds_channel0_I, "raw", false);
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to toggle DDS: " << ret << std::endl;
|
||||
}
|
||||
|
||||
ret = iio_channel_attr_write_double(dds_channel0_I, "scale", 0.0);
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set TX DDS scale I: " << ret << std::endl;
|
||||
}
|
||||
|
||||
ret = iio_channel_attr_write_double(dds_channel0_Q, "scale", 0.0);
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set TX DDS scale Q: " << ret << std::endl;
|
||||
}
|
||||
|
||||
iio_context_destroy(ctx);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool ad9361_disable_lo_local()
|
||||
{
|
||||
std::cout << "AD9361 Acquiring IIO LOCAL context" << std::endl;
|
||||
struct iio_context *ctx;
|
||||
ctx = iio_create_default_context();
|
||||
if (!ctx)
|
||||
{
|
||||
std::cout << "No context\n";
|
||||
throw std::runtime_error("AD9361 IIO No context");
|
||||
}
|
||||
struct iio_device *dds;
|
||||
dds = iio_context_find_device(ctx, "cf-ad9361-dds-core-lpc");
|
||||
struct iio_channel *dds_channel0_I;
|
||||
dds_channel0_I = iio_device_find_channel(dds, "TX1_I_F1", true);
|
||||
|
||||
struct iio_channel *dds_channel0_Q;
|
||||
dds_channel0_Q = iio_device_find_channel(dds, "TX1_Q_F1", true);
|
||||
int ret;
|
||||
ret = iio_channel_attr_write_bool(dds_channel0_I, "raw", false);
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to toggle DDS: " << ret << std::endl;
|
||||
}
|
||||
|
||||
ret = iio_channel_attr_write_double(dds_channel0_I, "scale", 0.0);
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set TX DDS scale I: " << ret << std::endl;
|
||||
}
|
||||
|
||||
ret = iio_channel_attr_write_double(dds_channel0_Q, "scale", 0.0);
|
||||
if (ret < 0)
|
||||
{
|
||||
std::cout << "Failed to set TX DDS scale Q: " << ret << std::endl;
|
||||
}
|
||||
|
||||
iio_context_destroy(ctx);
|
||||
|
||||
return true;
|
||||
}
|
130
src/algorithms/signal_source/libs/ad9361_manager.h
Normal file
130
src/algorithms/signal_source/libs/ad9361_manager.h
Normal file
@ -0,0 +1,130 @@
|
||||
/*!
|
||||
* \file ad9361_manager.h
|
||||
* \brief An Analog Devices AD9361 front-end configuration library wrapper for configure some functions via iiod link.
|
||||
* \author Javier Arribas, jarribas(at)cttc.es
|
||||
*
|
||||
* This file contains information taken from librtlsdr:
|
||||
* http://git.osmocom.org/rtl-sdr/
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* GNSS-SDR is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNSS-SDR is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef GNSS_SDR_AD9361_MANAGER_H
|
||||
#define GNSS_SDR_AD9361_MANAGER_H
|
||||
|
||||
#include <string>
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <iio/iio.h>
|
||||
#else
|
||||
#include <iio.h>
|
||||
#endif
|
||||
|
||||
/* RX is input, TX is output */
|
||||
enum iodev
|
||||
{
|
||||
RX,
|
||||
TX
|
||||
};
|
||||
|
||||
/* common RX and TX streaming params */
|
||||
struct stream_cfg
|
||||
{
|
||||
long long bw_hz; // Analog banwidth in Hz
|
||||
long long fs_hz; // Baseband sample rate in Hz
|
||||
long long lo_hz; // Local oscillator frequency in Hz
|
||||
const char *rfport; // Port name
|
||||
};
|
||||
|
||||
|
||||
/* check return value of attr_write function */
|
||||
void errchk(int v, const char *what);
|
||||
|
||||
/* write attribute: long long int */
|
||||
void wr_ch_lli(struct iio_channel *chn, const char *what, long long val);
|
||||
|
||||
/* write attribute: string */
|
||||
void wr_ch_str(struct iio_channel *chn, const char *what, const char *str);
|
||||
|
||||
/* helper function generating channel names */
|
||||
char *get_ch_name(const char *type, int id, char *tmpstr);
|
||||
|
||||
/* returns ad9361 phy device */
|
||||
struct iio_device *get_ad9361_phy(struct iio_context *ctx);
|
||||
|
||||
/* finds AD9361 streaming IIO devices */
|
||||
bool get_ad9361_stream_dev(struct iio_context *ctx, enum iodev d, struct iio_device **dev);
|
||||
|
||||
/* finds AD9361 streaming IIO channels */
|
||||
bool get_ad9361_stream_ch(struct iio_context *ctx, enum iodev d, struct iio_device *dev, int chid, struct iio_channel **chn);
|
||||
|
||||
/* finds AD9361 phy IIO configuration channel with id chid */
|
||||
bool get_phy_chan(struct iio_context *ctx, enum iodev d, int chid, struct iio_channel **chn);
|
||||
|
||||
/* finds AD9361 local oscillator IIO configuration channels */
|
||||
bool get_lo_chan(struct iio_context *ctx, enum iodev d, struct iio_channel **chn);
|
||||
|
||||
/* applies streaming configuration through IIO */
|
||||
bool cfg_ad9361_streaming_ch(struct iio_context *ctx, struct stream_cfg *cfg, enum iodev type, int chid);
|
||||
|
||||
bool config_ad9361_rx_local(unsigned long bandwidth_,
|
||||
unsigned long sample_rate_,
|
||||
unsigned long freq_,
|
||||
std::string rf_port_select_,
|
||||
std::string gain_mode_rx1_,
|
||||
std::string gain_mode_rx2_,
|
||||
double rf_gain_rx1_,
|
||||
double rf_gain_rx2_);
|
||||
|
||||
bool config_ad9361_rx_remote(std::string remote_host,
|
||||
unsigned long bandwidth_,
|
||||
unsigned long sample_rate_,
|
||||
unsigned long freq_,
|
||||
std::string rf_port_select_,
|
||||
std::string gain_mode_rx1_,
|
||||
std::string gain_mode_rx2_,
|
||||
double rf_gain_rx1_,
|
||||
double rf_gain_rx2_);
|
||||
|
||||
bool config_ad9361_lo_local(unsigned long bandwidth_,
|
||||
unsigned long sample_rate_,
|
||||
unsigned long freq_rf_tx_hz_,
|
||||
double tx_attenuation_db_,
|
||||
long long freq_dds_tx_hz_,
|
||||
double scale_dds_dbfs_);
|
||||
|
||||
bool config_ad9361_lo_remote(std::string remote_host,
|
||||
unsigned long bandwidth_,
|
||||
unsigned long sample_rate_,
|
||||
unsigned long freq_rf_tx_hz_,
|
||||
double tx_attenuation_db_,
|
||||
long long freq_dds_tx_hz_,
|
||||
double scale_dds_dbfs_);
|
||||
|
||||
|
||||
bool ad9361_disable_lo_remote(std::string remote_host);
|
||||
|
||||
bool ad9361_disable_lo_local();
|
||||
|
||||
#endif
|
@ -24,7 +24,8 @@ set(TELEMETRY_DECODER_ADAPTER_SOURCES
|
||||
galileo_e1b_telemetry_decoder.cc
|
||||
sbas_l1_telemetry_decoder.cc
|
||||
galileo_e5a_telemetry_decoder.cc
|
||||
glonass_l1_ca_telemetry_decoder.cc
|
||||
glonass_l1_ca_telemetry_decoder.cc
|
||||
glonass_l2_ca_telemetry_decoder.cc
|
||||
)
|
||||
|
||||
include_directories(
|
||||
|
@ -0,0 +1,103 @@
|
||||
/*!
|
||||
* \file glonass_l2_ca_telemetry_decoder.cc
|
||||
* \brief Implementation of an adapter of a GLONASS L2 C/A NAV data decoder block
|
||||
* to a TelemetryDecoderInterface
|
||||
* \author Damian Miralles, 2018. dmiralles2009(at)gmail.com
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* GNSS-SDR is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNSS-SDR is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
#include "glonass_l2_ca_telemetry_decoder.h"
|
||||
#include "configuration_interface.h"
|
||||
#include "glonass_gnav_ephemeris.h"
|
||||
#include "glonass_gnav_almanac.h"
|
||||
#include "glonass_gnav_utc_model.h"
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <glog/logging.h>
|
||||
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
GlonassL2CaTelemetryDecoder::GlonassL2CaTelemetryDecoder(ConfigurationInterface* configuration,
|
||||
std::string role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams) : role_(role),
|
||||
in_streams_(in_streams),
|
||||
out_streams_(out_streams)
|
||||
{
|
||||
std::string default_dump_filename = "./navigation.dat";
|
||||
DLOG(INFO) << "role " << role;
|
||||
dump_ = configuration->property(role + ".dump", false);
|
||||
dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
|
||||
// make telemetry decoder object
|
||||
telemetry_decoder_ = glonass_l2_ca_make_telemetry_decoder_cc(satellite_, dump_);
|
||||
DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")";
|
||||
channel_ = 0;
|
||||
}
|
||||
|
||||
|
||||
GlonassL2CaTelemetryDecoder::~GlonassL2CaTelemetryDecoder()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void GlonassL2CaTelemetryDecoder::set_satellite(const Gnss_Satellite& satellite)
|
||||
{
|
||||
satellite_ = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
||||
telemetry_decoder_->set_satellite(satellite_);
|
||||
DLOG(INFO) << "TELEMETRY DECODER: satellite set to " << satellite_;
|
||||
}
|
||||
|
||||
|
||||
void GlonassL2CaTelemetryDecoder::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (top_block)
|
||||
{ /* top_block is not null */
|
||||
};
|
||||
// Nothing to connect internally
|
||||
DLOG(INFO) << "nothing to connect internally";
|
||||
}
|
||||
|
||||
|
||||
void GlonassL2CaTelemetryDecoder::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (top_block)
|
||||
{ /* top_block is not null */
|
||||
};
|
||||
// Nothing to disconnect
|
||||
}
|
||||
|
||||
|
||||
gr::basic_block_sptr GlonassL2CaTelemetryDecoder::get_left_block()
|
||||
{
|
||||
return telemetry_decoder_;
|
||||
}
|
||||
|
||||
|
||||
gr::basic_block_sptr GlonassL2CaTelemetryDecoder::get_right_block()
|
||||
{
|
||||
return telemetry_decoder_;
|
||||
}
|
@ -0,0 +1,90 @@
|
||||
/*!
|
||||
* \file glonass_l2_ca_telemetry_decoder.h
|
||||
* \brief Interface of an adapter of a GLONASS L2 C/A NAV data decoder block
|
||||
* to a TelemetryDecoderInterface
|
||||
* \author Damian Miralles, 2018. dmiralles2009(at)gmail.com
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* GNSS-SDR is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNSS-SDR is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
#ifndef GNSS_SDR_GLONASS_L2_CA_TELEMETRY_DECODER_H_
|
||||
#define GNSS_SDR_GLONASS_L2_CA_TELEMETRY_DECODER_H_
|
||||
|
||||
#include "telemetry_decoder_interface.h"
|
||||
#include "glonass_l2_ca_telemetry_decoder_cc.h"
|
||||
#include <string>
|
||||
|
||||
class ConfigurationInterface;
|
||||
|
||||
/*!
|
||||
* \brief This class implements a NAV data decoder for GLONASS L2 C/A
|
||||
*/
|
||||
class GlonassL2CaTelemetryDecoder : public TelemetryDecoderInterface
|
||||
{
|
||||
public:
|
||||
GlonassL2CaTelemetryDecoder(ConfigurationInterface* configuration,
|
||||
std::string role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams);
|
||||
|
||||
virtual ~GlonassL2CaTelemetryDecoder();
|
||||
std::string role() override
|
||||
{
|
||||
return role_;
|
||||
}
|
||||
|
||||
//! Returns "GLONASS_L2_CA_Telemetry_Decoder"
|
||||
std::string implementation() override
|
||||
{
|
||||
return "GLONASS_L2_CA_Telemetry_Decoder";
|
||||
}
|
||||
void connect(gr::top_block_sptr top_block) override;
|
||||
void disconnect(gr::top_block_sptr top_block) override;
|
||||
gr::basic_block_sptr get_left_block() override;
|
||||
gr::basic_block_sptr get_right_block() override;
|
||||
void set_satellite(const Gnss_Satellite& satellite) override;
|
||||
void set_channel(int channel) override { telemetry_decoder_->set_channel(channel); }
|
||||
void reset() override
|
||||
{
|
||||
return;
|
||||
}
|
||||
size_t item_size() override
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
private:
|
||||
glonass_l2_ca_telemetry_decoder_cc_sptr telemetry_decoder_;
|
||||
Gnss_Satellite satellite_;
|
||||
int channel_;
|
||||
bool dump_;
|
||||
std::string dump_filename_;
|
||||
std::string role_;
|
||||
unsigned int in_streams_;
|
||||
unsigned int out_streams_;
|
||||
};
|
||||
|
||||
#endif
|
@ -24,6 +24,7 @@ set(TELEMETRY_DECODER_GR_BLOCKS_SOURCES
|
||||
sbas_l1_telemetry_decoder_cc.cc
|
||||
galileo_e5a_telemetry_decoder_cc.cc
|
||||
glonass_l1_ca_telemetry_decoder_cc.cc
|
||||
glonass_l2_ca_telemetry_decoder_cc.cc
|
||||
)
|
||||
|
||||
include_directories(
|
||||
|
@ -320,7 +320,7 @@ int galileo_e1b_telemetry_decoder_cc::general_work(int noutput_items __attribute
|
||||
d_stat = 1; // enter into frame pre-detection status
|
||||
}
|
||||
}
|
||||
else if (d_stat == 1) // posible preamble lock
|
||||
else if (d_stat == 1) // possible preamble lock
|
||||
{
|
||||
if (abs(corr_value) >= d_symbols_per_preamble)
|
||||
{
|
||||
|
@ -338,7 +338,7 @@ int galileo_e5a_telemetry_decoder_cc::general_work(int noutput_items __attribute
|
||||
d_stat = 1; // enter into frame pre-detection status
|
||||
}
|
||||
}
|
||||
else if ((d_stat == 1) && new_symbol) // posible preamble lock
|
||||
else if ((d_stat == 1) && new_symbol) // possible preamble lock
|
||||
{
|
||||
if (abs(corr_value) >= GALILEO_FNAV_PREAMBLE_LENGTH_BITS)
|
||||
{
|
||||
|
@ -271,7 +271,7 @@ int glonass_l1_ca_telemetry_decoder_cc::general_work(int noutput_items __attribu
|
||||
d_preamble_time_samples = d_symbol_history.at(0).Tracking_sample_counter; // record the preamble sample stamp
|
||||
}
|
||||
}
|
||||
else if (d_stat == 1) // posible preamble lock
|
||||
else if (d_stat == 1) // possible preamble lock
|
||||
{
|
||||
if (abs(corr_value) >= d_symbols_per_preamble)
|
||||
{
|
||||
|
@ -34,13 +34,13 @@
|
||||
#define GNSS_SDR_GLONASS_L1_CA_TELEMETRY_DECODER_CC_H
|
||||
|
||||
|
||||
#include "GLONASS_L1_CA.h"
|
||||
#include "glonass_gnav_navigation_message.h"
|
||||
#include "glonass_gnav_ephemeris.h"
|
||||
#include "glonass_gnav_almanac.h"
|
||||
#include "glonass_gnav_utc_model.h"
|
||||
#include "gnss_satellite.h"
|
||||
#include "gnss_synchro.h"
|
||||
#include "GLONASS_L1_L2_CA.h"
|
||||
#include <gnuradio/block.h>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
|
@ -0,0 +1,449 @@
|
||||
/*!
|
||||
* \file glonass_l2_ca_telemetry_decoder_cc.cc
|
||||
* \brief Implementation of an adapter of a GLONASS L1 C/A NAV data decoder block
|
||||
* to a TelemetryDecoderInterface
|
||||
* \author Damian Miralles, 2018. dmiralles2009(at)gmail.com
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* GNSS-SDR is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNSS-SDR is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
|
||||
#include "glonass_l2_ca_telemetry_decoder_cc.h"
|
||||
#include <boost/lexical_cast.hpp>
|
||||
#include <gnuradio/io_signature.h>
|
||||
#include <glog/logging.h>
|
||||
|
||||
|
||||
#define CRC_ERROR_LIMIT 6
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
|
||||
glonass_l2_ca_telemetry_decoder_cc_sptr
|
||||
glonass_l2_ca_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump)
|
||||
{
|
||||
return glonass_l2_ca_telemetry_decoder_cc_sptr(new glonass_l2_ca_telemetry_decoder_cc(satellite, dump));
|
||||
}
|
||||
|
||||
|
||||
glonass_l2_ca_telemetry_decoder_cc::glonass_l2_ca_telemetry_decoder_cc(
|
||||
const Gnss_Satellite &satellite,
|
||||
bool dump) : gr::block("glonass_l2_ca_telemetry_decoder_cc", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)),
|
||||
gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)))
|
||||
{
|
||||
// Telemetry Bit transition synchronization port out
|
||||
this->message_port_register_out(pmt::mp("preamble_timestamp_s"));
|
||||
// Ephemeris data port out
|
||||
this->message_port_register_out(pmt::mp("telemetry"));
|
||||
// initialize internal vars
|
||||
d_dump = dump;
|
||||
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
||||
LOG(INFO) << "Initializing GLONASS L2 CA TELEMETRY DECODING";
|
||||
// Define the number of sampes per symbol. Notice that GLONASS has 2 rates,
|
||||
//one for the navigation data and the other for the preamble information
|
||||
d_samples_per_symbol = (GLONASS_L2_CA_CODE_RATE_HZ / GLONASS_L2_CA_CODE_LENGTH_CHIPS) / GLONASS_L2_CA_SYMBOL_RATE_BPS;
|
||||
|
||||
// Set the preamble information
|
||||
unsigned short int preambles_bits[GLONASS_GNAV_PREAMBLE_LENGTH_BITS] = GLONASS_GNAV_PREAMBLE;
|
||||
// Since preamble rate is different than navigation data rate we use a constant
|
||||
d_symbols_per_preamble = GLONASS_GNAV_PREAMBLE_LENGTH_SYMBOLS;
|
||||
|
||||
memcpy(static_cast<unsigned short int *>(this->d_preambles_bits), static_cast<unsigned short int *>(preambles_bits), GLONASS_GNAV_PREAMBLE_LENGTH_BITS * sizeof(unsigned short int));
|
||||
|
||||
// preamble bits to sampled symbols
|
||||
d_preambles_symbols = static_cast<signed int *>(malloc(sizeof(signed int) * d_symbols_per_preamble));
|
||||
int n = 0;
|
||||
for (int i = 0; i < GLONASS_GNAV_PREAMBLE_LENGTH_BITS; i++)
|
||||
{
|
||||
for (unsigned int j = 0; j < GLONASS_GNAV_TELEMETRY_SYMBOLS_PER_PREAMBLE_BIT; j++)
|
||||
{
|
||||
if (d_preambles_bits[i] == 1)
|
||||
{
|
||||
d_preambles_symbols[n] = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
d_preambles_symbols[n] = -1;
|
||||
}
|
||||
n++;
|
||||
}
|
||||
}
|
||||
d_sample_counter = 0;
|
||||
d_stat = 0;
|
||||
d_preamble_index = 0;
|
||||
|
||||
d_flag_frame_sync = false;
|
||||
|
||||
d_flag_parity = false;
|
||||
d_TOW_at_current_symbol = 0;
|
||||
Flag_valid_word = false;
|
||||
delta_t = 0;
|
||||
d_CRC_error_counter = 0;
|
||||
d_flag_preamble = false;
|
||||
d_channel = 0;
|
||||
flag_TOW_set = false;
|
||||
d_preamble_time_samples = 0;
|
||||
}
|
||||
|
||||
|
||||
glonass_l2_ca_telemetry_decoder_cc::~glonass_l2_ca_telemetry_decoder_cc()
|
||||
{
|
||||
delete d_preambles_symbols;
|
||||
if (d_dump_file.is_open() == true)
|
||||
{
|
||||
try
|
||||
{
|
||||
d_dump_file.close();
|
||||
}
|
||||
catch (const std::exception &ex)
|
||||
{
|
||||
LOG(WARNING) << "Exception in destructor closing the dump file " << ex.what();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void glonass_l2_ca_telemetry_decoder_cc::decode_string(double *frame_symbols, int frame_length)
|
||||
{
|
||||
double chip_acc = 0.0;
|
||||
int chip_acc_counter = 0;
|
||||
|
||||
// 1. Transform from symbols to bits
|
||||
std::string bi_binary_code;
|
||||
std::string relative_code;
|
||||
std::string data_bits;
|
||||
|
||||
// Group samples into bi-binary code
|
||||
for (int i = 0; i < (frame_length); i++)
|
||||
{
|
||||
chip_acc += frame_symbols[i];
|
||||
chip_acc_counter += 1;
|
||||
|
||||
if (chip_acc_counter == (GLONASS_GNAV_TELEMETRY_SYMBOLS_PER_BIT))
|
||||
{
|
||||
if (chip_acc > 0)
|
||||
{
|
||||
bi_binary_code.push_back('1');
|
||||
chip_acc_counter = 0;
|
||||
chip_acc = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
bi_binary_code.push_back('0');
|
||||
chip_acc_counter = 0;
|
||||
chip_acc = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Convert from bi-binary code to relative code
|
||||
for (int i = 0; i < (GLONASS_GNAV_STRING_BITS); i++)
|
||||
{
|
||||
if (bi_binary_code[2 * i] == '1' && bi_binary_code[2 * i + 1] == '0')
|
||||
{
|
||||
relative_code.push_back('1');
|
||||
}
|
||||
else
|
||||
{
|
||||
relative_code.push_back('0');
|
||||
}
|
||||
}
|
||||
// Convert from relative code to data bits
|
||||
data_bits.push_back('0');
|
||||
for (int i = 1; i < (GLONASS_GNAV_STRING_BITS); i++)
|
||||
{
|
||||
data_bits.push_back(((relative_code[i - 1] - '0') ^ (relative_code[i] - '0')) + '0');
|
||||
}
|
||||
|
||||
// 2. Call the GLONASS GNAV string decoder
|
||||
d_nav.string_decoder(data_bits);
|
||||
|
||||
// 3. Check operation executed correctly
|
||||
if (d_nav.flag_CRC_test == true)
|
||||
{
|
||||
LOG(INFO) << "GLONASS GNAV CRC correct on channel " << d_channel << " from satellite " << d_satellite;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(INFO) << "GLONASS GNAV CRC error on channel " << d_channel << " from satellite " << d_satellite;
|
||||
}
|
||||
// 4. Push the new navigation data to the queues
|
||||
if (d_nav.have_new_ephemeris() == true)
|
||||
{
|
||||
// get object for this SV (mandatory)
|
||||
d_nav.gnav_ephemeris.i_satellite_freq_channel = d_satellite.get_rf_link();
|
||||
std::shared_ptr<Glonass_Gnav_Ephemeris> tmp_obj = std::make_shared<Glonass_Gnav_Ephemeris>(d_nav.get_ephemeris());
|
||||
this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj));
|
||||
LOG(INFO) << "GLONASS GNAV Ephemeris have been received on channel" << d_channel << " from satellite " << d_satellite;
|
||||
}
|
||||
if (d_nav.have_new_utc_model() == true)
|
||||
{
|
||||
// get object for this SV (mandatory)
|
||||
std::shared_ptr<Glonass_Gnav_Utc_Model> tmp_obj = std::make_shared<Glonass_Gnav_Utc_Model>(d_nav.get_utc_model());
|
||||
this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj));
|
||||
LOG(INFO) << "GLONASS GNAV UTC Model have been received on channel" << d_channel << " from satellite " << d_satellite;
|
||||
}
|
||||
if (d_nav.have_new_almanac() == true)
|
||||
{
|
||||
unsigned int slot_nbr = d_nav.i_alm_satellite_slot_number;
|
||||
std::shared_ptr<Glonass_Gnav_Almanac> tmp_obj = std::make_shared<Glonass_Gnav_Almanac>(d_nav.get_almanac(slot_nbr));
|
||||
this->message_port_pub(pmt::mp("telemetry"), pmt::make_any(tmp_obj));
|
||||
LOG(INFO) << "GLONASS GNAV Almanac have been received on channel" << d_channel << " in slot number " << slot_nbr;
|
||||
}
|
||||
// 5. Update satellite information on system
|
||||
if (d_nav.flag_update_slot_number == true)
|
||||
{
|
||||
LOG(INFO) << "GLONASS GNAV Slot Number Identified on channel " << d_channel;
|
||||
d_satellite.update_PRN(d_nav.gnav_ephemeris.d_n);
|
||||
d_satellite.what_block(d_satellite.get_system(), d_nav.gnav_ephemeris.d_n);
|
||||
d_nav.flag_update_slot_number = false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int glonass_l2_ca_telemetry_decoder_cc::general_work(int noutput_items __attribute__((unused)), gr_vector_int &ninput_items __attribute__((unused)),
|
||||
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
|
||||
{
|
||||
int corr_value = 0;
|
||||
int preamble_diff = 0;
|
||||
|
||||
Gnss_Synchro **out = reinterpret_cast<Gnss_Synchro **>(&output_items[0]); // Get the output buffer pointer
|
||||
const Gnss_Synchro **in = reinterpret_cast<const Gnss_Synchro **>(&input_items[0]); // Get the input buffer pointer
|
||||
|
||||
Gnss_Synchro current_symbol; //structure to save the synchronization information and send the output object to the next block
|
||||
//1. Copy the current tracking output
|
||||
current_symbol = in[0][0];
|
||||
d_symbol_history.push_back(current_symbol); //add new symbol to the symbol queue
|
||||
d_sample_counter++; //count for the processed samples
|
||||
consume_each(1);
|
||||
|
||||
d_flag_preamble = false;
|
||||
unsigned int required_symbols = GLONASS_GNAV_STRING_SYMBOLS;
|
||||
|
||||
if (d_symbol_history.size() > required_symbols)
|
||||
{
|
||||
//******* preamble correlation ********
|
||||
for (int i = 0; i < d_symbols_per_preamble; i++)
|
||||
{
|
||||
if (d_symbol_history.at(i).Prompt_I < 0) // symbols clipping
|
||||
{
|
||||
corr_value -= d_preambles_symbols[i];
|
||||
}
|
||||
else
|
||||
{
|
||||
corr_value += d_preambles_symbols[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//******* frame sync ******************
|
||||
if (d_stat == 0) //no preamble information
|
||||
{
|
||||
if (abs(corr_value) >= d_symbols_per_preamble)
|
||||
{
|
||||
// Record the preamble sample stamp
|
||||
d_preamble_index = d_sample_counter;
|
||||
LOG(INFO) << "Preamble detection for GLONASS L2 C/A SAT " << this->d_satellite;
|
||||
// Enter into frame pre-detection status
|
||||
d_stat = 1;
|
||||
d_preamble_time_samples = d_symbol_history.at(0).Tracking_sample_counter; // record the preamble sample stamp
|
||||
}
|
||||
}
|
||||
else if (d_stat == 1) // possible preamble lock
|
||||
{
|
||||
if (abs(corr_value) >= d_symbols_per_preamble)
|
||||
{
|
||||
//check preamble separation
|
||||
preamble_diff = d_sample_counter - d_preamble_index;
|
||||
// Record the PRN start sample index associated to the preamble
|
||||
d_preamble_time_samples = d_symbol_history.at(0).Tracking_sample_counter;
|
||||
if (abs(preamble_diff - GLONASS_GNAV_PREAMBLE_PERIOD_SYMBOLS) == 0)
|
||||
{
|
||||
//try to decode frame
|
||||
LOG(INFO) << "Starting string decoder for GLONASS L2 C/A SAT " << this->d_satellite;
|
||||
d_preamble_index = d_sample_counter; //record the preamble sample stamp
|
||||
d_stat = 2;
|
||||
// send asynchronous message to tracking to inform of frame sync and extend correlation time
|
||||
pmt::pmt_t value = pmt::from_double(static_cast<double>(d_preamble_time_samples) / static_cast<double>(d_symbol_history.at(0).fs) - 0.001);
|
||||
this->message_port_pub(pmt::mp("preamble_timestamp_s"), value);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (preamble_diff > GLONASS_GNAV_PREAMBLE_PERIOD_SYMBOLS)
|
||||
{
|
||||
d_stat = 0; // start again
|
||||
}
|
||||
DLOG(INFO) << "Failed string decoder for GLONASS L2 C/A SAT " << this->d_satellite;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (d_stat == 2)
|
||||
{
|
||||
// FIXME: The preamble index marks the first symbol of the string count. Here I just wait for another full string to be received before processing
|
||||
if (d_sample_counter == d_preamble_index + GLONASS_GNAV_STRING_SYMBOLS)
|
||||
{
|
||||
// NEW GLONASS string received
|
||||
// 0. fetch the symbols into an array
|
||||
int string_length = GLONASS_GNAV_STRING_SYMBOLS - d_symbols_per_preamble;
|
||||
double string_symbols[GLONASS_GNAV_DATA_SYMBOLS] = {0};
|
||||
|
||||
//******* SYMBOL TO BIT *******
|
||||
for (int i = 0; i < string_length; i++)
|
||||
{
|
||||
if (corr_value > 0)
|
||||
{
|
||||
string_symbols[i] = d_symbol_history.at(i + d_symbols_per_preamble).Prompt_I; // because last symbol of the preamble is just received now!
|
||||
}
|
||||
else
|
||||
{
|
||||
string_symbols[i] = -d_symbol_history.at(i + d_symbols_per_preamble).Prompt_I; // because last symbol of the preamble is just received now!
|
||||
}
|
||||
}
|
||||
|
||||
//call the decoder
|
||||
decode_string(string_symbols, string_length);
|
||||
if (d_nav.flag_CRC_test == true)
|
||||
{
|
||||
d_CRC_error_counter = 0;
|
||||
d_flag_preamble = true; //valid preamble indicator (initialized to false every work())
|
||||
d_preamble_index = d_sample_counter; //record the preamble sample stamp (t_P)
|
||||
if (!d_flag_frame_sync)
|
||||
{
|
||||
d_flag_frame_sync = true;
|
||||
DLOG(INFO) << " Frame sync SAT " << this->d_satellite << " with preamble start at "
|
||||
<< d_symbol_history.at(0).Tracking_sample_counter << " [samples]";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
d_CRC_error_counter++;
|
||||
d_preamble_index = d_sample_counter; //record the preamble sample stamp
|
||||
if (d_CRC_error_counter > CRC_ERROR_LIMIT)
|
||||
{
|
||||
LOG(INFO) << "Lost of frame sync SAT " << this->d_satellite;
|
||||
d_flag_frame_sync = false;
|
||||
d_stat = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// UPDATE GNSS SYNCHRO DATA
|
||||
//2. Add the telemetry decoder information
|
||||
if (this->d_flag_preamble == true and d_nav.flag_TOW_new == true)
|
||||
//update TOW at the preamble instant
|
||||
{
|
||||
d_TOW_at_current_symbol = floor((d_nav.gnav_ephemeris.d_TOW - GLONASS_GNAV_PREAMBLE_DURATION_S) * 1000) / 1000;
|
||||
d_nav.flag_TOW_new = false;
|
||||
}
|
||||
else //if there is not a new preamble, we define the TOW of the current symbol
|
||||
{
|
||||
d_TOW_at_current_symbol = d_TOW_at_current_symbol + GLONASS_L2_CA_CODE_PERIOD;
|
||||
}
|
||||
|
||||
//if (d_flag_frame_sync == true and d_nav.flag_TOW_set==true and d_nav.flag_CRC_test == true)
|
||||
|
||||
// if(d_nav.flag_GGTO_1 == true and d_nav.flag_GGTO_2 == true and d_nav.flag_GGTO_3 == true and d_nav.flag_GGTO_4 == true) //all GGTO parameters arrived
|
||||
// {
|
||||
// delta_t = d_nav.A_0G_10 + d_nav.A_1G_10 * (d_TOW_at_current_symbol - d_nav.t_0G_10 + 604800.0 * (fmod((d_nav.WN_0 - d_nav.WN_0G_10), 64)));
|
||||
// }
|
||||
|
||||
if (d_flag_frame_sync == true and d_nav.flag_TOW_set == true)
|
||||
{
|
||||
current_symbol.Flag_valid_word = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
current_symbol.Flag_valid_word = false;
|
||||
}
|
||||
|
||||
current_symbol.PRN = this->d_satellite.get_PRN();
|
||||
current_symbol.TOW_at_current_symbol_s = d_TOW_at_current_symbol;
|
||||
current_symbol.TOW_at_current_symbol_s -= delta_t; // Galileo to GPS TOW
|
||||
|
||||
if (d_dump == true)
|
||||
{
|
||||
// MULTIPLEXED FILE RECORDING - Record results to file
|
||||
try
|
||||
{
|
||||
double tmp_double;
|
||||
unsigned long int tmp_ulong_int;
|
||||
tmp_double = d_TOW_at_current_symbol;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double));
|
||||
tmp_ulong_int = current_symbol.Tracking_sample_counter;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_ulong_int), sizeof(unsigned long int));
|
||||
tmp_double = 0;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double));
|
||||
}
|
||||
catch (const std::ifstream::failure &e)
|
||||
{
|
||||
LOG(WARNING) << "Exception writing observables dump file " << e.what();
|
||||
}
|
||||
}
|
||||
|
||||
// remove used symbols from history
|
||||
if (d_symbol_history.size() > required_symbols)
|
||||
{
|
||||
d_symbol_history.pop_front();
|
||||
}
|
||||
//3. Make the output (copy the object contents to the GNURadio reserved memory)
|
||||
*out[0] = current_symbol;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
void glonass_l2_ca_telemetry_decoder_cc::set_satellite(const Gnss_Satellite &satellite)
|
||||
{
|
||||
d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
||||
DLOG(INFO) << "Setting decoder Finite State Machine to satellite " << d_satellite;
|
||||
DLOG(INFO) << "Navigation Satellite set to " << d_satellite;
|
||||
}
|
||||
|
||||
|
||||
void glonass_l2_ca_telemetry_decoder_cc::set_channel(int channel)
|
||||
{
|
||||
d_channel = channel;
|
||||
LOG(INFO) << "Navigation channel set to " << channel;
|
||||
// ############# ENABLE DATA FILE LOG #################
|
||||
if (d_dump == true)
|
||||
{
|
||||
if (d_dump_file.is_open() == false)
|
||||
{
|
||||
try
|
||||
{
|
||||
d_dump_filename = "telemetry";
|
||||
d_dump_filename.append(boost::lexical_cast<std::string>(d_channel));
|
||||
d_dump_filename.append(".dat");
|
||||
d_dump_file.exceptions(std::ifstream::failbit | std::ifstream::badbit);
|
||||
d_dump_file.open(d_dump_filename.c_str(), std::ios::out | std::ios::binary);
|
||||
LOG(INFO) << "Telemetry decoder dump enabled on channel " << d_channel << " Log file: " << d_dump_filename.c_str();
|
||||
}
|
||||
catch (const std::ifstream::failure &e)
|
||||
{
|
||||
LOG(WARNING) << "channel " << d_channel << ": exception opening Glonass TLM dump file. " << e.what();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,117 @@
|
||||
/*!
|
||||
* \file glonass_l2_ca_telemetry_decoder_cc.h
|
||||
* \brief Implementation of an adapter of a GLONASS L2 C/A NAV data decoder block
|
||||
* to a TelemetryDecoderInterface
|
||||
* \author Damian Miralles, 2018. dmiralles2009(at)gmail.com
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2015 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* GNSS-SDR is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNSS-SDR is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef GNSS_SDR_GLONASS_L2_CA_TELEMETRY_DECODER_CC_H
|
||||
#define GNSS_SDR_GLONASS_L2_CA_TELEMETRY_DECODER_CC_H
|
||||
|
||||
|
||||
#include "GLONASS_L1_L2_CA.h"
|
||||
#include "glonass_gnav_navigation_message.h"
|
||||
#include "glonass_gnav_ephemeris.h"
|
||||
#include "glonass_gnav_almanac.h"
|
||||
#include "glonass_gnav_utc_model.h"
|
||||
#include "gnss_satellite.h"
|
||||
#include "gnss_synchro.h"
|
||||
#include <gnuradio/block.h>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
|
||||
|
||||
class glonass_l2_ca_telemetry_decoder_cc;
|
||||
|
||||
typedef boost::shared_ptr<glonass_l2_ca_telemetry_decoder_cc> glonass_l2_ca_telemetry_decoder_cc_sptr;
|
||||
|
||||
glonass_l2_ca_telemetry_decoder_cc_sptr glonass_l2_ca_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump);
|
||||
|
||||
/*!
|
||||
* \brief This class implements a block that decodes the GNAV data defined in GLONASS ICD v5.1
|
||||
* \see <a href="http://russianspacesystems.ru/wp-content/uploads/2016/08/ICD_GLONASS_eng_v5.1.pdf">GLONASS ICD</a>
|
||||
*
|
||||
*/
|
||||
class glonass_l2_ca_telemetry_decoder_cc : public gr::block
|
||||
{
|
||||
public:
|
||||
~glonass_l2_ca_telemetry_decoder_cc(); //!< Class destructor
|
||||
void set_satellite(const Gnss_Satellite &satellite); //!< Set satellite PRN
|
||||
void set_channel(int channel); //!< Set receiver's channel
|
||||
|
||||
/*!
|
||||
* \brief This is where all signal processing takes place
|
||||
*/
|
||||
int general_work(int noutput_items, gr_vector_int &ninput_items,
|
||||
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
|
||||
|
||||
private:
|
||||
friend glonass_l2_ca_telemetry_decoder_cc_sptr
|
||||
glonass_l2_ca_make_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump);
|
||||
glonass_l2_ca_telemetry_decoder_cc(const Gnss_Satellite &satellite, bool dump);
|
||||
|
||||
void decode_string(double *symbols, int frame_length);
|
||||
|
||||
//!< Help with coherent tracking
|
||||
double d_preamble_time_samples;
|
||||
|
||||
//!< Preamble decoding
|
||||
unsigned short int d_preambles_bits[GLONASS_GNAV_PREAMBLE_LENGTH_BITS];
|
||||
int *d_preambles_symbols;
|
||||
unsigned int d_samples_per_symbol;
|
||||
int d_symbols_per_preamble;
|
||||
|
||||
//!< Storage for incoming data
|
||||
std::deque<Gnss_Synchro> d_symbol_history;
|
||||
|
||||
//!< Variables for internal functionality
|
||||
long unsigned int d_sample_counter; //!< Sample counter as an index (1,2,3,..etc) indicating number of samples processed
|
||||
long unsigned int d_preamble_index; //!< Index of sample number where preamble was found
|
||||
unsigned int d_stat; //!< Status of decoder
|
||||
bool d_flag_frame_sync; //!< Indicate when a frame sync is achieved
|
||||
bool d_flag_parity; //!< Flag indicating when parity check was achieved (crc check)
|
||||
bool d_flag_preamble; //!< Flag indicating when preamble was found
|
||||
int d_CRC_error_counter; //!< Number of failed CRC operations
|
||||
bool flag_TOW_set; //!< Indicates when time of week is set
|
||||
double delta_t; //!< GPS-GLONASS time offset
|
||||
|
||||
//!< Navigation Message variable
|
||||
Glonass_Gnav_Navigation_Message d_nav;
|
||||
|
||||
//!< Values to populate gnss synchronization structure
|
||||
double d_TOW_at_current_symbol;
|
||||
bool Flag_valid_word;
|
||||
|
||||
//!< Satellite Information and logging capacity
|
||||
Gnss_Satellite d_satellite;
|
||||
int d_channel;
|
||||
bool d_dump;
|
||||
std::string d_dump_filename;
|
||||
std::ofstream d_dump_file;
|
||||
};
|
||||
|
||||
#endif
|
@ -70,9 +70,9 @@ gps_l5_telemetry_decoder_cc::gps_l5_telemetry_decoder_cc(
|
||||
d_TOW_at_Preamble = 0.0;
|
||||
//initialize the CNAV frame decoder (libswiftcnav)
|
||||
cnav_msg_decoder_init(&d_cnav_decoder);
|
||||
for (int aux = 0; aux < GPS_L5_NH_CODE_LENGTH; aux++)
|
||||
for (int aux = 0; aux < GPS_L5i_NH_CODE_LENGTH; aux++)
|
||||
{
|
||||
if (GPS_L5_NH_CODE[aux] == 0)
|
||||
if (GPS_L5i_NH_CODE[aux] == 0)
|
||||
{
|
||||
bits_NH[aux] = -1.0;
|
||||
}
|
||||
@ -119,9 +119,9 @@ int gps_l5_telemetry_decoder_cc::general_work(int noutput_items __attribute__((u
|
||||
int symbol_value = 0;
|
||||
|
||||
//Search correlation with Neuman-Hofman Code (see IS-GPS-705D)
|
||||
if (sym_hist.size() == GPS_L5_NH_CODE_LENGTH)
|
||||
if (sym_hist.size() == GPS_L5i_NH_CODE_LENGTH)
|
||||
{
|
||||
for (int i = 0; i < GPS_L5_NH_CODE_LENGTH; i++)
|
||||
for (int i = 0; i < GPS_L5i_NH_CODE_LENGTH; i++)
|
||||
{
|
||||
if ((bits_NH[i] * sym_hist.at(i)) > 0.0)
|
||||
{
|
||||
@ -132,7 +132,7 @@ int gps_l5_telemetry_decoder_cc::general_work(int noutput_items __attribute__((u
|
||||
corr_NH -= 1;
|
||||
}
|
||||
}
|
||||
if (abs(corr_NH) == GPS_L5_NH_CODE_LENGTH)
|
||||
if (abs(corr_NH) == GPS_L5i_NH_CODE_LENGTH)
|
||||
{
|
||||
sync_NH = true;
|
||||
if (corr_NH > 0)
|
||||
|
@ -42,8 +42,7 @@
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
extern "C"
|
||||
{
|
||||
extern "C" {
|
||||
#include "cnav_msg.h"
|
||||
#include "edc.h"
|
||||
#include "bits.h"
|
||||
@ -91,7 +90,7 @@ private:
|
||||
bool d_flag_valid_word;
|
||||
|
||||
Gps_CNAV_Navigation_Message d_CNAV_Message;
|
||||
double bits_NH[GPS_L5_NH_CODE_LENGTH];
|
||||
double bits_NH[GPS_L5i_NH_CODE_LENGTH];
|
||||
std::deque<double> sym_hist;
|
||||
bool sync_NH;
|
||||
bool new_sym;
|
||||
|
@ -25,7 +25,7 @@ if(ENABLE_FPGA)
|
||||
SET(OPT_TRACKING_ADAPTERS ${OPT_TRACKING_ADAPTERS} gps_l1_ca_dll_pll_c_aid_tracking_fpga.cc)
|
||||
endif(ENABLE_FPGA)
|
||||
|
||||
set(TRACKING_ADAPTER_SOURCES
|
||||
set(TRACKING_ADAPTER_SOURCES
|
||||
galileo_e1_dll_pll_veml_tracking.cc
|
||||
galileo_e1_tcp_connector_tracking.cc
|
||||
gps_l1_ca_dll_pll_tracking.cc
|
||||
@ -37,9 +37,11 @@ set(TRACKING_ADAPTER_SOURCES
|
||||
glonass_l1_ca_dll_pll_c_aid_tracking.cc
|
||||
gps_l5i_dll_pll_tracking.cc
|
||||
gps_l1_ca_kf_tracking.cc
|
||||
glonass_l2_ca_dll_pll_tracking.cc
|
||||
glonass_l2_ca_dll_pll_c_aid_tracking.cc
|
||||
${OPT_TRACKING_ADAPTERS}
|
||||
)
|
||||
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_SOURCE_DIR}/src/core/system_parameters
|
||||
|
@ -51,7 +51,6 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking(
|
||||
//################# CONFIGURATION PARAMETERS ########################
|
||||
int fs_in;
|
||||
int vector_length;
|
||||
int f_if;
|
||||
bool dump;
|
||||
std::string dump_filename;
|
||||
std::string item_type;
|
||||
@ -64,11 +63,9 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking(
|
||||
float very_early_late_space_chips;
|
||||
float early_late_space_narrow_chips;
|
||||
float very_early_late_space_narrow_chips;
|
||||
|
||||
item_type = configuration->property(role + ".item_type", default_item_type);
|
||||
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
f_if = configuration->property(role + ".if", 0);
|
||||
dump = configuration->property(role + ".dump", false);
|
||||
pll_bw_hz = configuration->property(role + ".pll_bw_hz", 5.0);
|
||||
if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast<float>(FLAGS_pll_bw_hz);
|
||||
@ -94,8 +91,9 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking(
|
||||
if (item_type.compare("gr_complex") == 0)
|
||||
{
|
||||
item_size_ = sizeof(gr_complex);
|
||||
tracking_ = galileo_e1_dll_pll_veml_make_tracking_cc(
|
||||
f_if,
|
||||
|
||||
char sig_[3] = "1B";
|
||||
tracking_ = dll_pll_veml_make_tracking(
|
||||
fs_in,
|
||||
vector_length,
|
||||
dump,
|
||||
@ -109,7 +107,7 @@ GalileoE1DllPllVemlTracking::GalileoE1DllPllVemlTracking(
|
||||
early_late_space_narrow_chips,
|
||||
very_early_late_space_narrow_chips,
|
||||
extend_correlation_symbols,
|
||||
track_pilot);
|
||||
track_pilot, 'E', sig_);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -38,7 +38,7 @@
|
||||
#define GNSS_SDR_GALILEO_E1_DLL_PLL_VEML_TRACKING_H_
|
||||
|
||||
#include "tracking_interface.h"
|
||||
#include "galileo_e1_dll_pll_veml_tracking_cc.h"
|
||||
#include "dll_pll_veml_tracking.h"
|
||||
#include <string>
|
||||
|
||||
|
||||
@ -94,7 +94,7 @@ public:
|
||||
void start_tracking() override;
|
||||
|
||||
private:
|
||||
galileo_e1_dll_pll_veml_tracking_cc_sptr tracking_;
|
||||
dll_pll_veml_tracking_sptr tracking_;
|
||||
size_t item_size_;
|
||||
unsigned int channel_;
|
||||
std::string role_;
|
||||
|
@ -39,8 +39,8 @@
|
||||
|
||||
#include "glonass_l1_ca_dll_pll_c_aid_tracking.h"
|
||||
#include "configuration_interface.h"
|
||||
#include "GLONASS_L1_CA.h"
|
||||
#include "gnss_sdr_flags.h"
|
||||
#include "GLONASS_L1_L2_CA.h"
|
||||
#include <glog/logging.h>
|
||||
|
||||
|
||||
|
@ -38,8 +38,8 @@
|
||||
|
||||
#include "glonass_l1_ca_dll_pll_tracking.h"
|
||||
#include "configuration_interface.h"
|
||||
#include "GLONASS_L1_CA.h"
|
||||
#include "gnss_sdr_flags.h"
|
||||
#include "GLONASS_L1_L2_CA.h"
|
||||
#include <glog/logging.h>
|
||||
|
||||
|
||||
|
@ -0,0 +1,241 @@
|
||||
/*!
|
||||
* \file glonass_l2_ca_dll_pll_c_aid_tracking.cc
|
||||
* \brief Interface of an adapter of a DLL+PLL tracking loop block
|
||||
* for Glonass L2 C/A to a TrackingInterface
|
||||
* \author Damian Miralles, 2018. dmiralles2009(at)gmail.com
|
||||
*
|
||||
*
|
||||
* Code DLL + carrier PLL according to the algorithms described in:
|
||||
* K.Borre, D.M.Akos, N.Bertelsen, P.Rinder, and S.H.Jensen,
|
||||
* A Software-Defined GPS and Galileo Receiver. A Single-Frequency
|
||||
* Approach, Birkha user, 2007
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* GNSS-SDR is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNSS-SDR is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "glonass_l2_ca_dll_pll_c_aid_tracking.h"
|
||||
#include "configuration_interface.h"
|
||||
#include "GLONASS_L1_L2_CA.h"
|
||||
#include "gnss_sdr_flags.h"
|
||||
#include <glog/logging.h>
|
||||
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
GlonassL2CaDllPllCAidTracking::GlonassL2CaDllPllCAidTracking(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
DLOG(INFO) << "role " << role;
|
||||
//################# CONFIGURATION PARAMETERS ########################
|
||||
int fs_in;
|
||||
int vector_length;
|
||||
int f_if;
|
||||
bool dump;
|
||||
std::string dump_filename;
|
||||
std::string default_item_type = "gr_complex";
|
||||
float pll_bw_hz;
|
||||
float pll_bw_narrow_hz;
|
||||
float dll_bw_hz;
|
||||
float dll_bw_narrow_hz;
|
||||
float early_late_space_chips;
|
||||
item_type_ = configuration->property(role + ".item_type", default_item_type);
|
||||
//vector_length = configuration->property(role + ".vector_length", 2048);
|
||||
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
f_if = configuration->property(role + ".if", 0);
|
||||
dump = configuration->property(role + ".dump", false);
|
||||
pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0);
|
||||
if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast<float>(FLAGS_pll_bw_hz);
|
||||
dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0);
|
||||
if (FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast<float>(FLAGS_dll_bw_hz);
|
||||
pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", 20.0);
|
||||
dll_bw_narrow_hz = configuration->property(role + ".dll_bw_narrow_hz", 2.0);
|
||||
int extend_correlation_ms;
|
||||
extend_correlation_ms = configuration->property(role + ".extend_correlation_ms", 1);
|
||||
|
||||
early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5);
|
||||
std::string default_dump_filename = "./track_ch";
|
||||
dump_filename = configuration->property(role + ".dump_filename",
|
||||
default_dump_filename); //unused!
|
||||
vector_length = std::round(fs_in / (GLONASS_L2_CA_CODE_RATE_HZ / GLONASS_L2_CA_CODE_LENGTH_CHIPS));
|
||||
|
||||
//################# MAKE TRACKING GNURadio object ###################
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
item_size_ = sizeof(gr_complex);
|
||||
tracking_cc = glonass_l2_ca_dll_pll_c_aid_make_tracking_cc(
|
||||
f_if,
|
||||
fs_in,
|
||||
vector_length,
|
||||
dump,
|
||||
dump_filename,
|
||||
pll_bw_hz,
|
||||
dll_bw_hz,
|
||||
pll_bw_narrow_hz,
|
||||
dll_bw_narrow_hz,
|
||||
extend_correlation_ms,
|
||||
early_late_space_chips);
|
||||
DLOG(INFO) << "tracking(" << tracking_cc->unique_id() << ")";
|
||||
}
|
||||
else if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
item_size_ = sizeof(lv_16sc_t);
|
||||
tracking_sc = glonass_l2_ca_dll_pll_c_aid_make_tracking_sc(
|
||||
f_if,
|
||||
fs_in,
|
||||
vector_length,
|
||||
dump,
|
||||
dump_filename,
|
||||
pll_bw_hz,
|
||||
dll_bw_hz,
|
||||
pll_bw_narrow_hz,
|
||||
dll_bw_narrow_hz,
|
||||
extend_correlation_ms,
|
||||
early_late_space_chips);
|
||||
DLOG(INFO) << "tracking(" << tracking_sc->unique_id() << ")";
|
||||
}
|
||||
else
|
||||
{
|
||||
item_size_ = sizeof(gr_complex);
|
||||
LOG(WARNING) << item_type_ << " unknown tracking item type.";
|
||||
}
|
||||
channel_ = 0;
|
||||
}
|
||||
|
||||
|
||||
GlonassL2CaDllPllCAidTracking::~GlonassL2CaDllPllCAidTracking()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void GlonassL2CaDllPllCAidTracking::start_tracking()
|
||||
{
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
tracking_cc->start_tracking();
|
||||
}
|
||||
else if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
tracking_sc->start_tracking();
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(WARNING) << item_type_ << " unknown tracking item type";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set tracking channel unique ID
|
||||
*/
|
||||
void GlonassL2CaDllPllCAidTracking::set_channel(unsigned int channel)
|
||||
{
|
||||
channel_ = channel;
|
||||
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
tracking_cc->set_channel(channel);
|
||||
}
|
||||
else if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
tracking_sc->set_channel(channel);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(WARNING) << item_type_ << " unknown tracking item type";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GlonassL2CaDllPllCAidTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
|
||||
{
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
tracking_cc->set_gnss_synchro(p_gnss_synchro);
|
||||
}
|
||||
else if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
tracking_sc->set_gnss_synchro(p_gnss_synchro);
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(WARNING) << item_type_ << " unknown tracking item type";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GlonassL2CaDllPllCAidTracking::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (top_block)
|
||||
{ /* top_block is not null */
|
||||
};
|
||||
//nothing to connect, now the tracking uses gr_sync_decimator
|
||||
}
|
||||
|
||||
|
||||
void GlonassL2CaDllPllCAidTracking::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (top_block)
|
||||
{ /* top_block is not null */
|
||||
};
|
||||
//nothing to disconnect, now the tracking uses gr_sync_decimator
|
||||
}
|
||||
|
||||
|
||||
gr::basic_block_sptr GlonassL2CaDllPllCAidTracking::get_left_block()
|
||||
{
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
return tracking_cc;
|
||||
}
|
||||
else if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
return tracking_sc;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(WARNING) << item_type_ << " unknown tracking item type";
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
gr::basic_block_sptr GlonassL2CaDllPllCAidTracking::get_right_block()
|
||||
{
|
||||
if (item_type_.compare("gr_complex") == 0)
|
||||
{
|
||||
return tracking_cc;
|
||||
}
|
||||
else if (item_type_.compare("cshort") == 0)
|
||||
{
|
||||
return tracking_sc;
|
||||
}
|
||||
else
|
||||
{
|
||||
LOG(WARNING) << item_type_ << " unknown tracking item type";
|
||||
return nullptr;
|
||||
}
|
||||
}
|
@ -0,0 +1,106 @@
|
||||
/*!
|
||||
* \file glonass_l2_ca_dll_pll_c_aid_tracking.h
|
||||
* \brief Interface of an adapter of a DLL+PLL tracking loop block
|
||||
* for Glonass L2 C/A to a TrackingInterface
|
||||
* \author Damian Miralles, 2018. dmiralles2009(at)gmail.com
|
||||
*
|
||||
*
|
||||
* Code DLL + carrier PLL according to the algorithms described in:
|
||||
* K.Borre, D.M.Akos, N.Bertelsen, P.Rinder, and S.H.Jensen,
|
||||
* A Software-Defined GPS and Galileo Receiver. A Single-Frequency
|
||||
* Approach, Birkha user, 2007
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* GNSS-SDR is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNSS-SDR is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef GNSS_SDR_GLONASS_L2_CA_DLL_PLL_C_AID_TRACKING_H_
|
||||
#define GNSS_SDR_GLONASS_L2_CA_DLL_PLL_C_AID_TRACKING_H_
|
||||
|
||||
#include "tracking_interface.h"
|
||||
#include "glonass_l2_ca_dll_pll_c_aid_tracking_cc.h"
|
||||
#include "glonass_l2_ca_dll_pll_c_aid_tracking_sc.h"
|
||||
#include <string>
|
||||
|
||||
class ConfigurationInterface;
|
||||
|
||||
/*!
|
||||
* \brief This class implements a code DLL + carrier PLL tracking loop
|
||||
*/
|
||||
class GlonassL2CaDllPllCAidTracking : public TrackingInterface
|
||||
{
|
||||
public:
|
||||
GlonassL2CaDllPllCAidTracking(ConfigurationInterface* configuration,
|
||||
std::string role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams);
|
||||
|
||||
virtual ~GlonassL2CaDllPllCAidTracking();
|
||||
|
||||
inline std::string role() override
|
||||
{
|
||||
return role_;
|
||||
}
|
||||
|
||||
//! Returns "GLONASS_L2_CA_DLL_PLL_C_Aid_Tracking"
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "GLONASS_L2_CA_DLL_PLL_C_Aid_Tracking";
|
||||
}
|
||||
|
||||
inline size_t item_size() override
|
||||
{
|
||||
return item_size_;
|
||||
}
|
||||
|
||||
void connect(gr::top_block_sptr top_block) override;
|
||||
void disconnect(gr::top_block_sptr top_block) override;
|
||||
gr::basic_block_sptr get_left_block() override;
|
||||
gr::basic_block_sptr get_right_block() override;
|
||||
|
||||
/*!
|
||||
* \brief Set tracking channel unique ID
|
||||
*/
|
||||
void set_channel(unsigned int channel) override;
|
||||
|
||||
/*!
|
||||
* \brief Set acquisition/tracking common Gnss_Synchro object pointer
|
||||
* to efficiently exchange synchronization data between acquisition and tracking blocks
|
||||
*/
|
||||
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
||||
|
||||
void start_tracking() override;
|
||||
|
||||
private:
|
||||
glonass_l2_ca_dll_pll_c_aid_tracking_cc_sptr tracking_cc;
|
||||
glonass_l2_ca_dll_pll_c_aid_tracking_sc_sptr tracking_sc;
|
||||
size_t item_size_;
|
||||
std::string item_type_;
|
||||
unsigned int channel_;
|
||||
std::string role_;
|
||||
unsigned int in_streams_;
|
||||
unsigned int out_streams_;
|
||||
};
|
||||
|
||||
#endif // GNSS_SDR_GLONASS_L2_CA_DLL_PLL_C_AID_TRACKING_H_
|
@ -0,0 +1,154 @@
|
||||
/*!
|
||||
* \file glonass_l2_ca_dll_pll_tracking.cc
|
||||
* \brief Interface of an adapter of a DLL+PLL tracking loop block
|
||||
* for Glonass L2 C/A to a TrackingInterface
|
||||
* \author Damian Miralles, 2018, dmiralles2009(at)gmail.com *
|
||||
*
|
||||
* Code DLL + carrier PLL according to the algorithms described in:
|
||||
* K.Borre, D.M.Akos, N.Bertelsen, P.Rinder, and S.H.Jensen,
|
||||
* A Software-Defined GPS and Galileo Receiver. A Single-Frequency
|
||||
* Approach, Birkha user, 2007
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* GNSS-SDR is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNSS-SDR is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "glonass_l2_ca_dll_pll_tracking.h"
|
||||
#include "configuration_interface.h"
|
||||
#include "GLONASS_L1_L2_CA.h"
|
||||
#include "gnss_sdr_flags.h"
|
||||
#include <glog/logging.h>
|
||||
|
||||
|
||||
using google::LogMessage;
|
||||
|
||||
GlonassL2CaDllPllTracking::GlonassL2CaDllPllTracking(
|
||||
ConfigurationInterface* configuration, std::string role,
|
||||
unsigned int in_streams, unsigned int out_streams) : role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
||||
{
|
||||
DLOG(INFO) << "role " << role;
|
||||
//################# CONFIGURATION PARAMETERS ########################
|
||||
int fs_in;
|
||||
int vector_length;
|
||||
int f_if;
|
||||
bool dump;
|
||||
std::string dump_filename;
|
||||
std::string item_type;
|
||||
std::string default_item_type = "gr_complex";
|
||||
float pll_bw_hz;
|
||||
float dll_bw_hz;
|
||||
float early_late_space_chips;
|
||||
item_type = configuration->property(role + ".item_type", default_item_type);
|
||||
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
f_if = configuration->property(role + ".if", 0);
|
||||
dump = configuration->property(role + ".dump", false);
|
||||
pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0);
|
||||
if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast<float>(FLAGS_pll_bw_hz);
|
||||
dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0);
|
||||
if (FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast<float>(FLAGS_dll_bw_hz);
|
||||
early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5);
|
||||
std::string default_dump_filename = "./track_ch";
|
||||
dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); //unused!
|
||||
vector_length = std::round(fs_in / (GLONASS_L2_CA_CODE_RATE_HZ / GLONASS_L2_CA_CODE_LENGTH_CHIPS));
|
||||
|
||||
//################# MAKE TRACKING GNURadio object ###################
|
||||
if (item_type.compare("gr_complex") == 0)
|
||||
{
|
||||
item_size_ = sizeof(gr_complex);
|
||||
tracking_ = glonass_l2_ca_dll_pll_make_tracking_cc(
|
||||
f_if,
|
||||
fs_in,
|
||||
vector_length,
|
||||
dump,
|
||||
dump_filename,
|
||||
pll_bw_hz,
|
||||
dll_bw_hz,
|
||||
early_late_space_chips);
|
||||
}
|
||||
else
|
||||
{
|
||||
item_size_ = sizeof(gr_complex);
|
||||
LOG(WARNING) << item_type << " unknown tracking item type.";
|
||||
}
|
||||
channel_ = 0;
|
||||
DLOG(INFO) << "tracking(" << tracking_->unique_id() << ")";
|
||||
}
|
||||
|
||||
|
||||
GlonassL2CaDllPllTracking::~GlonassL2CaDllPllTracking()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void GlonassL2CaDllPllTracking::start_tracking()
|
||||
{
|
||||
tracking_->start_tracking();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Set tracking channel unique ID
|
||||
*/
|
||||
void GlonassL2CaDllPllTracking::set_channel(unsigned int channel)
|
||||
{
|
||||
channel_ = channel;
|
||||
tracking_->set_channel(channel);
|
||||
}
|
||||
|
||||
|
||||
void GlonassL2CaDllPllTracking::set_gnss_synchro(Gnss_Synchro* p_gnss_synchro)
|
||||
{
|
||||
tracking_->set_gnss_synchro(p_gnss_synchro);
|
||||
}
|
||||
|
||||
|
||||
void GlonassL2CaDllPllTracking::connect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (top_block)
|
||||
{ /* top_block is not null */
|
||||
};
|
||||
//nothing to connect, now the tracking uses gr_sync_decimator
|
||||
}
|
||||
|
||||
|
||||
void GlonassL2CaDllPllTracking::disconnect(gr::top_block_sptr top_block)
|
||||
{
|
||||
if (top_block)
|
||||
{ /* top_block is not null */
|
||||
};
|
||||
//nothing to disconnect, now the tracking uses gr_sync_decimator
|
||||
}
|
||||
|
||||
|
||||
gr::basic_block_sptr GlonassL2CaDllPllTracking::get_left_block()
|
||||
{
|
||||
return tracking_;
|
||||
}
|
||||
|
||||
|
||||
gr::basic_block_sptr GlonassL2CaDllPllTracking::get_right_block()
|
||||
{
|
||||
return tracking_;
|
||||
}
|
@ -0,0 +1,103 @@
|
||||
/*!
|
||||
* \file glonass_l2_ca_dll_pll_tracking.h
|
||||
* \brief Interface of an adapter of a DLL+PLL tracking loop block
|
||||
* for Glonass L2 C/A to a TrackingInterface
|
||||
* \author Damian Miralles, 2018, dmiralles2009(at)gmail.com
|
||||
*
|
||||
*
|
||||
* Code DLL + carrier PLL according to the algorithms described in:
|
||||
* K.Borre, D.M.Akos, N.Bertelsen, P.Rinder, and S.H.Jensen,
|
||||
* A Software-Defined GPS and Galileo Receiver. A Single-Frequency
|
||||
* Approach, Birkha user, 2007
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
*
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* GNSS-SDR is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* GNSS-SDR is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with GNSS-SDR. If not, see <http://www.gnu.org/licenses/>.
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef GNSS_SDR_GLONASS_L2_CA_DLL_PLL_TRACKING_H_
|
||||
#define GNSS_SDR_GLONASS_L2_CA_DLL_PLL_TRACKING_H_
|
||||
|
||||
#include "tracking_interface.h"
|
||||
#include "glonass_l2_ca_dll_pll_tracking_cc.h"
|
||||
#include <string>
|
||||
|
||||
class ConfigurationInterface;
|
||||
|
||||
/*!
|
||||
* \brief This class implements a code DLL + carrier PLL tracking loop
|
||||
*/
|
||||
class GlonassL2CaDllPllTracking : public TrackingInterface
|
||||
{
|
||||
public:
|
||||
GlonassL2CaDllPllTracking(ConfigurationInterface* configuration,
|
||||
std::string role,
|
||||
unsigned int in_streams,
|
||||
unsigned int out_streams);
|
||||
|
||||
virtual ~GlonassL2CaDllPllTracking();
|
||||
|
||||
inline std::string role() override
|
||||
{
|
||||
return role_;
|
||||
}
|
||||
|
||||
//! Returns "GLONASS_L1_CA_DLL_PLL_Tracking"
|
||||
inline std::string implementation() override
|
||||
{
|
||||
return "GLONASS_L2_CA_DLL_PLL_Tracking";
|
||||
}
|
||||
|
||||
inline size_t item_size() override
|
||||
{
|
||||
return item_size_;
|
||||
}
|
||||
|
||||
void connect(gr::top_block_sptr top_block) override;
|
||||
void disconnect(gr::top_block_sptr top_block) override;
|
||||
gr::basic_block_sptr get_left_block() override;
|
||||
gr::basic_block_sptr get_right_block() override;
|
||||
|
||||
/*!
|
||||
* \brief Set tracking channel unique ID
|
||||
*/
|
||||
void set_channel(unsigned int channel) override;
|
||||
|
||||
/*!
|
||||
* \brief Set acquisition/tracking common Gnss_Synchro object pointer
|
||||
* to efficiently exchange synchronization data between acquisition and tracking blocks
|
||||
*/
|
||||
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro) override;
|
||||
|
||||
void start_tracking() override;
|
||||
|
||||
private:
|
||||
glonass_l2_ca_dll_pll_tracking_cc_sptr tracking_;
|
||||
size_t item_size_;
|
||||
unsigned int channel_;
|
||||
std::string role_;
|
||||
unsigned int in_streams_;
|
||||
unsigned int out_streams_;
|
||||
};
|
||||
|
||||
#endif // GNSS_SDR_GLONASS_L2_CA_DLL_PLL_TRACKING_H_
|
@ -52,41 +52,48 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking(
|
||||
//################# CONFIGURATION PARAMETERS ########################
|
||||
int fs_in;
|
||||
int vector_length;
|
||||
int f_if;
|
||||
bool dump;
|
||||
std::string dump_filename;
|
||||
std::string item_type;
|
||||
std::string default_item_type = "gr_complex";
|
||||
float pll_bw_hz;
|
||||
float dll_bw_hz;
|
||||
float early_late_space_chips;
|
||||
item_type = configuration->property(role + ".item_type", default_item_type);
|
||||
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
f_if = configuration->property(role + ".if", 0);
|
||||
dump = configuration->property(role + ".dump", false);
|
||||
pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0);
|
||||
float pll_bw_hz = configuration->property(role + ".pll_bw_hz", 50.0);
|
||||
if (FLAGS_pll_bw_hz != 0.0) pll_bw_hz = static_cast<float>(FLAGS_pll_bw_hz);
|
||||
dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0);
|
||||
float pll_bw_narrow_hz = configuration->property(role + ".pll_bw_narrow_hz", 20.0);
|
||||
float dll_bw_narrow_hz = configuration->property(role + ".dll_bw_narrow_hz", 2.0);
|
||||
float dll_bw_hz = configuration->property(role + ".dll_bw_hz", 2.0);
|
||||
if (FLAGS_dll_bw_hz != 0.0) dll_bw_hz = static_cast<float>(FLAGS_dll_bw_hz);
|
||||
early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5);
|
||||
float early_late_space_chips = configuration->property(role + ".early_late_space_chips", 0.5);
|
||||
float early_late_space_narrow_chips = configuration->property(role + ".early_late_space_narrow_chips", 0.5);
|
||||
std::string default_dump_filename = "./track_ch";
|
||||
dump_filename = configuration->property(role + ".dump_filename", default_dump_filename); //unused!
|
||||
vector_length = std::round(fs_in / (GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS));
|
||||
|
||||
int symbols_extended_correlator = configuration->property(role + ".extend_correlation_symbols", 1);
|
||||
if (symbols_extended_correlator < 1) symbols_extended_correlator = 1;
|
||||
//################# MAKE TRACKING GNURadio object ###################
|
||||
if (item_type.compare("gr_complex") == 0)
|
||||
{
|
||||
item_size_ = sizeof(gr_complex);
|
||||
tracking_ = gps_l1_ca_dll_pll_make_tracking_cc(
|
||||
f_if,
|
||||
char sig_[3] = "1C";
|
||||
tracking_ = dll_pll_veml_make_tracking(
|
||||
fs_in,
|
||||
vector_length,
|
||||
dump,
|
||||
dump_filename,
|
||||
pll_bw_hz,
|
||||
dll_bw_hz,
|
||||
early_late_space_chips);
|
||||
pll_bw_narrow_hz,
|
||||
dll_bw_narrow_hz,
|
||||
early_late_space_chips,
|
||||
early_late_space_chips,
|
||||
early_late_space_narrow_chips,
|
||||
early_late_space_narrow_chips,
|
||||
symbols_extended_correlator,
|
||||
false,
|
||||
'G', sig_);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -39,7 +39,7 @@
|
||||
#define GNSS_SDR_GPS_L1_CA_DLL_PLL_TRACKING_H_
|
||||
|
||||
#include "tracking_interface.h"
|
||||
#include "gps_l1_ca_dll_pll_tracking_cc.h"
|
||||
#include "dll_pll_veml_tracking.h"
|
||||
#include <string>
|
||||
|
||||
class ConfigurationInterface;
|
||||
@ -92,7 +92,7 @@ public:
|
||||
void start_tracking() override;
|
||||
|
||||
private:
|
||||
gps_l1_ca_dll_pll_tracking_cc_sptr tracking_;
|
||||
dll_pll_veml_tracking_sptr tracking_;
|
||||
size_t item_size_;
|
||||
unsigned int channel_;
|
||||
std::string role_;
|
||||
|
@ -19,7 +19,7 @@
|
||||
if(ENABLE_CUDA)
|
||||
set(OPT_TRACKING_BLOCKS ${OPT_TRACKING_BLOCKS} gps_l1_ca_dll_pll_tracking_gpu_cc.cc)
|
||||
set(OPT_TRACKING_INCLUDES ${OPT_TRACKING_INCLUDES} ${CUDA_INCLUDE_DIRS})
|
||||
set(OPT_TRACKING_LIBRARIES ${OPT_TRACKING_LIBRARIES} ${CUDA_LIBRARIES})
|
||||
set(OPT_TRACKING_LIBRARIES ${OPT_TRACKING_LIBRARIES} ${CUDA_LIBRARIES})
|
||||
endif(ENABLE_CUDA)
|
||||
|
||||
if(ENABLE_FPGA)
|
||||
@ -27,9 +27,7 @@ if(ENABLE_FPGA)
|
||||
endif(ENABLE_FPGA)
|
||||
|
||||
set(TRACKING_GR_BLOCKS_SOURCES
|
||||
galileo_e1_dll_pll_veml_tracking_cc.cc
|
||||
galileo_e1_tcp_connector_tracking_cc.cc
|
||||
gps_l1_ca_dll_pll_tracking_cc.cc
|
||||
gps_l1_ca_tcp_connector_tracking_cc.cc
|
||||
galileo_e5a_dll_pll_tracking_cc.cc
|
||||
gps_l2_m_dll_pll_tracking_cc.cc
|
||||
|
1532
src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc
Executable file
1532
src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc
Executable file
File diff suppressed because it is too large
Load Diff
@ -1,12 +1,11 @@
|
||||
/*!
|
||||
* \file galileo_e1_dll_pll_veml_tracking_cc.h
|
||||
* \brief Implementation of a code DLL + carrier PLL VEML (Very Early
|
||||
* Minus Late) tracking block for Galileo E1 signals
|
||||
* \author Luis Esteve, 2012. luis(at)epsilon-formacion.com
|
||||
* \file dll_pll_veml_tracking.h
|
||||
* \brief Implementation of a code DLL + carrier PLL tracking block.
|
||||
* \author Antonio Ramos, 2018 antonio.ramosdet(at)gmail.com
|
||||
*
|
||||
* -------------------------------------------------------------------------
|
||||
*
|
||||
* Copyright (C) 2010-2017 (see AUTHORS file for a list of contributors)
|
||||
* Copyright (C) 2010-2018 (see AUTHORS file for a list of contributors)
|
||||
*
|
||||
* GNSS-SDR is a software defined Global Navigation
|
||||
* Satellite Systems receiver
|
||||
@ -29,8 +28,8 @@
|
||||
* -------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef GNSS_SDR_GALILEO_E1_DLL_PLL_VEML_TRACKING_CC_H
|
||||
#define GNSS_SDR_GALILEO_E1_DLL_PLL_VEML_TRACKING_CC_H
|
||||
#ifndef GNSS_SDR_DLL_PLL_VEML_TRACKING_H
|
||||
#define GNSS_SDR_DLL_PLL_VEML_TRACKING_H
|
||||
|
||||
#include "gnss_synchro.h"
|
||||
#include "tracking_2nd_DLL_filter.h"
|
||||
@ -39,72 +38,50 @@
|
||||
#include <gnuradio/block.h>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <map>
|
||||
|
||||
|
||||
class galileo_e1_dll_pll_veml_tracking_cc;
|
||||
class dll_pll_veml_tracking;
|
||||
|
||||
typedef boost::shared_ptr<galileo_e1_dll_pll_veml_tracking_cc> galileo_e1_dll_pll_veml_tracking_cc_sptr;
|
||||
typedef boost::shared_ptr<dll_pll_veml_tracking> dll_pll_veml_tracking_sptr;
|
||||
|
||||
galileo_e1_dll_pll_veml_tracking_cc_sptr
|
||||
galileo_e1_dll_pll_veml_make_tracking_cc(long if_freq,
|
||||
long fs_in, unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
float pll_bw_hz,
|
||||
float dll_bw_hz,
|
||||
float pll_bw_narrow_hz,
|
||||
float dll_bw_narrow_hz,
|
||||
float early_late_space_chips,
|
||||
float very_early_late_space_chips,
|
||||
dll_pll_veml_tracking_sptr dll_pll_veml_make_tracking(double fs_in, unsigned int vector_length,
|
||||
bool dump, std::string dump_filename,
|
||||
float pll_bw_hz, float dll_bw_hz,
|
||||
float pll_bw_narrow_hz, float dll_bw_narrow_hz,
|
||||
float early_late_space_chips, float very_early_late_space_chips,
|
||||
float early_late_space_narrow_chips,
|
||||
float very_early_late_space_narrow_chips,
|
||||
int extend_correlation_symbols,
|
||||
bool track_pilot);
|
||||
int extend_correlation_symbols, bool track_pilot,
|
||||
char system, char signal[3]);
|
||||
|
||||
/*!
|
||||
* \brief This class implements a code DLL + carrier PLL VEML (Very Early
|
||||
* Minus Late) tracking block for Galileo E1 signals
|
||||
* \brief This class implements a code DLL + carrier PLL tracking block.
|
||||
*/
|
||||
class galileo_e1_dll_pll_veml_tracking_cc : public gr::block
|
||||
class dll_pll_veml_tracking : public gr::block
|
||||
{
|
||||
public:
|
||||
~galileo_e1_dll_pll_veml_tracking_cc();
|
||||
~dll_pll_veml_tracking();
|
||||
|
||||
void set_channel(unsigned int channel);
|
||||
void set_gnss_synchro(Gnss_Synchro *p_gnss_synchro);
|
||||
void start_tracking();
|
||||
|
||||
/*!
|
||||
* \brief Code DLL + carrier PLL according to the algorithms described in:
|
||||
* K.Borre, D.M.Akos, N.Bertelsen, P.Rinder, and S.H.Jensen,
|
||||
* A Software-Defined GPS and Galileo Receiver. A Single-Frequency Approach,
|
||||
* Birkhauser, 2007
|
||||
*/
|
||||
int general_work(int noutput_items, gr_vector_int &ninput_items,
|
||||
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
|
||||
|
||||
void forecast(int noutput_items, gr_vector_int &ninput_items_required);
|
||||
|
||||
private:
|
||||
friend galileo_e1_dll_pll_veml_tracking_cc_sptr
|
||||
galileo_e1_dll_pll_veml_make_tracking_cc(long if_freq,
|
||||
long fs_in, unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
float pll_bw_hz,
|
||||
float dll_bw_hz,
|
||||
float pll_bw_narrow_hz,
|
||||
float dll_bw_narrow_hz,
|
||||
float early_late_space_chips,
|
||||
float very_early_late_space_chips,
|
||||
float early_late_space_narrow_chips,
|
||||
friend dll_pll_veml_tracking_sptr dll_pll_veml_make_tracking(double fs_in, unsigned int vector_length,
|
||||
bool dump, std::string dump_filename,
|
||||
float pll_bw_hz, float dll_bw_hz, float pll_bw_narrow_hz,
|
||||
float dll_bw_narrow_hz, float early_late_space_chips,
|
||||
float very_early_late_space_chips, float early_late_space_narrow_chips,
|
||||
float very_early_late_space_narrow_chips,
|
||||
int extend_correlation_symbols,
|
||||
bool track_pilot);
|
||||
int extend_correlation_symbols, bool track_pilot,
|
||||
char system, char signal[3]);
|
||||
|
||||
galileo_e1_dll_pll_veml_tracking_cc(long if_freq,
|
||||
long fs_in, unsigned int vector_length,
|
||||
dll_pll_veml_tracking(double fs_in, unsigned int vector_length,
|
||||
bool dump,
|
||||
std::string dump_filename,
|
||||
float pll_bw_hz,
|
||||
@ -116,61 +93,74 @@ private:
|
||||
float early_late_space_narrow_chips,
|
||||
float very_early_late_space_narrow_chips,
|
||||
int extend_correlation_symbols,
|
||||
bool track_pilot);
|
||||
bool track_pilot,
|
||||
char system, char signal[3]);
|
||||
|
||||
bool cn0_and_tracking_lock_status();
|
||||
void do_correlation_step(const gr_complex *input_samples);
|
||||
void run_dll_pll(bool disable_costas_loop);
|
||||
void update_local_code();
|
||||
void update_local_carrier();
|
||||
bool acquire_secondary();
|
||||
|
||||
void do_correlation_step(const gr_complex *input_samples);
|
||||
void run_dll_pll();
|
||||
void update_tracking_vars();
|
||||
void clear_tracking_vars();
|
||||
|
||||
void log_data();
|
||||
void save_correlation_results();
|
||||
void log_data(bool integrating);
|
||||
int save_matfile();
|
||||
|
||||
// tracking configuration vars
|
||||
unsigned int d_vector_length;
|
||||
bool d_dump;
|
||||
|
||||
Gnss_Synchro *d_acquisition_gnss_synchro;
|
||||
bool d_veml;
|
||||
bool d_cloop;
|
||||
unsigned int d_vector_length;
|
||||
unsigned int d_channel;
|
||||
long d_if_freq;
|
||||
long d_fs_in;
|
||||
double d_fs_in;
|
||||
Gnss_Synchro *d_acquisition_gnss_synchro;
|
||||
|
||||
//Signal parameters
|
||||
bool d_secondary;
|
||||
bool interchange_iq;
|
||||
double d_signal_carrier_freq;
|
||||
double d_code_period;
|
||||
double d_code_chip_rate;
|
||||
unsigned int d_secondary_code_length;
|
||||
unsigned int d_code_length_chips;
|
||||
unsigned int d_code_samples_per_chip; // All signals have 1 sample per chip code except Gal. E1 which has 2 (CBOC disabled) or 12 (CBOC enabled)
|
||||
int d_symbols_per_bit;
|
||||
std::string systemName;
|
||||
std::string signal_type;
|
||||
std::string *d_secondary_code_string;
|
||||
|
||||
//tracking state machine
|
||||
int d_state;
|
||||
|
||||
bool d_synchonizing;
|
||||
//Integration period in samples
|
||||
int d_correlation_length_samples;
|
||||
int d_correlation_length_ms;
|
||||
int d_n_correlator_taps;
|
||||
double d_early_late_spc_chips;
|
||||
double d_very_early_late_spc_chips;
|
||||
|
||||
double d_early_late_spc_narrow_chips;
|
||||
double d_very_early_late_spc_narrow_chips;
|
||||
float d_early_late_spc_chips;
|
||||
float d_very_early_late_spc_chips;
|
||||
float d_early_late_spc_narrow_chips;
|
||||
float d_very_early_late_spc_narrow_chips;
|
||||
|
||||
float *d_tracking_code;
|
||||
float *d_data_code;
|
||||
float *d_local_code_shift_chips;
|
||||
gr_complex *d_correlator_outs;
|
||||
float *d_prompt_data_shift;
|
||||
cpu_multicorrelator_real_codes multicorrelator_cpu;
|
||||
//todo: currently the multicorrelator does not support adding extra correlator
|
||||
//with different local code, thus we need extra multicorrelator instance.
|
||||
//Implement this functionality inside multicorrelator class
|
||||
//as an enhancement to increase the performance
|
||||
float *d_local_code_data_shift_chips;
|
||||
cpu_multicorrelator_real_codes correlator_data_cpu; //for data channel
|
||||
|
||||
/* TODO: currently the multicorrelator does not support adding extra correlator
|
||||
with different local code, thus we need extra multicorrelator instance.
|
||||
Implement this functionality inside multicorrelator class
|
||||
as an enhancement to increase the performance
|
||||
*/
|
||||
gr_complex *d_correlator_outs;
|
||||
gr_complex *d_Very_Early;
|
||||
gr_complex *d_Early;
|
||||
gr_complex *d_Prompt;
|
||||
gr_complex *d_Late;
|
||||
gr_complex *d_Very_Late;
|
||||
|
||||
bool d_enable_extended_integration;
|
||||
int d_extend_correlation_symbols;
|
||||
int d_extend_correlation_symbols_count;
|
||||
bool d_enable_extended_integration;
|
||||
int d_current_symbol;
|
||||
|
||||
gr_complex d_VE_accu;
|
||||
@ -178,6 +168,7 @@ private:
|
||||
gr_complex d_P_accu;
|
||||
gr_complex d_L_accu;
|
||||
gr_complex d_VL_accu;
|
||||
gr_complex d_last_prompt;
|
||||
|
||||
bool d_track_pilot;
|
||||
gr_complex *d_Prompt_Data;
|
||||
@ -206,39 +197,34 @@ private:
|
||||
double d_carr_error_filt_hz;
|
||||
double d_code_error_chips;
|
||||
double d_code_error_filt_chips;
|
||||
|
||||
double d_K_blk_samples;
|
||||
|
||||
double d_code_freq_chips;
|
||||
double d_carrier_doppler_hz;
|
||||
double d_acc_carrier_phase_rad;
|
||||
double d_rem_code_phase_chips;
|
||||
double d_code_phase_samples;
|
||||
|
||||
//PRN period in samples
|
||||
double T_chip_seconds;
|
||||
double T_prn_seconds;
|
||||
double T_prn_samples;
|
||||
double K_blk_samples;
|
||||
// PRN period in samples
|
||||
int d_current_prn_length_samples;
|
||||
|
||||
//processing samples counters
|
||||
// processing samples counters
|
||||
unsigned long int d_sample_counter;
|
||||
unsigned long int d_acq_sample_stamp;
|
||||
|
||||
// CN0 estimation and lock detector
|
||||
int d_cn0_estimation_counter;
|
||||
std::deque<gr_complex> d_Prompt_buffer_deque;
|
||||
gr_complex *d_Prompt_buffer;
|
||||
int d_carrier_lock_fail_counter;
|
||||
double d_carrier_lock_test;
|
||||
double d_CN0_SNV_dB_Hz;
|
||||
double d_carrier_lock_threshold;
|
||||
int d_carrier_lock_fail_counter;
|
||||
std::deque<gr_complex> d_Prompt_buffer_deque;
|
||||
gr_complex *d_Prompt_buffer;
|
||||
|
||||
// file dump
|
||||
std::string d_dump_filename;
|
||||
std::ofstream d_dump_file;
|
||||
|
||||
std::map<std::string, std::string> systemName;
|
||||
std::string sys;
|
||||
|
||||
int save_matfile();
|
||||
};
|
||||
|
||||
#endif //GNSS_SDR_GALILEO_E1_DLL_PLL_VEML_TRACKING_CC_H
|
||||
#endif // GNSS_SDR_DLL_PLL_VEML_TRACKING_H
|
File diff suppressed because it is too large
Load Diff
@ -355,13 +355,13 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri
|
||||
code_error_filt_secs = (Galileo_E1_CODE_PERIOD * code_error_filt_chips) / Galileo_E1_CODE_CHIP_RATE_HZ; //[seconds]
|
||||
d_acc_code_phase_secs = d_acc_code_phase_secs + code_error_filt_secs;
|
||||
|
||||
// ################## CARRIER AND CODE NCO BUFFER ALIGNEMENT #######################
|
||||
// ################## CARRIER AND CODE NCO BUFFER ALIGNMENT #######################
|
||||
// keep alignment parameters for the next input buffer
|
||||
double T_chip_seconds;
|
||||
double T_prn_seconds;
|
||||
double T_prn_samples;
|
||||
double K_blk_samples;
|
||||
// Compute the next buffer lenght based in the new period of the PRN sequence and the code phase error estimation
|
||||
// Compute the next buffer length based in the new period of the PRN sequence and the code phase error estimation
|
||||
T_chip_seconds = 1 / static_cast<double>(d_code_freq_chips);
|
||||
T_prn_seconds = T_chip_seconds * Galileo_E1_B_CODE_LENGTH_CHIPS;
|
||||
T_prn_samples = T_prn_seconds * static_cast<double>(d_fs_in);
|
||||
@ -443,21 +443,18 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri
|
||||
// MULTIPLEXED FILE RECORDING - Record results to file
|
||||
float prompt_I;
|
||||
float prompt_Q;
|
||||
float tmp_VE, tmp_E, tmp_P, tmp_L, tmp_VL;
|
||||
float tmp_E, tmp_P, tmp_L;
|
||||
float tmp_VE = 0.0;
|
||||
float tmp_VL = 0.0;
|
||||
float tmp_float;
|
||||
tmp_float = 0;
|
||||
double tmp_double;
|
||||
prompt_I = (*d_Prompt).real();
|
||||
prompt_Q = (*d_Prompt).imag();
|
||||
tmp_VE = std::abs<float>(*d_Very_Early);
|
||||
tmp_E = std::abs<float>(*d_Early);
|
||||
tmp_P = std::abs<float>(*d_Prompt);
|
||||
tmp_L = std::abs<float>(*d_Late);
|
||||
tmp_VL = std::abs<float>(*d_Very_Late);
|
||||
|
||||
prompt_I = d_correlator_outs[1].real();
|
||||
prompt_Q = d_correlator_outs[1].imag();
|
||||
tmp_E = std::abs<float>(d_correlator_outs[0]);
|
||||
tmp_P = std::abs<float>(d_correlator_outs[1]);
|
||||
tmp_L = std::abs<float>(d_correlator_outs[2]);
|
||||
try
|
||||
{
|
||||
// EPR
|
||||
// Dump correlators output
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_VE), sizeof(float));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_E), sizeof(float));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_P), sizeof(float));
|
||||
@ -469,30 +466,33 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work(int noutput_items __attri
|
||||
// PRN start sample stamp
|
||||
d_dump_file.write(reinterpret_cast<char *>(&d_sample_counter), sizeof(unsigned long int));
|
||||
// accumulated carrier phase
|
||||
d_dump_file.write(reinterpret_cast<char *>(&d_acc_carrier_phase_rad), sizeof(float));
|
||||
|
||||
tmp_float = d_acc_carrier_phase_rad;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));
|
||||
// carrier and code frequency
|
||||
d_dump_file.write(reinterpret_cast<char *>(&d_carrier_doppler_hz), sizeof(float));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&d_code_freq_chips), sizeof(float));
|
||||
|
||||
//PLL commands
|
||||
tmp_float = d_carrier_doppler_hz;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&carr_error_filt_hz), sizeof(float));
|
||||
|
||||
//DLL commands
|
||||
tmp_float = d_code_freq_chips;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));
|
||||
// PLL commands
|
||||
tmp_float = 0.0;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));
|
||||
tmp_float = carr_error_filt_hz;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));
|
||||
// DLL commands
|
||||
tmp_float = 0.0;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));
|
||||
tmp_float = code_error_filt_chips;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&code_error_filt_chips), sizeof(float));
|
||||
|
||||
// CN0 and carrier lock test
|
||||
d_dump_file.write(reinterpret_cast<char *>(&d_CN0_SNV_dB_Hz), sizeof(float));
|
||||
d_dump_file.write(reinterpret_cast<char *>(&d_carrier_lock_test), sizeof(float));
|
||||
|
||||
// AUX vars (for debug purposes)
|
||||
tmp_float = d_rem_code_phase_samples;
|
||||
tmp_float = d_CN0_SNV_dB_Hz;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));
|
||||
tmp_double = static_cast<double>(d_sample_counter + d_current_prn_length_samples);
|
||||
tmp_float = d_carrier_lock_test;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));
|
||||
// AUX vars (for debug purposes)
|
||||
tmp_float = 0.0;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));
|
||||
double tmp_double = static_cast<double>(d_sample_counter + d_correlation_length_samples);
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_double), sizeof(double));
|
||||
|
||||
// PRN
|
||||
unsigned int prn_ = d_acquisition_gnss_synchro->PRN;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&prn_), sizeof(unsigned int));
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user