2011-11-22 17:21:54 +00:00
|
|
|
/*!
|
|
|
|
* \file gps_l1_ca_dll_fll_pll_tracking_cc.h
|
2011-12-28 21:36:45 +00:00
|
|
|
* \brief Interface of a code DLL + carrier FLL/PLL tracking block
|
2011-11-22 17:21:54 +00:00
|
|
|
* \author Javier Arribas, 2011. jarribas(at)cttc.es
|
|
|
|
*
|
2011-12-28 21:36:45 +00:00
|
|
|
* This is the interface of a code Delay Locked Loop (DLL) +
|
|
|
|
* carrier Phase Locked Loop (PLL) helped with a carrier Frequency Locked
|
|
|
|
* Loop (FLL) according to the algorithms described in:
|
|
|
|
* E.D. Kaplan and C. Hegarty, Understanding GPS. Principles and
|
2011-11-22 17:21:54 +00:00
|
|
|
* Applications, Second Edition, Artech House Publishers, 2005.
|
|
|
|
*
|
|
|
|
* -------------------------------------------------------------------------
|
|
|
|
*
|
2014-01-12 20:07:38 +00:00
|
|
|
* Copyright (C) 2010-2014 (see AUTHORS file for a list of contributors)
|
2011-11-22 17:21:54 +00:00
|
|
|
*
|
|
|
|
* 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/>.
|
|
|
|
*
|
|
|
|
* -------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
2011-12-28 03:05:37 +00:00
|
|
|
#ifndef GNSS_SDR_GPS_L1_CA_DLL_FLL_PLL_TRACKING_CC_H
|
|
|
|
#define GNSS_SDR_GPS_L1_CA_DLL_FLL_PLL_TRACKING_CC_H
|
2011-11-22 17:21:54 +00:00
|
|
|
|
|
|
|
#include <fstream>
|
2012-01-19 19:30:05 +00:00
|
|
|
#include <queue>
|
2014-01-12 20:07:38 +00:00
|
|
|
#include <map>
|
|
|
|
#include <string>
|
2012-01-19 19:30:05 +00:00
|
|
|
#include <boost/thread/mutex.hpp>
|
|
|
|
#include <boost/thread/thread.hpp>
|
2013-07-04 13:47:40 +00:00
|
|
|
#include <gnuradio/block.h>
|
|
|
|
#include <gnuradio/msg_queue.h>
|
2012-01-19 19:30:05 +00:00
|
|
|
#include "concurrent_queue.h"
|
2011-11-22 17:21:54 +00:00
|
|
|
#include "gps_sdr_signal_processing.h"
|
|
|
|
#include "tracking_FLL_PLL_filter.h"
|
2012-10-24 08:02:51 +00:00
|
|
|
#include "tracking_2nd_DLL_filter.h"
|
2012-01-27 18:01:17 +00:00
|
|
|
#include "gnss_synchro.h"
|
2012-01-20 16:37:16 +00:00
|
|
|
#include "correlator.h"
|
2011-11-22 17:21:54 +00:00
|
|
|
|
2012-01-13 00:49:24 +00:00
|
|
|
class Gps_L1_Ca_Dll_Fll_Pll_Tracking_cc;
|
2013-07-04 13:47:40 +00:00
|
|
|
|
2012-01-13 00:49:24 +00:00
|
|
|
typedef boost::shared_ptr<Gps_L1_Ca_Dll_Fll_Pll_Tracking_cc>
|
2011-12-28 21:55:11 +00:00
|
|
|
gps_l1_ca_dll_fll_pll_tracking_cc_sptr;
|
2011-11-22 17:21:54 +00:00
|
|
|
|
|
|
|
gps_l1_ca_dll_fll_pll_tracking_cc_sptr
|
2012-01-27 18:01:17 +00:00
|
|
|
gps_l1_ca_dll_fll_pll_make_tracking_cc(
|
2011-12-28 21:55:11 +00:00
|
|
|
long if_freq,
|
|
|
|
long fs_in,
|
|
|
|
unsigned int vector_length,
|
2013-07-04 13:47:40 +00:00
|
|
|
boost::shared_ptr<gr::msg_queue> queue,
|
2011-12-28 21:55:11 +00:00
|
|
|
bool dump,
|
|
|
|
std::string dump_filename,
|
|
|
|
int order,
|
|
|
|
float fll_bw_hz,
|
|
|
|
float pll_bw_hz,
|
|
|
|
float dll_bw_hz,
|
|
|
|
float early_late_space_chips);
|
2011-11-22 17:21:54 +00:00
|
|
|
|
2011-12-28 03:05:37 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief This class implements a DLL and a FLL assisted PLL tracking loop block
|
|
|
|
*/
|
2013-07-04 13:47:40 +00:00
|
|
|
class Gps_L1_Ca_Dll_Fll_Pll_Tracking_cc: public gr::block
|
2011-11-22 17:21:54 +00:00
|
|
|
{
|
2012-01-13 01:06:28 +00:00
|
|
|
public:
|
|
|
|
~Gps_L1_Ca_Dll_Fll_Pll_Tracking_cc();
|
|
|
|
|
|
|
|
void set_channel(unsigned int channel);
|
|
|
|
void start_tracking();
|
|
|
|
void update_local_code();
|
|
|
|
void update_local_carrier();
|
|
|
|
void set_FLL_and_PLL_BW(float fll_bw_hz,float pll_bw_hz);
|
2012-01-29 18:03:56 +00:00
|
|
|
/*
|
|
|
|
* \brief Satellite signal synchronization parameters uses shared memory between acquisition and tracking
|
|
|
|
*/
|
2012-01-27 18:01:17 +00:00
|
|
|
void set_gnss_synchro(Gnss_Synchro* p_gnss_synchro);
|
2012-01-13 01:06:28 +00:00
|
|
|
void set_channel_queue(concurrent_queue<int> *channel_internal_queue);
|
|
|
|
|
|
|
|
/*
|
|
|
|
* \brief just like gr_block::general_work, only this arranges to call consume_each for you
|
|
|
|
*
|
|
|
|
* The user must override work to define the signal processing code
|
|
|
|
*/
|
|
|
|
|
|
|
|
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);
|
2011-11-22 17:21:54 +00:00
|
|
|
private:
|
|
|
|
friend gps_l1_ca_dll_fll_pll_tracking_cc_sptr
|
2012-01-27 18:01:17 +00:00
|
|
|
gps_l1_ca_dll_fll_pll_make_tracking_cc(
|
2011-12-28 21:55:11 +00:00
|
|
|
long if_freq,
|
|
|
|
long fs_in, unsigned
|
|
|
|
int vector_length,
|
2013-07-04 13:47:40 +00:00
|
|
|
boost::shared_ptr<gr::msg_queue> queue,
|
2011-12-28 21:55:11 +00:00
|
|
|
bool dump,
|
|
|
|
std::string dump_filename,
|
|
|
|
int order,
|
|
|
|
float fll_bw_hz,
|
|
|
|
float pll_bw_hz,
|
|
|
|
float dll_bw_hz,
|
|
|
|
float early_late_space_chips);
|
2011-11-22 17:21:54 +00:00
|
|
|
|
2012-01-27 18:01:17 +00:00
|
|
|
Gps_L1_Ca_Dll_Fll_Pll_Tracking_cc(
|
2011-12-28 21:55:11 +00:00
|
|
|
long if_freq,
|
|
|
|
long fs_in, unsigned
|
|
|
|
int vector_length,
|
2013-07-04 13:47:40 +00:00
|
|
|
boost::shared_ptr<gr::msg_queue> queue,
|
2011-12-28 21:55:11 +00:00
|
|
|
bool dump,
|
|
|
|
std::string dump_filename,
|
|
|
|
int order,
|
|
|
|
float fll_bw_hz,
|
|
|
|
float pll_bw_hz,
|
|
|
|
float dll_bw_hz,
|
|
|
|
float early_late_space_chips);
|
2011-11-22 17:21:54 +00:00
|
|
|
|
|
|
|
void CN0_estimation_and_lock_detectors();
|
|
|
|
|
|
|
|
// class private vars
|
2012-01-27 18:01:17 +00:00
|
|
|
Gnss_Synchro *d_acquisition_gnss_synchro;
|
2013-07-04 13:47:40 +00:00
|
|
|
boost::shared_ptr<gr::msg_queue> d_queue;
|
2011-11-22 17:21:54 +00:00
|
|
|
concurrent_queue<int> *d_channel_internal_queue;
|
|
|
|
unsigned int d_vector_length;
|
|
|
|
bool d_dump;
|
|
|
|
unsigned int d_channel;
|
|
|
|
int d_last_seg;
|
2012-04-11 10:43:35 +00:00
|
|
|
double d_if_freq;
|
|
|
|
double d_fs_in;
|
2011-11-22 17:21:54 +00:00
|
|
|
|
|
|
|
gr_complex* d_ca_code;
|
|
|
|
|
|
|
|
gr_complex* d_early_code;
|
|
|
|
gr_complex* d_late_code;
|
|
|
|
gr_complex* d_prompt_code;
|
|
|
|
|
|
|
|
gr_complex* d_carr_sign;
|
|
|
|
|
2012-01-29 18:03:56 +00:00
|
|
|
gr_complex* d_Early;
|
|
|
|
gr_complex* d_Prompt;
|
|
|
|
gr_complex* d_Late;
|
|
|
|
|
2011-12-28 21:55:11 +00:00
|
|
|
gr_complex d_Prompt_prev;
|
2011-11-22 17:21:54 +00:00
|
|
|
|
2012-04-11 10:43:35 +00:00
|
|
|
double d_early_late_spc_chips;
|
2011-11-22 17:21:54 +00:00
|
|
|
|
2012-04-11 10:43:35 +00:00
|
|
|
double d_carrier_doppler_hz;
|
|
|
|
double d_code_freq_hz;
|
|
|
|
double d_code_phase_samples;
|
2011-12-28 21:55:11 +00:00
|
|
|
int d_current_prn_length_samples;
|
2012-04-11 10:43:35 +00:00
|
|
|
//int d_next_prn_length_samples;
|
2011-12-28 21:55:11 +00:00
|
|
|
int d_FLL_wait;
|
2012-04-11 10:43:35 +00:00
|
|
|
double d_rem_carr_phase;
|
|
|
|
double d_rem_code_phase_samples;
|
|
|
|
//double d_next_rem_code_phase_samples;
|
2011-11-22 17:21:54 +00:00
|
|
|
bool d_pull_in;
|
|
|
|
|
|
|
|
// acquisition
|
2012-04-11 10:43:35 +00:00
|
|
|
double d_acq_code_phase_samples;
|
|
|
|
double d_acq_carrier_doppler_hz;
|
2011-11-22 17:21:54 +00:00
|
|
|
|
2012-01-20 16:37:16 +00:00
|
|
|
// correlator
|
2012-01-25 01:57:28 +00:00
|
|
|
Correlator d_correlator;
|
2012-01-20 16:37:16 +00:00
|
|
|
|
2011-11-22 17:21:54 +00:00
|
|
|
// FLL + PLL filter
|
2012-04-11 10:43:35 +00:00
|
|
|
double d_FLL_discriminator_hz; // This is a class variable because FLL needs to have memory
|
2012-01-13 00:49:24 +00:00
|
|
|
Tracking_FLL_PLL_filter d_carrier_loop_filter;
|
2012-04-11 10:43:35 +00:00
|
|
|
double d_acc_carrier_phase_rad;
|
2012-10-24 08:02:51 +00:00
|
|
|
double d_acc_code_phase_samples;
|
|
|
|
|
|
|
|
Tracking_2nd_DLL_filter d_code_loop_filter;
|
2011-11-22 17:21:54 +00:00
|
|
|
|
|
|
|
unsigned long int d_sample_counter;
|
- Major changes:
- The executable file and the default configuration file is now changed from "./install/mercurio" and "./conf/mercurio.conf" to "./install/gnss-sdr" and "./conf/gnss-sdr.conf", respectively.
- Configuration file structure changed to define in a single entry the internal sampling frequency (after the signal conditioner). NOTICE that this change affects the all the adapters (acquisition, tracking, telemetry_decoder, observables, and PVT). All the adapters are now modified to work with this feature.
- Moved several in-line GPS L1 CA parameters (a.k.a magic numbers..) to ./src/core/system_parameters/GPS_L1_CA.h definition file.
- Tracking blocks now uses DOUBLE values in their outputs.
- Observables and PVT now are separated. PVT and their associated libraries are moved to ./src/algorithms/PVT
- Temporarily disabled the RINEX output (I am working on that!)
- GNSS-SDR screen output now gives extended debug information of the receiver status and events. In the future, this output will be redirected to a log file.
- Bug fixes:
- FILE_SIGNAL_SOURCE now works correctly when the user configures GNSS-SDR to process the entire file.
- GPS_L1_CA_DLL_PLL now computes correctly the PRN start values.
- GPS_L1_CA_DLL_FLL_PLL now computes correctly the PRN start values.
- Several modifications in GPS_L1_CA_Telemetry_Decoder, GPS_L1_CA_Observables, and GPS_L1_CA_PVT modules to fix the GPS position computation.
- New features
- Tracking blocks perform a signal integrity check against NaN outliers before the correlation process.
- Tracking and PVT binary dump options are now documented and we provide MATLAB libraries and sample files to read it. Available in ./utils/matlab" and "./utils/matlab/libs"
- Observables output rate can be configured. This option enables the GPS L1 CA PVT computation at a maximum rate of 1ms.
- GPS_L1_CA_PVT now can perform a moving average Latitude, Longitude, and Altitude output for each of the Observables output. It is configurable using the configuration file.
- Added Google Earth compatible Keyhole Markup Language (KML) output writer class (./src/algorithms/PVT/libs/kml_printer.h and ./src/algorithms/PVT/libs/kml_printer.cc ). You can see the receiver position directly using Google Earth.
- We provide a master configuration file which includes an in-line documentation with all the new (and old) options. It can be found in ./conf/master.conf
git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@84 64b25241-fba3-4117-9849-534c7e92360d
2011-12-07 17:59:34 +00:00
|
|
|
|
2011-11-22 17:21:54 +00:00
|
|
|
unsigned long int d_acq_sample_stamp;
|
|
|
|
|
|
|
|
// CN0 estimation and lock detector
|
|
|
|
int d_cn0_estimation_counter;
|
|
|
|
gr_complex* d_Prompt_buffer;
|
2012-04-11 10:43:35 +00:00
|
|
|
double d_carrier_lock_test;
|
|
|
|
double d_CN0_SNV_dB_Hz;
|
2011-11-22 17:21:54 +00:00
|
|
|
|
2012-04-11 10:43:35 +00:00
|
|
|
double d_carrier_lock_threshold;
|
2011-11-22 17:21:54 +00:00
|
|
|
|
|
|
|
int d_carrier_lock_fail_counter;
|
|
|
|
|
|
|
|
bool d_enable_tracking;
|
|
|
|
|
|
|
|
std::string d_dump_filename;
|
|
|
|
std::ofstream d_dump_file;
|
2012-01-30 23:14:57 +00:00
|
|
|
|
|
|
|
std::map<std::string, std::string> systemName;
|
|
|
|
std::string sys;
|
2011-11-22 17:21:54 +00:00
|
|
|
};
|
|
|
|
|
2011-12-28 03:05:37 +00:00
|
|
|
#endif //GNSS_SDR_GPS_L1_CA_DLL_FLL_PLL_TRACKING_CC_H
|