mirror of
				https://github.com/gnss-sdr/gnss-sdr
				synced 2025-11-04 01:03:04 +00:00 
			
		
		
		
	Merge branch 'next-gnss-sdr' into new_next
Conflicts: src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_dll_pll_tracking_gpu_cc.cc
This commit is contained in:
		@@ -270,7 +270,7 @@ int galileo_e1_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_it
 | 
			
		||||
            // DEBUG MESSAGE: Display position in console output
 | 
			
		||||
            if (((d_sample_counter % d_display_rate_ms) == 0) and d_ls_pvt->b_valid_position == true)
 | 
			
		||||
                {
 | 
			
		||||
                    std::cout << "Position at " << boost::posix_time::to_simple_string(d_ls_pvt->d_position_UTC_time)
 | 
			
		||||
                    std::cout << "Galileo Position at " << boost::posix_time::to_simple_string(d_ls_pvt->d_position_UTC_time)
 | 
			
		||||
                              << " UTC is Lat = " << d_ls_pvt->d_latitude_d << " [deg], Long = " << d_ls_pvt->d_longitude_d
 | 
			
		||||
                              << " [deg], Height= " << d_ls_pvt->d_height_m << " [m]" << std::endl;
 | 
			
		||||
 | 
			
		||||
@@ -307,7 +307,12 @@ int galileo_e1_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_it
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    consume_each(1); //one by one
 | 
			
		||||
    return 0;
 | 
			
		||||
    output_items.clear();  // removes a warning
 | 
			
		||||
    if((noutput_items == 0) || (ninput_items[0] == 0))
 | 
			
		||||
        {
 | 
			
		||||
            LOG(WARNING) << "noutput_items = 0";
 | 
			
		||||
        }
 | 
			
		||||
    return 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -344,7 +344,12 @@ int gps_l1_ca_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_ite
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    consume_each(1); //one by one
 | 
			
		||||
    return noutput_items;
 | 
			
		||||
    output_items.clear();  // removes a warning
 | 
			
		||||
    if((noutput_items == 0) || (ninput_items[0] == 0))
 | 
			
		||||
        {
 | 
			
		||||
            LOG(WARNING) << "noutput_items = 0";
 | 
			
		||||
        }
 | 
			
		||||
    return 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -316,7 +316,7 @@ int hybrid_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_items,
 | 
			
		||||
                                    galileo_ephemeris_iter = d_ls_pvt->galileo_ephemeris_map.begin();
 | 
			
		||||
                                    std::map<int, Gps_Ephemeris>::iterator gps_ephemeris_iter;
 | 
			
		||||
                                    gps_ephemeris_iter = d_ls_pvt->gps_ephemeris_map.begin();
 | 
			
		||||
                                    if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) || (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())  )
 | 
			
		||||
                                    if ((galileo_ephemeris_iter != d_ls_pvt->galileo_ephemeris_map.end()) && (gps_ephemeris_iter != d_ls_pvt->gps_ephemeris_map.end())  )
 | 
			
		||||
                                        {
 | 
			
		||||
                                            rp->log_rinex_obs(rp->obsFile, gps_ephemeris_iter->second, galileo_ephemeris_iter->second, d_rx_time, gnss_pseudoranges_map);
 | 
			
		||||
                                        }
 | 
			
		||||
@@ -370,7 +370,12 @@ int hybrid_pvt_cc::general_work (int noutput_items, gr_vector_int &ninput_items,
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    consume_each(1); //one by one
 | 
			
		||||
    return noutput_items;
 | 
			
		||||
    output_items.clear();  // removes a warning
 | 
			
		||||
    if((noutput_items == 0) || (ninput_items[0] == 0))
 | 
			
		||||
        {
 | 
			
		||||
            LOG(WARNING) << "noutput_items = 0";
 | 
			
		||||
        }
 | 
			
		||||
    return 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -44,6 +44,7 @@ galileo_e1_ls_pvt::galileo_e1_ls_pvt(int nchannels, std::string dump_filename, b
 | 
			
		||||
    d_dump_filename = dump_filename;
 | 
			
		||||
    d_flag_dump_enabled = flag_dump_to_file;
 | 
			
		||||
    d_galileo_current_time = 0;
 | 
			
		||||
    d_flag_averaging = false;
 | 
			
		||||
 | 
			
		||||
    // ############# ENABLE DATA FILE LOG #################
 | 
			
		||||
    if (d_flag_dump_enabled == true)
 | 
			
		||||
@@ -85,6 +86,7 @@ bool galileo_e1_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_pseudoranges_map
 | 
			
		||||
 | 
			
		||||
    int Galileo_week_number = 0;
 | 
			
		||||
    double utc = 0.0;
 | 
			
		||||
    double GST = 0.0;
 | 
			
		||||
    double TX_time_corrected_s = 0.0;
 | 
			
		||||
    double SV_clock_bias_s = 0.0;
 | 
			
		||||
 | 
			
		||||
@@ -108,19 +110,8 @@ bool galileo_e1_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_pseudoranges_map
 | 
			
		||||
                     */
 | 
			
		||||
                    W(obs_counter, obs_counter) = 1.0;
 | 
			
		||||
 | 
			
		||||
                    // COMMON RX TIME PVT ALGORITHM MODIFICATION (Like RINEX files)
 | 
			
		||||
                    // first estimate of transmit time
 | 
			
		||||
                    //Galileo_week_number = galileo_ephemeris_iter->second.WN_5;//for GST
 | 
			
		||||
                    //double sec_in_day = 86400;
 | 
			
		||||
                    //double day_in_week = 7;
 | 
			
		||||
                    //   t = WN*sec_in_day*day_in_week + TOW; // t is Galileo System Time to use to compute satellite positions
 | 
			
		||||
 | 
			
		||||
                    //JAVIER VERSION:
 | 
			
		||||
                    // COMMON RX TIME PVT ALGORITHM
 | 
			
		||||
                    double Rx_time = galileo_current_time;
 | 
			
		||||
 | 
			
		||||
                    //to compute satellite position we need GST = WN+TOW (everything expressed in seconds)
 | 
			
		||||
                    //double Rx_time = galileo_current_time + Galileo_week_number*sec_in_day*day_in_week;
 | 
			
		||||
 | 
			
		||||
                    double Tx_time = Rx_time - gnss_pseudoranges_iter->second.Pseudorange_m / GALILEO_C_m_s;
 | 
			
		||||
 | 
			
		||||
                    // 2- compute the clock drift using the clock model (broadcast) for this SV, including relativistic effect
 | 
			
		||||
@@ -141,16 +132,7 @@ bool galileo_e1_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_pseudoranges_map
 | 
			
		||||
                    valid_obs++;
 | 
			
		||||
 | 
			
		||||
                    Galileo_week_number = galileo_ephemeris_iter->second.WN_5; //for GST
 | 
			
		||||
 | 
			
		||||
                    double GST = galileo_ephemeris_map.find(gnss_pseudoranges_iter->first)->second.Galileo_System_Time(Galileo_week_number, galileo_current_time);
 | 
			
		||||
                    utc = galileo_utc_model.GST_to_UTC_time(GST, Galileo_week_number);
 | 
			
		||||
                    // get time string gregorian calendar
 | 
			
		||||
                    boost::posix_time::time_duration t = boost::posix_time::seconds(utc);
 | 
			
		||||
                    // 22 August 1999 00:00 last Galileo start GST epoch (ICD sec 5.1.2)
 | 
			
		||||
                    boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t);
 | 
			
		||||
                    d_position_UTC_time = p_time;
 | 
			
		||||
                    LOG(INFO) << "Galileo RX time at " << boost::posix_time::to_simple_string(p_time);
 | 
			
		||||
                    //end debug
 | 
			
		||||
                    GST = galileo_ephemeris_map.find(gnss_pseudoranges_iter->first)->second.Galileo_System_Time(Galileo_week_number, galileo_current_time);
 | 
			
		||||
 | 
			
		||||
                    // SV ECEF DEBUG OUTPUT
 | 
			
		||||
                    DLOG(INFO) << "ECEF satellite SV ID=" << galileo_ephemeris_iter->second.i_satellite_PRN
 | 
			
		||||
@@ -168,6 +150,7 @@ bool galileo_e1_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_pseudoranges_map
 | 
			
		||||
                }
 | 
			
		||||
            obs_counter++;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    // ********************************************************************************
 | 
			
		||||
    // ****** SOLVE LEAST SQUARES******************************************************
 | 
			
		||||
    // ********************************************************************************
 | 
			
		||||
@@ -183,15 +166,14 @@ bool galileo_e1_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_pseudoranges_map
 | 
			
		||||
 | 
			
		||||
            mypos = galileo_e1_ls_pvt::leastSquarePos(satpos, obs, W);
 | 
			
		||||
 | 
			
		||||
            // Compute GST and Gregorian time
 | 
			
		||||
            //double GST = galileo_ephemeris_iter->second.Galileo_System_Time(Galileo_week_number, galileo_current_time);
 | 
			
		||||
            double GST = galileo_ephemeris_map.find(gnss_pseudoranges_iter->first)->second.Galileo_System_Time(Galileo_week_number, galileo_current_time);
 | 
			
		||||
            // Compute Gregorian time
 | 
			
		||||
            utc = galileo_utc_model.GST_to_UTC_time(GST, Galileo_week_number);
 | 
			
		||||
            // get time string Gregorian calendar
 | 
			
		||||
            boost::posix_time::time_duration t = boost::posix_time::seconds(utc);
 | 
			
		||||
            // 22 August 1999 00:00 last Galileo start GST epoch (ICD sec 5.1.2)
 | 
			
		||||
            boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t);
 | 
			
		||||
            d_position_UTC_time = p_time;
 | 
			
		||||
 | 
			
		||||
            DLOG(INFO) << "Galileo Position at TOW=" << galileo_current_time << " in ECEF (X,Y,Z) = " << mypos;
 | 
			
		||||
 | 
			
		||||
            galileo_e1_ls_pvt::cart2geo(static_cast<double>(mypos(0)), static_cast<double>(mypos(1)), static_cast<double>(mypos(2)), 4);
 | 
			
		||||
@@ -201,14 +183,10 @@ bool galileo_e1_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_pseudoranges_map
 | 
			
		||||
                    b_valid_position = false;
 | 
			
		||||
                    return false;
 | 
			
		||||
                }
 | 
			
		||||
            LOG(INFO) << "Galileo Position at " << boost::posix_time::to_simple_string(p_time)
 | 
			
		||||
            DLOG(INFO) << "Galileo Position at " << boost::posix_time::to_simple_string(p_time)
 | 
			
		||||
                      << " is Lat = " << d_latitude_d << " [deg], Long = " << d_longitude_d
 | 
			
		||||
                      << " [deg], Height= " << d_height_m << " [m]";
 | 
			
		||||
 | 
			
		||||
            std::cout << "Galileo Position at " << boost::posix_time::to_simple_string(p_time)
 | 
			
		||||
                      << " is Lat = " << d_latitude_d << " [deg], Long = " << d_longitude_d
 | 
			
		||||
                      << " [deg], Height= " << d_height_m << " [m]" << std::endl;
 | 
			
		||||
 | 
			
		||||
            // ###### Compute DOPs ########
 | 
			
		||||
            galileo_e1_ls_pvt::compute_DOP();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -37,7 +37,10 @@
 | 
			
		||||
#include <sstream>
 | 
			
		||||
#include <glog/logging.h>
 | 
			
		||||
 | 
			
		||||
GeoJSON_Printer::GeoJSON_Printer () {}
 | 
			
		||||
GeoJSON_Printer::GeoJSON_Printer()
 | 
			
		||||
{
 | 
			
		||||
    first_pos = true;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -44,7 +44,7 @@ gps_l1_ca_ls_pvt::gps_l1_ca_ls_pvt(int nchannels, std::string dump_filename, boo
 | 
			
		||||
    d_ephemeris = new Gps_Navigation_Message[nchannels];
 | 
			
		||||
    d_dump_filename = dump_filename;
 | 
			
		||||
    d_flag_dump_enabled = flag_dump_to_file;
 | 
			
		||||
 | 
			
		||||
    d_flag_averaging = false;
 | 
			
		||||
    d_GPS_current_time = 0;
 | 
			
		||||
 | 
			
		||||
    // ############# ENABLE DATA FILE LOG #################
 | 
			
		||||
 
 | 
			
		||||
@@ -48,6 +48,7 @@ hybrid_ls_pvt::hybrid_ls_pvt(int nchannels, std::string dump_filename, bool flag
 | 
			
		||||
    d_valid_GPS_obs = 0;
 | 
			
		||||
    d_valid_GAL_obs = 0;
 | 
			
		||||
    count_valid_position = 0;
 | 
			
		||||
    d_flag_averaging = false;
 | 
			
		||||
    // ############# ENABLE DATA FILE LOG #################
 | 
			
		||||
    if (d_flag_dump_enabled == true)
 | 
			
		||||
        {
 | 
			
		||||
@@ -94,11 +95,12 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_pseudoranges_map, do
 | 
			
		||||
    arma::mat satpos = arma::zeros(3, valid_pseudoranges);           // satellite positions matrix
 | 
			
		||||
 | 
			
		||||
    int Galileo_week_number = 0;
 | 
			
		||||
    int GPS_week;
 | 
			
		||||
    double utc = 0;
 | 
			
		||||
    double utc_tx_corrected = 0; //utc computed at tx_time_corrected, added for Galileo constellation (in GPS utc is directly computed at TX_time_corrected_s)
 | 
			
		||||
    int GPS_week = 0;
 | 
			
		||||
    double utc = 0.0;
 | 
			
		||||
    double GST = 0.0;
 | 
			
		||||
    double utc_tx_corrected = 0.0; //utc computed at tx_time_corrected, added for Galileo constellation (in GPS utc is directly computed at TX_time_corrected_s)
 | 
			
		||||
    double TX_time_corrected_s;
 | 
			
		||||
    double SV_clock_bias_s = 0;
 | 
			
		||||
    double SV_clock_bias_s = 0.0;
 | 
			
		||||
 | 
			
		||||
    d_flag_averaging = flag_averaging;
 | 
			
		||||
 | 
			
		||||
@@ -126,13 +128,7 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_pseudoranges_map, do
 | 
			
		||||
                             */
 | 
			
		||||
                            W(obs_counter, obs_counter) = 1;
 | 
			
		||||
 | 
			
		||||
                            // COMMON RX TIME PVT ALGORITHM MODIFICATION (Like RINEX files)
 | 
			
		||||
                            // first estimate of transmit time
 | 
			
		||||
                            //Galileo_week_number = galileo_ephemeris_iter->second.WN_5;//for GST
 | 
			
		||||
                            //double sec_in_day = 86400;
 | 
			
		||||
                            //double day_in_week = 7;
 | 
			
		||||
                            //   t = WN*sec_in_day*day_in_week + TOW; // t is Galileo System Time to use to compute satellite positions
 | 
			
		||||
 | 
			
		||||
                            // COMMON RX TIME PVT ALGORITHM
 | 
			
		||||
                            double Rx_time = hybrid_current_time;
 | 
			
		||||
                            double Tx_time = Rx_time - gnss_pseudoranges_iter->second.Pseudorange_m/GALILEO_C_m_s;
 | 
			
		||||
 | 
			
		||||
@@ -153,22 +149,9 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_pseudoranges_map, do
 | 
			
		||||
                            d_visible_satellites_CN0_dB[valid_obs] = gnss_pseudoranges_iter->second.CN0_dB_hz;
 | 
			
		||||
                            valid_obs++;
 | 
			
		||||
                            valid_obs_GALILEO_counter ++;
 | 
			
		||||
                            Galileo_week_number = galileo_ephemeris_iter->second.WN_5; //for GST
 | 
			
		||||
 | 
			
		||||
                            //debug
 | 
			
		||||
                            double GST = galileo_ephemeris_iter->second.Galileo_System_Time(Galileo_week_number, hybrid_current_time);
 | 
			
		||||
                            utc = galileo_utc_model.GST_to_UTC_time(GST, Galileo_week_number); // this shoud be removed and it should be considered the  utc_tx_corrected
 | 
			
		||||
                            utc_tx_corrected = galileo_utc_model.GST_to_UTC_time(TX_time_corrected_s, Galileo_week_number);
 | 
			
		||||
                            //std::cout<<"Gal UTC at TX_time_corrected_s = "<<utc_tx_corrected<< std::endl;
 | 
			
		||||
                            //std::cout<<"Gal_week = "<<Galileo_week_number<< std::endl;
 | 
			
		||||
                            //std::cout << "Gal UTC = " <<  utc << std::endl;
 | 
			
		||||
                            // get time string gregorian calendar
 | 
			
		||||
                            boost::posix_time::time_duration t = boost::posix_time::seconds(utc);
 | 
			
		||||
                            // 22 August 1999 00:00 last Galileo start GST epoch (ICD sec 5.1.2)
 | 
			
		||||
                            boost::posix_time::ptime p_time(boost::gregorian::date(1999, 8, 22), t);
 | 
			
		||||
                            d_position_UTC_time = p_time;
 | 
			
		||||
                            LOG(INFO) << "Galileo RX time at " << boost::posix_time::to_simple_string(p_time);
 | 
			
		||||
                            //end debug
 | 
			
		||||
                            Galileo_week_number = galileo_ephemeris_iter->second.WN_5; //for GST
 | 
			
		||||
                            GST = galileo_ephemeris_iter->second.Galileo_System_Time(Galileo_week_number, hybrid_current_time);
 | 
			
		||||
 | 
			
		||||
                            // SV ECEF DEBUG OUTPUT
 | 
			
		||||
                            DLOG(INFO) << "ECEF satellite SV ID=" << galileo_ephemeris_iter->second.i_satellite_PRN
 | 
			
		||||
@@ -221,16 +204,14 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_pseudoranges_map, do
 | 
			
		||||
                            d_visible_satellites_CN0_dB[valid_obs] = gnss_pseudoranges_iter->second.CN0_dB_hz;
 | 
			
		||||
                            valid_obs++;
 | 
			
		||||
                            valid_obs_GPS_counter++;
 | 
			
		||||
                            GPS_week = gps_ephemeris_iter->second.i_GPS_week;
 | 
			
		||||
 | 
			
		||||
                            // SV ECEF DEBUG OUTPUT
 | 
			
		||||
                            DLOG(INFO) << "(new)ECEF satellite SV ID=" << gps_ephemeris_iter->second.i_satellite_PRN
 | 
			
		||||
                                    << " X=" << gps_ephemeris_iter->second.d_satpos_X
 | 
			
		||||
                                    << " [m] Y=" << gps_ephemeris_iter->second.d_satpos_Y
 | 
			
		||||
                                    << " [m] Z=" << gps_ephemeris_iter->second.d_satpos_Z
 | 
			
		||||
                                    << " [m] PR_obs=" << obs(obs_counter) << " [m]";
 | 
			
		||||
 | 
			
		||||
                            // compute the UTC time for this SV (just to print the asociated UTC timestamp)
 | 
			
		||||
                            GPS_week = gps_ephemeris_iter->second.i_GPS_week;
 | 
			
		||||
                            utc = gps_utc_model.utc_time(TX_time_corrected_s, GPS_week);
 | 
			
		||||
                        }
 | 
			
		||||
                    else // the ephemeris are not available for this SV
 | 
			
		||||
                        {
 | 
			
		||||
@@ -261,8 +242,14 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_pseudoranges_map, do
 | 
			
		||||
            mypos = hybrid_ls_pvt::leastSquarePos(satpos, obs, W);
 | 
			
		||||
 | 
			
		||||
            // Compute GST and Gregorian time
 | 
			
		||||
            double GST = galileo_ephemeris_map.find(gnss_pseudoranges_iter->first)->second.Galileo_System_Time(Galileo_week_number, hybrid_current_time);
 | 
			
		||||
            utc = galileo_utc_model.GST_to_UTC_time(GST, Galileo_week_number);
 | 
			
		||||
            if( GST != 0.0)
 | 
			
		||||
                {
 | 
			
		||||
                    utc = galileo_utc_model.GST_to_UTC_time(GST, Galileo_week_number);
 | 
			
		||||
                }
 | 
			
		||||
            else
 | 
			
		||||
                {
 | 
			
		||||
                    utc = gps_utc_model.utc_time(TX_time_corrected_s, GPS_week);
 | 
			
		||||
                }
 | 
			
		||||
            // get time string Gregorian calendar
 | 
			
		||||
            boost::posix_time::time_duration t = boost::posix_time::seconds(utc);
 | 
			
		||||
            // 22 August 1999 00:00 last Galileo start GST epoch (ICD sec 5.1.2)
 | 
			
		||||
@@ -289,7 +276,6 @@ bool hybrid_ls_pvt::get_PVT(std::map<int,Gnss_Synchro> gnss_pseudoranges_map, do
 | 
			
		||||
            << " is Lat = " << d_latitude_d << " [deg], Long = " << d_longitude_d
 | 
			
		||||
            << " [deg], Height= " << d_height_m << " [m]";
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            // ###### Compute DOPs ########
 | 
			
		||||
            hybrid_ls_pvt::compute_DOP();
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -647,7 +647,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
 | 
			
		||||
                    // weighting_factor = 0;
 | 
			
		||||
                    // std::cout << "weighting_factor " << weighting_factor << std::endl;
 | 
			
		||||
                    // Initialize first iterations
 | 
			
		||||
                    for (int doppler_index=0; doppler_index < CAF_bins_half; doppler_index++)
 | 
			
		||||
                    for (int doppler_index = 0; doppler_index < CAF_bins_half; doppler_index++)
 | 
			
		||||
                        {
 | 
			
		||||
                            d_CAF_vector[doppler_index] = 0;
 | 
			
		||||
                            // volk_32f_accumulator_s32f_a(&d_CAF_vector[doppler_index], d_CAF_vector_I, CAF_bins_half+doppler_index+1);
 | 
			
		||||
@@ -656,7 +656,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
 | 
			
		||||
                                    d_CAF_vector[doppler_index] += d_CAF_vector_I[i] * (1 - weighting_factor * static_cast<unsigned int>((doppler_index - i)));
 | 
			
		||||
                                }
 | 
			
		||||
                            // d_CAF_vector[doppler_index] /= CAF_bins_half+doppler_index+1;
 | 
			
		||||
                            d_CAF_vector[doppler_index] /= 1 + CAF_bins_half+doppler_index - weighting_factor * CAF_bins_half * (CAF_bins_half + 1) / 2 - weighting_factor*doppler_index*(doppler_index+1)/2; // triangles = [n*(n+1)/2]
 | 
			
		||||
                            d_CAF_vector[doppler_index] /= 1 + CAF_bins_half + doppler_index - weighting_factor * CAF_bins_half * (CAF_bins_half + 1) / 2 - weighting_factor * doppler_index * (doppler_index + 1) / 2; // triangles = [n*(n+1)/2]
 | 
			
		||||
                            if (d_both_signal_components)
 | 
			
		||||
                                {
 | 
			
		||||
                                    accum[0] = 0;
 | 
			
		||||
@@ -671,21 +671,21 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
 | 
			
		||||
                                }
 | 
			
		||||
                        }
 | 
			
		||||
                    // Body loop
 | 
			
		||||
                    for (unsigned int doppler_index = CAF_bins_half;doppler_index<d_num_doppler_bins-CAF_bins_half;doppler_index++)
 | 
			
		||||
                    for (unsigned int doppler_index = CAF_bins_half; doppler_index < d_num_doppler_bins - CAF_bins_half; doppler_index++)
 | 
			
		||||
                        {
 | 
			
		||||
                            d_CAF_vector[doppler_index] = 0;
 | 
			
		||||
                            //				volk_32f_accumulator_s32f_a(&d_CAF_vector[doppler_index], &d_CAF_vector_I[doppler_index-CAF_bins_half], 2*CAF_bins_half+1);
 | 
			
		||||
                            for (int i = doppler_index-CAF_bins_half; i < doppler_index+CAF_bins_half + 1; i++)
 | 
			
		||||
                            // volk_32f_accumulator_s32f_a(&d_CAF_vector[doppler_index], &d_CAF_vector_I[doppler_index-CAF_bins_half], 2*CAF_bins_half+1);
 | 
			
		||||
                            for (int i = doppler_index - CAF_bins_half; i < static_cast<int>(doppler_index + CAF_bins_half + 1); i++)
 | 
			
		||||
                                {
 | 
			
		||||
                                    d_CAF_vector[doppler_index] += d_CAF_vector_I[i] * (1-weighting_factor * static_cast<unsigned int>((doppler_index - i)));
 | 
			
		||||
                                    d_CAF_vector[doppler_index] += d_CAF_vector_I[i] * (1 - weighting_factor * static_cast<unsigned int>((doppler_index - i)));
 | 
			
		||||
                                }
 | 
			
		||||
                            //				d_CAF_vector[doppler_index] /= 2*CAF_bins_half+1;
 | 
			
		||||
                            // d_CAF_vector[doppler_index] /= 2*CAF_bins_half+1;
 | 
			
		||||
                            d_CAF_vector[doppler_index] /= 1 + 2 * CAF_bins_half - 2 * weighting_factor * CAF_bins_half * (CAF_bins_half + 1) / 2;
 | 
			
		||||
                            if (d_both_signal_components)
 | 
			
		||||
                                {
 | 
			
		||||
                                    accum[0] = 0;
 | 
			
		||||
                                    // volk_32f_accumulator_s32f_a(&accum[0], &d_CAF_vector_Q[doppler_index-CAF_bins_half], 2*CAF_bins_half);
 | 
			
		||||
                                    for (int i = doppler_index-CAF_bins_half; i < doppler_index + CAF_bins_half + 1; i++)
 | 
			
		||||
                                    for (int i = doppler_index-CAF_bins_half; i < static_cast<int>(doppler_index + CAF_bins_half + 1); i++)
 | 
			
		||||
                                        {
 | 
			
		||||
                                            accum[0] += d_CAF_vector_Q[i] * (1 - weighting_factor * static_cast<unsigned int>((doppler_index - i)));
 | 
			
		||||
                                        }
 | 
			
		||||
@@ -695,11 +695,11 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
 | 
			
		||||
                                }
 | 
			
		||||
                        }
 | 
			
		||||
                    // Final iterations
 | 
			
		||||
                    for (int doppler_index = d_num_doppler_bins - CAF_bins_half; doppler_index < d_num_doppler_bins; doppler_index++)
 | 
			
		||||
                    for (int doppler_index = d_num_doppler_bins - CAF_bins_half; doppler_index < static_cast<int>(d_num_doppler_bins); doppler_index++)
 | 
			
		||||
                        {
 | 
			
		||||
                            d_CAF_vector[doppler_index] = 0;
 | 
			
		||||
                            // volk_32f_accumulator_s32f_a(&d_CAF_vector[doppler_index], &d_CAF_vector_I[doppler_index-CAF_bins_half], CAF_bins_half + (d_num_doppler_bins-doppler_index));
 | 
			
		||||
                            for (int i = doppler_index - CAF_bins_half; i < d_num_doppler_bins; i++)
 | 
			
		||||
                            for (int i = doppler_index - CAF_bins_half; i < static_cast<int>(d_num_doppler_bins); i++)
 | 
			
		||||
                                {
 | 
			
		||||
                                    d_CAF_vector[doppler_index] += d_CAF_vector_I[i] * (1 - weighting_factor * (abs(doppler_index - i)));
 | 
			
		||||
                                }
 | 
			
		||||
@@ -709,7 +709,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
 | 
			
		||||
                                {
 | 
			
		||||
                                    accum[0] = 0;
 | 
			
		||||
                                    // volk_32f_accumulator_s32f_a(&accum[0], &d_CAF_vector_Q[doppler_index-CAF_bins_half], CAF_bins_half + (d_num_doppler_bins-doppler_index));
 | 
			
		||||
                                    for (int i = doppler_index-CAF_bins_half; i < d_num_doppler_bins; i++)
 | 
			
		||||
                                    for (int i = doppler_index-CAF_bins_half; i < static_cast<int>(d_num_doppler_bins); i++)
 | 
			
		||||
                                        {
 | 
			
		||||
                                            accum[0] += d_CAF_vector_Q[i] * (1 - weighting_factor * (abs(doppler_index - i)));
 | 
			
		||||
                                        }
 | 
			
		||||
@@ -803,6 +803,7 @@ int galileo_e5a_noncoherentIQ_acquisition_caf_cc::general_work(int noutput_items
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    output_items.clear();  // removes a warning
 | 
			
		||||
    return noutput_items;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -413,5 +413,6 @@ int galileo_pcps_8ms_acquisition_cc::general_work(int noutput_items,
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    output_items.clear();  // removes a warning
 | 
			
		||||
    return noutput_items;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -265,10 +265,8 @@ int pcps_acquisition_cc::general_work(int noutput_items,
 | 
			
		||||
            const gr_complex *in = (const gr_complex *)input_items[0]; //Get the input samples pointer
 | 
			
		||||
 | 
			
		||||
            int effective_fft_size = ( d_bit_transition_flag ? d_fft_size/2 : d_fft_size );
 | 
			
		||||
            size_t offset = ( d_bit_transition_flag ? effective_fft_size : 0 );
 | 
			
		||||
 | 
			
		||||
            float fft_normalization_factor = static_cast<float>(d_fft_size)
 | 
			
		||||
                * static_cast<float>(d_fft_size);
 | 
			
		||||
            float fft_normalization_factor = static_cast<float>(d_fft_size) * static_cast<float>(d_fft_size);
 | 
			
		||||
 | 
			
		||||
            d_input_power = 0.0;
 | 
			
		||||
            d_mag = 0.0;
 | 
			
		||||
@@ -442,7 +440,6 @@ int pcps_acquisition_cc::general_work(int noutput_items,
 | 
			
		||||
 | 
			
		||||
            d_sample_counter += d_fft_size * ninput_items[0]; // sample counter
 | 
			
		||||
            consume_each(ninput_items[0]);
 | 
			
		||||
 | 
			
		||||
            acquisition_message = 2;
 | 
			
		||||
            d_channel_internal_queue->push(acquisition_message);
 | 
			
		||||
 | 
			
		||||
@@ -450,6 +447,7 @@ int pcps_acquisition_cc::general_work(int noutput_items,
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    output_items.clear();  // removes a warning
 | 
			
		||||
    return noutput_items;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -174,7 +174,10 @@ void pcps_acquisition_fine_doppler_cc::init()
 | 
			
		||||
void pcps_acquisition_fine_doppler_cc::forecast (int noutput_items,
 | 
			
		||||
        gr_vector_int &ninput_items_required)
 | 
			
		||||
{
 | 
			
		||||
    ninput_items_required[0] = d_gnuradio_forecast_samples ; //set the required available samples in each call
 | 
			
		||||
    if (noutput_items != 0)
 | 
			
		||||
        {
 | 
			
		||||
            ninput_items_required[0] = d_gnuradio_forecast_samples ; //set the required available samples in each call
 | 
			
		||||
        }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -519,5 +522,6 @@ int pcps_acquisition_fine_doppler_cc::general_work(int noutput_items,
 | 
			
		||||
    //DLOG(INFO)<<"d_sample_counter="<<d_sample_counter<<std::endl;
 | 
			
		||||
    d_sample_counter += d_fft_size; // sample counter
 | 
			
		||||
    consume_each(d_fft_size);
 | 
			
		||||
    output_items.clear();  // removes a warning
 | 
			
		||||
    return noutput_items;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -173,7 +173,10 @@ void pcps_assisted_acquisition_cc::init()
 | 
			
		||||
void pcps_assisted_acquisition_cc::forecast (int noutput_items,
 | 
			
		||||
        gr_vector_int &ninput_items_required)
 | 
			
		||||
{
 | 
			
		||||
    ninput_items_required[0] = d_gnuradio_forecast_samples ; //set the required available samples in each call
 | 
			
		||||
    if (noutput_items != 0)
 | 
			
		||||
        {
 | 
			
		||||
            ninput_items_required[0] = d_gnuradio_forecast_samples ; //set the required available samples in each call
 | 
			
		||||
        }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -482,5 +485,6 @@ int pcps_assisted_acquisition_cc::general_work(int noutput_items,
 | 
			
		||||
        break;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    output_items.clear();  // removes a warning
 | 
			
		||||
    return noutput_items;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -438,5 +438,6 @@ int pcps_cccwsr_acquisition_cc::general_work(int noutput_items,
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    output_items.clear();  // removes a warning
 | 
			
		||||
    return noutput_items;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -466,5 +466,6 @@ int pcps_multithread_acquisition_cc::general_work(int noutput_items,
 | 
			
		||||
 | 
			
		||||
    consume_each(ninput_items[0]);
 | 
			
		||||
 | 
			
		||||
    output_items.clear();  // removes a warning
 | 
			
		||||
    return noutput_items;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -821,5 +821,6 @@ int pcps_opencl_acquisition_cc::general_work(int noutput_items,
 | 
			
		||||
 | 
			
		||||
    consume_each(ninput_items[0]);
 | 
			
		||||
 | 
			
		||||
    output_items.clear();  // removes a warning
 | 
			
		||||
    return noutput_items;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -577,6 +577,6 @@ int pcps_quicksync_acquisition_cc::general_work(int noutput_items,
 | 
			
		||||
            break;
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    //DLOG(INFO) << "END GENERAL WORK";
 | 
			
		||||
    output_items.clear();  // removes a warning
 | 
			
		||||
    return noutput_items;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -432,5 +432,6 @@ int pcps_tong_acquisition_cc::general_work(int noutput_items,
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    output_items.clear();  // removes a warning
 | 
			
		||||
    return noutput_items;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -30,12 +30,14 @@
 | 
			
		||||
 * -------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef INCLUDED_volk_gnsssdr_32fc_convert_16ic_u_H
 | 
			
		||||
#define INCLUDED_volk_gnsssdr_32fc_convert_16ic_u_H
 | 
			
		||||
 | 
			
		||||
#include <inttypes.h>
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <math.h>
 | 
			
		||||
#include "volk_gnsssdr/volk_gnsssdr_complex.h"
 | 
			
		||||
 | 
			
		||||
#ifndef INCLUDED_volk_gnsssdr_32fc_convert_16ic_u_H
 | 
			
		||||
#define INCLUDED_volk_gnsssdr_32fc_convert_16ic_u_H
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifdef LV_HAVE_SSE2
 | 
			
		||||
#include <emmintrin.h>
 | 
			
		||||
@@ -168,10 +170,6 @@ static inline void volk_gnsssdr_32fc_convert_16ic_generic(lv_16sc_t* outputVecto
 | 
			
		||||
#ifndef INCLUDED_volk_gnsssdr_32fc_convert_16ic_a_H
 | 
			
		||||
#define INCLUDED_volk_gnsssdr_32fc_convert_16ic_a_H
 | 
			
		||||
 | 
			
		||||
#include <volk/volk_common.h>
 | 
			
		||||
#include <inttypes.h>
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <math.h>
 | 
			
		||||
 | 
			
		||||
#ifdef LV_HAVE_SSE2
 | 
			
		||||
#include <emmintrin.h>
 | 
			
		||||
 
 | 
			
		||||
@@ -30,12 +30,15 @@
 | 
			
		||||
 * -------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef INCLUDED_volk_gnsssdr_32fc_convert_8ic_u_H
 | 
			
		||||
#define INCLUDED_volk_gnsssdr_32fc_convert_8ic_u_H
 | 
			
		||||
 | 
			
		||||
#include <inttypes.h>
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <math.h>
 | 
			
		||||
#include "volk_gnsssdr/volk_gnsssdr_complex.h"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifndef INCLUDED_volk_gnsssdr_32fc_convert_8ic_u_H
 | 
			
		||||
#define INCLUDED_volk_gnsssdr_32fc_convert_8ic_u_H
 | 
			
		||||
 | 
			
		||||
#ifdef LV_HAVE_SSE2
 | 
			
		||||
#include <emmintrin.h>
 | 
			
		||||
@@ -129,10 +132,6 @@ static inline void volk_gnsssdr_32fc_convert_8ic_generic(lv_8sc_t* outputVector,
 | 
			
		||||
#ifndef INCLUDED_volk_gnsssdr_32fc_convert_8ic_a_H
 | 
			
		||||
#define INCLUDED_volk_gnsssdr_32fc_convert_8ic_a_H
 | 
			
		||||
 | 
			
		||||
#include <volk/volk_common.h>
 | 
			
		||||
#include <inttypes.h>
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <math.h>
 | 
			
		||||
 | 
			
		||||
#ifdef LV_HAVE_SSE2
 | 
			
		||||
#include <emmintrin.h>
 | 
			
		||||
 
 | 
			
		||||
@@ -30,12 +30,15 @@
 | 
			
		||||
 * -------------------------------------------------------------------------
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#ifndef INCLUDED_volk_gnsssdr_32fc_s32f_convert_8ic_u_H
 | 
			
		||||
#define INCLUDED_volk_gnsssdr_32fc_s32f_convert_8ic_u_H
 | 
			
		||||
 | 
			
		||||
#include <inttypes.h>
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <math.h>
 | 
			
		||||
#include "volk_gnsssdr/volk_gnsssdr_complex.h"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
#ifndef INCLUDED_volk_gnsssdr_32fc_s32f_convert_8ic_u_H
 | 
			
		||||
#define INCLUDED_volk_gnsssdr_32fc_s32f_convert_8ic_u_H
 | 
			
		||||
 | 
			
		||||
#ifdef LV_HAVE_SSE2
 | 
			
		||||
#include <emmintrin.h>
 | 
			
		||||
@@ -138,10 +141,6 @@ static inline void volk_gnsssdr_32fc_s32f_convert_8ic_generic(lv_8sc_t* outputVe
 | 
			
		||||
#ifndef INCLUDED_volk_gnsssdr_32fc_s32f_convert_8ic_a_H
 | 
			
		||||
#define INCLUDED_volk_gnsssdr_32fc_s32f_convert_8ic_a_H
 | 
			
		||||
 | 
			
		||||
#include <volk/volk_common.h>
 | 
			
		||||
#include <inttypes.h>
 | 
			
		||||
#include <stdio.h>
 | 
			
		||||
#include <math.h>
 | 
			
		||||
 | 
			
		||||
#ifdef LV_HAVE_SSE2
 | 
			
		||||
#include <emmintrin.h>
 | 
			
		||||
 
 | 
			
		||||
@@ -67,12 +67,12 @@ galileo_e1_observables_cc::galileo_e1_observables_cc(unsigned int nchannels, boo
 | 
			
		||||
    d_dump_filename = dump_filename;
 | 
			
		||||
    d_flag_averaging = flag_averaging;
 | 
			
		||||
 | 
			
		||||
    for (int i=0;i<d_nchannels;i++)
 | 
			
		||||
    {
 | 
			
		||||
		d_acc_carrier_phase_queue_rads.push_back(std::deque<double>(d_nchannels));
 | 
			
		||||
		d_carrier_doppler_queue_hz.push_back(std::deque<double>(d_nchannels));
 | 
			
		||||
		d_symbol_TOW_queue_s.push_back(std::deque<double>(d_nchannels));
 | 
			
		||||
    }
 | 
			
		||||
    for (unsigned int i = 0; i < d_nchannels; i++)
 | 
			
		||||
        {
 | 
			
		||||
            d_acc_carrier_phase_queue_rads.push_back(std::deque<double>(d_nchannels));
 | 
			
		||||
            d_carrier_doppler_queue_hz.push_back(std::deque<double>(d_nchannels));
 | 
			
		||||
            d_symbol_TOW_queue_s.push_back(std::deque<double>(d_nchannels));
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    // ############# ENABLE DATA FILE LOG #################
 | 
			
		||||
    if (d_dump == true)
 | 
			
		||||
@@ -125,6 +125,10 @@ int galileo_e1_observables_cc::general_work (int noutput_items, gr_vector_int &n
 | 
			
		||||
    Gnss_Synchro current_gnss_synchro[d_nchannels];
 | 
			
		||||
    std::map<int,Gnss_Synchro> current_gnss_synchro_map;
 | 
			
		||||
    std::map<int,Gnss_Synchro>::iterator gnss_synchro_iter;
 | 
			
		||||
    if (d_nchannels != ninput_items.size())
 | 
			
		||||
        {
 | 
			
		||||
            LOG(WARNING) << "The Observables block is not well connected";
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * 1. Read the GNSS SYNCHRO objects from available channels
 | 
			
		||||
@@ -214,24 +218,25 @@ int galileo_e1_observables_cc::general_work (int noutput_items, gr_vector_int &n
 | 
			
		||||
				if (d_symbol_TOW_queue_s[gnss_synchro_iter->second.Channel_ID].size()>=GPS_L1_CA_HISTORY_DEEP)
 | 
			
		||||
				{
 | 
			
		||||
					// compute interpolated observation values for Doppler and Accumulate carrier phase
 | 
			
		||||
					symbol_TOW_vec_s=arma::vec(std::vector<double>(d_symbol_TOW_queue_s[gnss_synchro_iter->second.Channel_ID].begin(), d_symbol_TOW_queue_s[gnss_synchro_iter->second.Channel_ID].end()));
 | 
			
		||||
					acc_phase_vec_rads=arma::vec(std::vector<double>(d_acc_carrier_phase_queue_rads[gnss_synchro_iter->second.Channel_ID].begin(), d_acc_carrier_phase_queue_rads[gnss_synchro_iter->second.Channel_ID].end()));
 | 
			
		||||
					dopper_vec_hz=arma::vec(std::vector<double>(d_carrier_doppler_queue_hz[gnss_synchro_iter->second.Channel_ID].begin(), d_carrier_doppler_queue_hz[gnss_synchro_iter->second.Channel_ID].end()));
 | 
			
		||||
					desired_symbol_TOW[0]=symbol_TOW_vec_s[GPS_L1_CA_HISTORY_DEEP-1]+delta_rx_time_ms/1000.0;
 | 
			
		||||
					symbol_TOW_vec_s = arma::vec(std::vector<double>(d_symbol_TOW_queue_s[gnss_synchro_iter->second.Channel_ID].begin(), d_symbol_TOW_queue_s[gnss_synchro_iter->second.Channel_ID].end()));
 | 
			
		||||
					acc_phase_vec_rads = arma::vec(std::vector<double>(d_acc_carrier_phase_queue_rads[gnss_synchro_iter->second.Channel_ID].begin(), d_acc_carrier_phase_queue_rads[gnss_synchro_iter->second.Channel_ID].end()));
 | 
			
		||||
					dopper_vec_hz = arma::vec(std::vector<double>(d_carrier_doppler_queue_hz[gnss_synchro_iter->second.Channel_ID].begin(), d_carrier_doppler_queue_hz[gnss_synchro_iter->second.Channel_ID].end()));
 | 
			
		||||
					desired_symbol_TOW[0] = symbol_TOW_vec_s[GPS_L1_CA_HISTORY_DEEP - 1] + delta_rx_time_ms / 1000.0;
 | 
			
		||||
					// Curve fitting to cuadratic function
 | 
			
		||||
					arma::mat A=arma::ones<arma::mat> (GPS_L1_CA_HISTORY_DEEP,2);
 | 
			
		||||
					A.col(1)=symbol_TOW_vec_s;
 | 
			
		||||
					arma::mat A = arma::ones<arma::mat>(GPS_L1_CA_HISTORY_DEEP, 2);
 | 
			
		||||
					A.col(1) = symbol_TOW_vec_s;
 | 
			
		||||
					//A.col(2)=symbol_TOW_vec_s % symbol_TOW_vec_s;
 | 
			
		||||
					arma::mat coef_acc_phase(1,3);
 | 
			
		||||
					coef_acc_phase=arma::pinv(A.t()*A)*A.t()*acc_phase_vec_rads;
 | 
			
		||||
					arma::mat pinv_A = arma::pinv(A.t() * A) * A.t();
 | 
			
		||||
					coef_acc_phase = pinv_A * acc_phase_vec_rads;
 | 
			
		||||
					arma::mat coef_doppler(1,3);
 | 
			
		||||
					coef_doppler=arma::pinv(A.t()*A)*A.t()*dopper_vec_hz;
 | 
			
		||||
					coef_doppler = pinv_A * dopper_vec_hz;
 | 
			
		||||
					arma::vec acc_phase_lin;
 | 
			
		||||
					arma::vec carrier_doppler_lin;
 | 
			
		||||
					acc_phase_lin=coef_acc_phase[0]+coef_acc_phase[1]*desired_symbol_TOW[0];//+coef_acc_phase[2]*desired_symbol_TOW[0]*desired_symbol_TOW[0];
 | 
			
		||||
					carrier_doppler_lin=coef_doppler[0]+coef_doppler[1]*desired_symbol_TOW[0];//+coef_doppler[2]*desired_symbol_TOW[0]*desired_symbol_TOW[0];
 | 
			
		||||
					current_gnss_synchro[gnss_synchro_iter->second.Channel_ID].Carrier_phase_rads =acc_phase_lin[0];
 | 
			
		||||
					current_gnss_synchro[gnss_synchro_iter->second.Channel_ID].Carrier_Doppler_hz =carrier_doppler_lin[0];
 | 
			
		||||
					acc_phase_lin = coef_acc_phase[0] + coef_acc_phase[1] * desired_symbol_TOW[0];//+coef_acc_phase[2]*desired_symbol_TOW[0]*desired_symbol_TOW[0];
 | 
			
		||||
					carrier_doppler_lin = coef_doppler[0] + coef_doppler[1] * desired_symbol_TOW[0];//+coef_doppler[2]*desired_symbol_TOW[0]*desired_symbol_TOW[0];
 | 
			
		||||
					current_gnss_synchro[gnss_synchro_iter->second.Channel_ID].Carrier_phase_rads = acc_phase_lin[0];
 | 
			
		||||
					current_gnss_synchro[gnss_synchro_iter->second.Channel_ID].Carrier_Doppler_hz = carrier_doppler_lin[0];
 | 
			
		||||
				}
 | 
			
		||||
                }
 | 
			
		||||
        }
 | 
			
		||||
@@ -267,6 +272,10 @@ int galileo_e1_observables_cc::general_work (int noutput_items, gr_vector_int &n
 | 
			
		||||
        {
 | 
			
		||||
            *out[i] = current_gnss_synchro[i];
 | 
			
		||||
        }
 | 
			
		||||
    return 1; //Output the observables
 | 
			
		||||
    if (noutput_items == 0)
 | 
			
		||||
        {
 | 
			
		||||
            LOG(WARNING) << "noutput_items = 0";
 | 
			
		||||
        }
 | 
			
		||||
    return 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -64,7 +64,7 @@ gps_l1_ca_observables_cc::gps_l1_ca_observables_cc(unsigned int nchannels, boost
 | 
			
		||||
    d_dump_filename = dump_filename;
 | 
			
		||||
    d_flag_averaging = flag_averaging;
 | 
			
		||||
 | 
			
		||||
    for (int i = 0; i < d_nchannels; i++)
 | 
			
		||||
    for (unsigned int i = 0; i < d_nchannels; i++)
 | 
			
		||||
        {
 | 
			
		||||
            d_acc_carrier_phase_queue_rads.push_back(std::deque<double>(d_nchannels));
 | 
			
		||||
            d_carrier_doppler_queue_hz.push_back(std::deque<double>(d_nchannels));
 | 
			
		||||
@@ -119,6 +119,11 @@ int gps_l1_ca_observables_cc::general_work (int noutput_items, gr_vector_int &ni
 | 
			
		||||
    Gnss_Synchro current_gnss_synchro[d_nchannels];
 | 
			
		||||
    std::map<int,Gnss_Synchro> current_gnss_synchro_map;
 | 
			
		||||
    std::map<int,Gnss_Synchro>::iterator gnss_synchro_iter;
 | 
			
		||||
    
 | 
			
		||||
    if (d_nchannels != ninput_items.size())
 | 
			
		||||
        {
 | 
			
		||||
            LOG(WARNING) << "The Observables block is not well connected";
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * 1. Read the GNSS SYNCHRO objects from available channels
 | 
			
		||||
@@ -229,9 +234,10 @@ int gps_l1_ca_observables_cc::general_work (int noutput_items, gr_vector_int &ni
 | 
			
		||||
                            A.col(1) = symbol_TOW_vec_s;
 | 
			
		||||
                            //A.col(2)=symbol_TOW_vec_s % symbol_TOW_vec_s;
 | 
			
		||||
                            arma::mat coef_acc_phase(1,3);
 | 
			
		||||
                            coef_acc_phase = arma::pinv(A.t() * A) * A.t() * acc_phase_vec_rads;
 | 
			
		||||
                            arma::mat pinv_A = arma::pinv(A.t() * A) * A.t();
 | 
			
		||||
                            coef_acc_phase = pinv_A * acc_phase_vec_rads;
 | 
			
		||||
                            arma::mat coef_doppler(1,3);
 | 
			
		||||
                            coef_doppler = arma::pinv(A.t() * A) * A.t() * dopper_vec_hz;
 | 
			
		||||
                            coef_doppler = pinv_A * dopper_vec_hz;
 | 
			
		||||
                            arma::vec acc_phase_lin;
 | 
			
		||||
                            arma::vec carrier_doppler_lin;
 | 
			
		||||
                            acc_phase_lin = coef_acc_phase[0] + coef_acc_phase[1] * desired_symbol_TOW[0];//+coef_acc_phase[2]*desired_symbol_TOW[0]*desired_symbol_TOW[0];
 | 
			
		||||
@@ -281,6 +287,10 @@ int gps_l1_ca_observables_cc::general_work (int noutput_items, gr_vector_int &ni
 | 
			
		||||
        {
 | 
			
		||||
            *out[i] = current_gnss_synchro[i];
 | 
			
		||||
        }
 | 
			
		||||
    return 1; // Output the observables
 | 
			
		||||
    if (noutput_items == 0)
 | 
			
		||||
        {
 | 
			
		||||
            LOG(WARNING) << "noutput_items = 0";
 | 
			
		||||
        }
 | 
			
		||||
    return 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -121,6 +121,11 @@ int hybrid_observables_cc::general_work (int noutput_items, gr_vector_int &ninpu
 | 
			
		||||
    std::map<int,Gnss_Synchro> current_gnss_synchro_map_gps_only;
 | 
			
		||||
    std::map<int,Gnss_Synchro>::iterator gnss_synchro_iter;
 | 
			
		||||
 | 
			
		||||
    if (d_nchannels != ninput_items.size())
 | 
			
		||||
        {
 | 
			
		||||
            LOG(WARNING) << "The Observables block is not well connected";
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * 1. Read the GNSS SYNCHRO objects from available channels
 | 
			
		||||
     */
 | 
			
		||||
@@ -228,7 +233,11 @@ int hybrid_observables_cc::general_work (int noutput_items, gr_vector_int &ninpu
 | 
			
		||||
        {
 | 
			
		||||
            *out[i] = current_gnss_synchro[i];
 | 
			
		||||
        }
 | 
			
		||||
    //todo: enable output when the hybrid algorithm is completed
 | 
			
		||||
    return 1; //Output the observables
 | 
			
		||||
 | 
			
		||||
    if (noutput_items == 0)
 | 
			
		||||
        {
 | 
			
		||||
            LOG(WARNING) << "noutput_items = 0";
 | 
			
		||||
        }
 | 
			
		||||
    return 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -112,6 +112,11 @@ int mixed_observables_cc::general_work (int noutput_items, gr_vector_int &ninput
 | 
			
		||||
    std::map<int,Gnss_Synchro> current_gnss_synchro_map;
 | 
			
		||||
    std::map<int,Gnss_Synchro>::iterator gnss_synchro_iter;
 | 
			
		||||
 | 
			
		||||
    if (d_nchannels != ninput_items.size())
 | 
			
		||||
        {
 | 
			
		||||
            LOG(WARNING) << "The Observables block is not well connected";
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
     * 1. Read the GNSS SYNCHRO objects from available channels
 | 
			
		||||
     */
 | 
			
		||||
@@ -207,6 +212,10 @@ int mixed_observables_cc::general_work (int noutput_items, gr_vector_int &ninput
 | 
			
		||||
        {
 | 
			
		||||
            *out[i] = current_gnss_synchro[i];
 | 
			
		||||
        }
 | 
			
		||||
    return 1; // Output the observables
 | 
			
		||||
    if (noutput_items == 0)
 | 
			
		||||
        {
 | 
			
		||||
            LOG(WARNING) << "noutput_items = 0";
 | 
			
		||||
        }
 | 
			
		||||
    return 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -329,8 +329,8 @@ gr_vector_void_star &output_items)
 | 
			
		||||
				    // New random data bit
 | 
			
		||||
				    current_data_bit_int_[sat] = (rand()%2) == 0 ? 1 : -1;
 | 
			
		||||
				}
 | 
			
		||||
        		    data_modulation_[sat] = current_data_bit_int_[sat] * (Galileo_E5a_I_SECONDARY_CODE.at((ms_counter_[sat]+delay_sec_[sat])%20)=='0' ? 1 : -1);
 | 
			
		||||
        		    pilot_modulation_[sat] = (Galileo_E5a_Q_SECONDARY_CODE[PRN_[sat] - 1].at((ms_counter_[sat] + delay_sec_[sat]) % 100)=='0' ? 1 : -1);
 | 
			
		||||
        		    data_modulation_[sat] = current_data_bit_int_[sat] * (Galileo_E5a_I_SECONDARY_CODE.at((ms_counter_[sat]+delay_sec_[sat]) % 20) == '0' ? 1 : -1);
 | 
			
		||||
        		    pilot_modulation_[sat] = (Galileo_E5a_Q_SECONDARY_CODE[PRN_[sat] - 1].at((ms_counter_[sat] + delay_sec_[sat]) % 100) == '0' ? 1 : -1);
 | 
			
		||||
 | 
			
		||||
        		    ms_counter_[sat] = ms_counter_[sat] + static_cast<int>(round(1e3*GALILEO_E5a_CODE_PERIOD));
 | 
			
		||||
 | 
			
		||||
@@ -384,6 +384,11 @@ gr_vector_void_star &output_items)
 | 
			
		||||
                }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    if((noutput_items == 0) || (ninput_items.size() != 0) || input_items[0] == 0)
 | 
			
		||||
        {
 | 
			
		||||
            // do nothing
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    // Tell runtime system how many output items we produced.
 | 
			
		||||
    return 1;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -160,7 +160,7 @@ int unpack_2bit_samples::work(int noutput_items,
 | 
			
		||||
    {
 | 
			
		||||
        if( swap_endian_bytes_ )
 | 
			
		||||
        {
 | 
			
		||||
            for(int i = 0; i < ninput_bytes; ++i)
 | 
			
		||||
            for(unsigned int i = 0; i < ninput_bytes; ++i)
 | 
			
		||||
            {
 | 
			
		||||
                // Read packed input sample (1 byte = 4 samples)
 | 
			
		||||
                raw_byte.byte = in[i];
 | 
			
		||||
@@ -174,7 +174,7 @@ int unpack_2bit_samples::work(int noutput_items,
 | 
			
		||||
        }
 | 
			
		||||
        else
 | 
			
		||||
        {
 | 
			
		||||
            for( int i = 0; i < ninput_bytes; ++i )
 | 
			
		||||
            for(unsigned int i = 0; i < ninput_bytes; ++i )
 | 
			
		||||
            {
 | 
			
		||||
 | 
			
		||||
                // Read packed input sample (1 byte = 4 samples)
 | 
			
		||||
@@ -192,7 +192,7 @@ int unpack_2bit_samples::work(int noutput_items,
 | 
			
		||||
 | 
			
		||||
        if( swap_endian_bytes_ )
 | 
			
		||||
        {
 | 
			
		||||
            for(int i = 0; i < ninput_bytes; ++i)
 | 
			
		||||
            for(unsigned int i = 0; i < ninput_bytes; ++i)
 | 
			
		||||
            {
 | 
			
		||||
                // Read packed input sample (1 byte = 4 samples)
 | 
			
		||||
                raw_byte.byte = in[i];
 | 
			
		||||
@@ -206,7 +206,7 @@ int unpack_2bit_samples::work(int noutput_items,
 | 
			
		||||
        }
 | 
			
		||||
        else
 | 
			
		||||
        {
 | 
			
		||||
            for( int i = 0; i < ninput_bytes; ++i )
 | 
			
		||||
            for(unsigned int i = 0; i < ninput_bytes; ++i )
 | 
			
		||||
            {
 | 
			
		||||
 | 
			
		||||
                // Read packed input sample (1 byte = 4 samples)
 | 
			
		||||
 
 | 
			
		||||
@@ -62,14 +62,10 @@ GalileoE1BTelemetryDecoder::GalileoE1BTelemetryDecoder(ConfigurationInterface* c
 | 
			
		||||
    std::string default_item_type = "gr_complex";
 | 
			
		||||
    std::string default_dump_filename = "./navigation.dat";
 | 
			
		||||
    DLOG(INFO) << "role " << role;
 | 
			
		||||
    DLOG(INFO) << "vector length " << vector_length_;
 | 
			
		||||
    vector_length_ = configuration->property(role + ".vector_length", 2048);
 | 
			
		||||
    dump_ = configuration->property(role + ".dump", false);
 | 
			
		||||
    dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
 | 
			
		||||
    int fs_in;
 | 
			
		||||
    fs_in = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
 | 
			
		||||
    // make telemetry decoder object
 | 
			
		||||
    telemetry_decoder_ = galileo_e1b_make_telemetry_decoder_cc(satellite_, 0, (long)fs_in, vector_length_, queue_, dump_); // TODO fix me
 | 
			
		||||
    telemetry_decoder_ = galileo_e1b_make_telemetry_decoder_cc(satellite_, queue_, dump_); // TODO fix me
 | 
			
		||||
    DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")";
 | 
			
		||||
    // set the navigation msg queue;
 | 
			
		||||
    telemetry_decoder_->set_ephemeris_queue(&global_galileo_ephemeris_queue);
 | 
			
		||||
 
 | 
			
		||||
@@ -88,7 +88,6 @@ private:
 | 
			
		||||
    galileo_e1b_telemetry_decoder_cc_sptr telemetry_decoder_;
 | 
			
		||||
    Gnss_Satellite satellite_;
 | 
			
		||||
    int channel_;
 | 
			
		||||
    unsigned int vector_length_;
 | 
			
		||||
    std::string item_type_;
 | 
			
		||||
    bool dump_;
 | 
			
		||||
    std::string dump_filename_;
 | 
			
		||||
 
 | 
			
		||||
@@ -66,14 +66,10 @@ GalileoE5aTelemetryDecoder::GalileoE5aTelemetryDecoder(ConfigurationInterface* c
 | 
			
		||||
    std::string default_item_type = "gr_complex";
 | 
			
		||||
    std::string default_dump_filename = "./navigation.dat";
 | 
			
		||||
    DLOG(INFO) << "role " << role;
 | 
			
		||||
    DLOG(INFO) << "vector length " << vector_length_;
 | 
			
		||||
    vector_length_ = configuration->property(role + ".vector_length", 2048);
 | 
			
		||||
    dump_ = configuration->property(role + ".dump", false);
 | 
			
		||||
    dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
 | 
			
		||||
    int fs_in;
 | 
			
		||||
    fs_in = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
 | 
			
		||||
    // make telemetry decoder object
 | 
			
		||||
    telemetry_decoder_ = galileo_e5a_make_telemetry_decoder_cc(satellite_, 0, (long)fs_in, vector_length_, queue_, dump_); // TODO fix me
 | 
			
		||||
    telemetry_decoder_ = galileo_e5a_make_telemetry_decoder_cc(satellite_, queue_, dump_); // TODO fix me
 | 
			
		||||
    DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")";
 | 
			
		||||
    // set the navigation msg queue;
 | 
			
		||||
    telemetry_decoder_->set_ephemeris_queue(&global_galileo_ephemeris_queue);
 | 
			
		||||
 
 | 
			
		||||
@@ -89,7 +89,6 @@ private:
 | 
			
		||||
    galileo_e5a_telemetry_decoder_cc_sptr telemetry_decoder_;
 | 
			
		||||
    Gnss_Satellite satellite_;
 | 
			
		||||
    int channel_;
 | 
			
		||||
    unsigned int vector_length_;
 | 
			
		||||
    std::string item_type_;
 | 
			
		||||
    bool dump_;
 | 
			
		||||
    std::string dump_filename_;
 | 
			
		||||
 
 | 
			
		||||
@@ -61,14 +61,10 @@ GpsL1CaTelemetryDecoder::GpsL1CaTelemetryDecoder(ConfigurationInterface* configu
 | 
			
		||||
    std::string default_item_type = "gr_complex";
 | 
			
		||||
    std::string default_dump_filename = "./navigation.dat";
 | 
			
		||||
    DLOG(INFO) << "role " << role;
 | 
			
		||||
    DLOG(INFO) << "vector length " << vector_length_;
 | 
			
		||||
    vector_length_ = configuration->property(role + ".vector_length", 2048);
 | 
			
		||||
    dump_ = configuration->property(role + ".dump", false);
 | 
			
		||||
    dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
 | 
			
		||||
    int fs_in;
 | 
			
		||||
    fs_in = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
 | 
			
		||||
    // make telemetry decoder object
 | 
			
		||||
    telemetry_decoder_ = gps_l1_ca_make_telemetry_decoder_cc(satellite_, 0, (long)fs_in, vector_length_, queue_, dump_); // TODO fix me
 | 
			
		||||
    telemetry_decoder_ = gps_l1_ca_make_telemetry_decoder_cc(satellite_, queue_, dump_); // TODO fix me
 | 
			
		||||
    DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")";
 | 
			
		||||
    // set the navigation msg queue;
 | 
			
		||||
    telemetry_decoder_->set_ephemeris_queue(&global_gps_ephemeris_queue);
 | 
			
		||||
 
 | 
			
		||||
@@ -83,7 +83,6 @@ private:
 | 
			
		||||
    gps_l1_ca_telemetry_decoder_cc_sptr telemetry_decoder_;
 | 
			
		||||
    Gnss_Satellite satellite_;
 | 
			
		||||
    int channel_;
 | 
			
		||||
    unsigned int vector_length_;
 | 
			
		||||
    std::string item_type_;
 | 
			
		||||
    bool dump_;
 | 
			
		||||
    std::string dump_filename_;
 | 
			
		||||
 
 | 
			
		||||
@@ -61,14 +61,10 @@ GpsL2MTelemetryDecoder::GpsL2MTelemetryDecoder(ConfigurationInterface* configura
 | 
			
		||||
    std::string default_item_type = "gr_complex";
 | 
			
		||||
    std::string default_dump_filename = "./navigation.dat";
 | 
			
		||||
    DLOG(INFO) << "role " << role;
 | 
			
		||||
    DLOG(INFO) << "vector length " << vector_length_;
 | 
			
		||||
    vector_length_ = configuration->property(role + ".vector_length", 2048);
 | 
			
		||||
    dump_ = configuration->property(role + ".dump", false);
 | 
			
		||||
    dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
 | 
			
		||||
    int fs_in;
 | 
			
		||||
    fs_in = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
 | 
			
		||||
    // make telemetry decoder object
 | 
			
		||||
    telemetry_decoder_ = gps_l2_m_make_telemetry_decoder_cc(satellite_, 0, (long)fs_in, vector_length_, queue_, dump_); // TODO fix me
 | 
			
		||||
    telemetry_decoder_ = gps_l2_m_make_telemetry_decoder_cc(satellite_, queue_, dump_); // TODO fix me
 | 
			
		||||
    DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")";
 | 
			
		||||
    // set the navigation msg queue;
 | 
			
		||||
    telemetry_decoder_->set_ephemeris_queue(&global_gps_cnav_ephemeris_queue);
 | 
			
		||||
 
 | 
			
		||||
@@ -83,7 +83,6 @@ private:
 | 
			
		||||
    gps_l2_m_telemetry_decoder_cc_sptr telemetry_decoder_;
 | 
			
		||||
    Gnss_Satellite satellite_;
 | 
			
		||||
    int channel_;
 | 
			
		||||
    unsigned int vector_length_;
 | 
			
		||||
    std::string item_type_;
 | 
			
		||||
    bool dump_;
 | 
			
		||||
    std::string dump_filename_;
 | 
			
		||||
 
 | 
			
		||||
@@ -61,14 +61,10 @@ SbasL1TelemetryDecoder::SbasL1TelemetryDecoder(ConfigurationInterface* configura
 | 
			
		||||
    std::string default_item_type = "gr_complex";
 | 
			
		||||
    std::string default_dump_filename = "./navigation.dat";
 | 
			
		||||
    DLOG(INFO) << "role " << role;
 | 
			
		||||
    DLOG(INFO) << "vector length " << vector_length_;
 | 
			
		||||
    vector_length_ = configuration->property(role + ".vector_length", 2048);
 | 
			
		||||
    dump_ = configuration->property(role + ".dump", false);
 | 
			
		||||
    dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename);
 | 
			
		||||
    int fs_in;
 | 
			
		||||
    fs_in = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
 | 
			
		||||
    // make telemetry decoder object
 | 
			
		||||
    telemetry_decoder_ = sbas_l1_make_telemetry_decoder_cc(satellite_, 0, (long)fs_in, vector_length_, queue_, dump_); // TODO fix me
 | 
			
		||||
    telemetry_decoder_ = sbas_l1_make_telemetry_decoder_cc(satellite_, queue_, dump_); // TODO fix me
 | 
			
		||||
    channel_ = 0;
 | 
			
		||||
    DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")";
 | 
			
		||||
    // set the queues;
 | 
			
		||||
 
 | 
			
		||||
@@ -86,7 +86,6 @@ private:
 | 
			
		||||
    sbas_l1_telemetry_decoder_cc_sptr telemetry_decoder_;
 | 
			
		||||
    Gnss_Satellite satellite_;
 | 
			
		||||
    int channel_;
 | 
			
		||||
    unsigned int vector_length_;
 | 
			
		||||
    std::string item_type_;
 | 
			
		||||
    bool dump_;
 | 
			
		||||
    std::string dump_filename_;
 | 
			
		||||
 
 | 
			
		||||
@@ -50,18 +50,19 @@ using google::LogMessage;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
galileo_e1b_telemetry_decoder_cc_sptr
 | 
			
		||||
galileo_e1b_make_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in, unsigned
 | 
			
		||||
		int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump)
 | 
			
		||||
galileo_e1b_make_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump)
 | 
			
		||||
{
 | 
			
		||||
    return galileo_e1b_telemetry_decoder_cc_sptr(new galileo_e1b_telemetry_decoder_cc(satellite, if_freq,
 | 
			
		||||
            fs_in, vector_length, queue, dump));
 | 
			
		||||
    return galileo_e1b_telemetry_decoder_cc_sptr(new galileo_e1b_telemetry_decoder_cc(satellite, queue, dump));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
void galileo_e1b_telemetry_decoder_cc::forecast (int noutput_items, gr_vector_int &ninput_items_required)
 | 
			
		||||
{
 | 
			
		||||
    ninput_items_required[0] = GALILEO_INAV_PAGE_SYMBOLS; // set the required sample history
 | 
			
		||||
    if(noutput_items != 0)
 | 
			
		||||
        {
 | 
			
		||||
            ninput_items_required[0] = GALILEO_INAV_PAGE_SYMBOLS; // set the required sample history
 | 
			
		||||
        }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -116,10 +117,6 @@ void galileo_e1b_telemetry_decoder_cc::deinterleaver(int rows, int cols, double
 | 
			
		||||
 | 
			
		||||
galileo_e1b_telemetry_decoder_cc::galileo_e1b_telemetry_decoder_cc(
 | 
			
		||||
        Gnss_Satellite satellite,
 | 
			
		||||
        long if_freq,
 | 
			
		||||
        long fs_in,
 | 
			
		||||
        unsigned
 | 
			
		||||
        int vector_length,
 | 
			
		||||
        boost::shared_ptr<gr::msg_queue> queue,
 | 
			
		||||
        bool dump) :
 | 
			
		||||
           gr::block("galileo_e1b_telemetry_decoder_cc", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)),
 | 
			
		||||
@@ -130,9 +127,7 @@ galileo_e1b_telemetry_decoder_cc::galileo_e1b_telemetry_decoder_cc(
 | 
			
		||||
    d_dump = dump;
 | 
			
		||||
    d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
 | 
			
		||||
    LOG(INFO) << "Initializing GALILEO E1B TELEMETRY PROCESSING";
 | 
			
		||||
    d_vector_length = vector_length;
 | 
			
		||||
    d_samples_per_symbol = ( Galileo_E1_CODE_CHIP_RATE_HZ / Galileo_E1_B_CODE_LENGTH_CHIPS ) / Galileo_E1_B_SYMBOL_RATE_BPS;
 | 
			
		||||
    d_fs_in = fs_in;
 | 
			
		||||
 | 
			
		||||
    // set the preamble
 | 
			
		||||
    unsigned short int preambles_bits[GALILEO_INAV_PREAMBLE_LENGTH_BITS] = GALILEO_INAV_PREAMBLE;
 | 
			
		||||
@@ -499,6 +494,10 @@ int galileo_e1b_telemetry_decoder_cc::general_work (int noutput_items, gr_vector
 | 
			
		||||
        }
 | 
			
		||||
    //todo: implement averaging
 | 
			
		||||
    d_average_count++;
 | 
			
		||||
    if((noutput_items == 0) || (ninput_items[0] == 0))
 | 
			
		||||
        {
 | 
			
		||||
            LOG(WARNING) << "noutput_items = 0";
 | 
			
		||||
        }
 | 
			
		||||
    if (d_average_count == d_decimation_output_factor)
 | 
			
		||||
        {
 | 
			
		||||
            d_average_count = 0;
 | 
			
		||||
 
 | 
			
		||||
@@ -54,8 +54,7 @@ class galileo_e1b_telemetry_decoder_cc;
 | 
			
		||||
 | 
			
		||||
typedef boost::shared_ptr<galileo_e1b_telemetry_decoder_cc> galileo_e1b_telemetry_decoder_cc_sptr;
 | 
			
		||||
 | 
			
		||||
galileo_e1b_telemetry_decoder_cc_sptr galileo_e1b_make_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in, unsigned
 | 
			
		||||
    int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump);
 | 
			
		||||
galileo_e1b_telemetry_decoder_cc_sptr galileo_e1b_make_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump);
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 * \brief This class implements a block that decodes the INAV data defined in Galileo ICD
 | 
			
		||||
@@ -92,10 +91,8 @@ public:
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
    friend galileo_e1b_telemetry_decoder_cc_sptr
 | 
			
		||||
    galileo_e1b_make_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in,unsigned
 | 
			
		||||
            int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump);
 | 
			
		||||
    galileo_e1b_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in, unsigned
 | 
			
		||||
            int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump);
 | 
			
		||||
    galileo_e1b_make_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump);
 | 
			
		||||
    galileo_e1b_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump);
 | 
			
		||||
 | 
			
		||||
    void viterbi_decoder(double *page_part_symbols, int *page_part_bits);
 | 
			
		||||
 | 
			
		||||
@@ -105,7 +102,7 @@ private:
 | 
			
		||||
 | 
			
		||||
    unsigned short int d_preambles_bits[GALILEO_INAV_PREAMBLE_LENGTH_BITS];
 | 
			
		||||
 | 
			
		||||
    signed int *d_preambles_symbols;
 | 
			
		||||
    int *d_preambles_symbols;
 | 
			
		||||
    unsigned int d_samples_per_symbol;
 | 
			
		||||
    int d_symbols_per_preamble;
 | 
			
		||||
 | 
			
		||||
@@ -118,8 +115,6 @@ private:
 | 
			
		||||
    bool d_flag_preamble;
 | 
			
		||||
    int d_CRC_error_counter;
 | 
			
		||||
 | 
			
		||||
    long d_fs_in;
 | 
			
		||||
 | 
			
		||||
    // navigation message vars
 | 
			
		||||
    Galileo_Navigation_Message d_nav;
 | 
			
		||||
 | 
			
		||||
@@ -133,7 +128,6 @@ private:
 | 
			
		||||
    concurrent_queue<Galileo_Almanac> *d_almanac_queue;
 | 
			
		||||
 | 
			
		||||
    boost::shared_ptr<gr::msg_queue> d_queue;
 | 
			
		||||
    unsigned int d_vector_length;
 | 
			
		||||
    bool d_dump;
 | 
			
		||||
    Gnss_Satellite d_satellite;
 | 
			
		||||
    int d_channel;
 | 
			
		||||
@@ -151,7 +145,6 @@ private:
 | 
			
		||||
    bool flag_TOW_set;
 | 
			
		||||
    double delta_t; //GPS-GALILEO time offset
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    std::string d_dump_filename;
 | 
			
		||||
    std::ofstream d_dump_file;
 | 
			
		||||
};
 | 
			
		||||
 
 | 
			
		||||
@@ -55,17 +55,18 @@ using google::LogMessage;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
galileo_e5a_telemetry_decoder_cc_sptr
 | 
			
		||||
galileo_e5a_make_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in, unsigned
 | 
			
		||||
		int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump)
 | 
			
		||||
galileo_e5a_make_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump)
 | 
			
		||||
{
 | 
			
		||||
    return galileo_e5a_telemetry_decoder_cc_sptr(new galileo_e5a_telemetry_decoder_cc(satellite, if_freq,
 | 
			
		||||
            fs_in, vector_length, queue, dump));
 | 
			
		||||
    return galileo_e5a_telemetry_decoder_cc_sptr(new galileo_e5a_telemetry_decoder_cc(satellite, queue, dump));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void galileo_e5a_telemetry_decoder_cc::forecast (int noutput_items, gr_vector_int &ninput_items_required)
 | 
			
		||||
{
 | 
			
		||||
    //ninput_items_required[0] = GALILEO_FNAV_SAMPLES_PER_PAGE; // set the required sample history
 | 
			
		||||
    ninput_items_required[0] = GALILEO_FNAV_CODES_PER_PREAMBLE;
 | 
			
		||||
    if (noutput_items != 0)
 | 
			
		||||
        {
 | 
			
		||||
            ninput_items_required[0] = GALILEO_FNAV_CODES_PER_PREAMBLE;
 | 
			
		||||
        }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void galileo_e5a_telemetry_decoder_cc::viterbi_decoder(double *page_part_symbols, int *page_part_bits)
 | 
			
		||||
@@ -192,10 +193,6 @@ void galileo_e5a_telemetry_decoder_cc::decode_word(double *page_symbols,int fram
 | 
			
		||||
 | 
			
		||||
galileo_e5a_telemetry_decoder_cc::galileo_e5a_telemetry_decoder_cc(
 | 
			
		||||
        Gnss_Satellite satellite,
 | 
			
		||||
        long if_freq,
 | 
			
		||||
        long fs_in,
 | 
			
		||||
        unsigned
 | 
			
		||||
        int vector_length,
 | 
			
		||||
        boost::shared_ptr<gr::msg_queue> queue,
 | 
			
		||||
        bool dump) :
 | 
			
		||||
           gr::block("galileo_e5a_telemetry_decoder_cc", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)),
 | 
			
		||||
@@ -206,9 +203,7 @@ galileo_e5a_telemetry_decoder_cc::galileo_e5a_telemetry_decoder_cc(
 | 
			
		||||
    d_dump = dump;
 | 
			
		||||
    d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
 | 
			
		||||
    LOG(INFO) << "GALILEO E5A TELEMETRY PROCESSING: satellite " << d_satellite;
 | 
			
		||||
    d_vector_length = vector_length;
 | 
			
		||||
    //d_samples_per_symbol = ( Galileo_E5a_CODE_CHIP_RATE_HZ / Galileo_E5a_CODE_LENGTH_CHIPS ) / Galileo_E1_B_SYMBOL_RATE_BPS;
 | 
			
		||||
    d_fs_in = fs_in;
 | 
			
		||||
 | 
			
		||||
    // set the preamble
 | 
			
		||||
    //unsigned short int preambles_bits[GALILEO_FNAV_PREAMBLE_LENGTH_BITS] = GALILEO_FNAV_PREAMBLE;
 | 
			
		||||
@@ -585,6 +580,10 @@ int galileo_e5a_telemetry_decoder_cc::general_work (int noutput_items, gr_vector
 | 
			
		||||
    d_sample_counter++; //count for the processed samples
 | 
			
		||||
    //3. Make the output (copy the object contents to the GNURadio reserved memory)
 | 
			
		||||
    *out[0] = current_synchro_data;
 | 
			
		||||
    if((noutput_items == 0) || (ninput_items[0] == 0))
 | 
			
		||||
        {
 | 
			
		||||
            LOG(WARNING) << "noutput_items = 0";
 | 
			
		||||
        }
 | 
			
		||||
    return 1;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -58,8 +58,7 @@ class galileo_e5a_telemetry_decoder_cc;
 | 
			
		||||
 | 
			
		||||
typedef boost::shared_ptr<galileo_e5a_telemetry_decoder_cc> galileo_e5a_telemetry_decoder_cc_sptr;
 | 
			
		||||
 | 
			
		||||
galileo_e5a_telemetry_decoder_cc_sptr galileo_e5a_make_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in, unsigned
 | 
			
		||||
    int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump);
 | 
			
		||||
galileo_e5a_telemetry_decoder_cc_sptr galileo_e5a_make_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
@@ -90,10 +89,8 @@ public:
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
    friend galileo_e5a_telemetry_decoder_cc_sptr
 | 
			
		||||
    galileo_e5a_make_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in,unsigned
 | 
			
		||||
            int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump);
 | 
			
		||||
    galileo_e5a_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in, unsigned
 | 
			
		||||
            int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump);
 | 
			
		||||
    galileo_e5a_make_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump);
 | 
			
		||||
    galileo_e5a_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump);
 | 
			
		||||
 | 
			
		||||
    void viterbi_decoder(double *page_part_symbols, int *page_part_bits);
 | 
			
		||||
 | 
			
		||||
@@ -101,10 +98,10 @@ private:
 | 
			
		||||
 | 
			
		||||
    void decode_word(double *page_symbols,int frame_length);
 | 
			
		||||
 | 
			
		||||
    signed int d_preamble_bits[GALILEO_FNAV_PREAMBLE_LENGTH_BITS];
 | 
			
		||||
//    signed int d_page_symbols[GALILEO_FNAV_SYMBOLS_PER_PAGE + GALILEO_FNAV_PREAMBLE_LENGTH_BITS];
 | 
			
		||||
    int d_preamble_bits[GALILEO_FNAV_PREAMBLE_LENGTH_BITS];
 | 
			
		||||
    // signed int d_page_symbols[GALILEO_FNAV_SYMBOLS_PER_PAGE + GALILEO_FNAV_PREAMBLE_LENGTH_BITS];
 | 
			
		||||
    double d_page_symbols[GALILEO_FNAV_SYMBOLS_PER_PAGE + GALILEO_FNAV_PREAMBLE_LENGTH_BITS];
 | 
			
		||||
   // signed int *d_preamble_symbols;
 | 
			
		||||
    // signed int *d_preamble_symbols;
 | 
			
		||||
    double d_current_symbol;
 | 
			
		||||
    long unsigned int d_symbol_counter;
 | 
			
		||||
    int d_prompt_counter;
 | 
			
		||||
@@ -120,8 +117,6 @@ private:
 | 
			
		||||
    bool d_flag_preamble;
 | 
			
		||||
    int d_CRC_error_counter;
 | 
			
		||||
 | 
			
		||||
    long d_fs_in;
 | 
			
		||||
 | 
			
		||||
    // navigation message vars
 | 
			
		||||
    Galileo_Fnav_Message d_nav;
 | 
			
		||||
 | 
			
		||||
@@ -135,7 +130,6 @@ private:
 | 
			
		||||
    concurrent_queue<Galileo_Almanac> *d_almanac_queue;
 | 
			
		||||
 | 
			
		||||
    boost::shared_ptr<gr::msg_queue> d_queue;
 | 
			
		||||
    unsigned int d_vector_length;
 | 
			
		||||
    bool d_dump;
 | 
			
		||||
    Gnss_Satellite d_satellite;
 | 
			
		||||
    int d_channel;
 | 
			
		||||
 
 | 
			
		||||
@@ -52,20 +52,21 @@ using google::LogMessage;
 | 
			
		||||
 * \todo name and move the magic numbers to GPS_L1_CA.h
 | 
			
		||||
 */
 | 
			
		||||
gps_l1_ca_telemetry_decoder_cc_sptr
 | 
			
		||||
gps_l1_ca_make_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in, unsigned
 | 
			
		||||
        int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump)
 | 
			
		||||
gps_l1_ca_make_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump)
 | 
			
		||||
{
 | 
			
		||||
    return gps_l1_ca_telemetry_decoder_cc_sptr(new gps_l1_ca_telemetry_decoder_cc(satellite, if_freq,
 | 
			
		||||
            fs_in, vector_length, queue, dump));
 | 
			
		||||
    return gps_l1_ca_telemetry_decoder_cc_sptr(new gps_l1_ca_telemetry_decoder_cc(satellite, queue, dump));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
void gps_l1_ca_telemetry_decoder_cc::forecast (int noutput_items, gr_vector_int &ninput_items_required)
 | 
			
		||||
{
 | 
			
		||||
    for (unsigned i = 0; i < 3; i++)
 | 
			
		||||
    if (noutput_items != 0)
 | 
			
		||||
        {
 | 
			
		||||
            ninput_items_required[i] = d_samples_per_bit * 8; //set the required sample history
 | 
			
		||||
            for (unsigned i = 0; i < 3; i++)
 | 
			
		||||
                {
 | 
			
		||||
                    ninput_items_required[i] = d_samples_per_bit * 8; //set the required sample history
 | 
			
		||||
                }
 | 
			
		||||
        }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -73,10 +74,6 @@ void gps_l1_ca_telemetry_decoder_cc::forecast (int noutput_items, gr_vector_int
 | 
			
		||||
 | 
			
		||||
gps_l1_ca_telemetry_decoder_cc::gps_l1_ca_telemetry_decoder_cc(
 | 
			
		||||
        Gnss_Satellite satellite,
 | 
			
		||||
        long if_freq,
 | 
			
		||||
        long fs_in,
 | 
			
		||||
        unsigned
 | 
			
		||||
        int vector_length,
 | 
			
		||||
        boost::shared_ptr<gr::msg_queue> queue,
 | 
			
		||||
        bool dump) :
 | 
			
		||||
        gr::block("gps_navigation_cc", gr::io_signature::make(1, 1, sizeof(Gnss_Synchro)),
 | 
			
		||||
@@ -86,9 +83,7 @@ gps_l1_ca_telemetry_decoder_cc::gps_l1_ca_telemetry_decoder_cc(
 | 
			
		||||
    d_queue = queue;
 | 
			
		||||
    d_dump = dump;
 | 
			
		||||
    d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
 | 
			
		||||
    d_vector_length = vector_length;
 | 
			
		||||
    d_samples_per_bit = ( GPS_L1_CA_CODE_RATE_HZ / GPS_L1_CA_CODE_LENGTH_CHIPS ) / GPS_CA_TELEMETRY_RATE_BITS_SECOND;
 | 
			
		||||
    d_fs_in = fs_in;
 | 
			
		||||
    //d_preamble_duration_seconds = (1.0 / GPS_CA_TELEMETRY_RATE_BITS_SECOND) * GPS_CA_PREAMBLE_LENGTH_BITS;
 | 
			
		||||
    //std::cout<<"d_preamble_duration_seconds="<<d_preamble_duration_seconds<<"\r\n";
 | 
			
		||||
    // set the preamble
 | 
			
		||||
@@ -371,6 +366,10 @@ int gps_l1_ca_telemetry_decoder_cc::general_work (int noutput_items, gr_vector_i
 | 
			
		||||
    //todo: implement averaging
 | 
			
		||||
 | 
			
		||||
    d_average_count++;
 | 
			
		||||
    if((noutput_items == 0) || (ninput_items[0] == 0))
 | 
			
		||||
        {
 | 
			
		||||
            LOG(WARNING) << "noutput_items = 0";
 | 
			
		||||
        }
 | 
			
		||||
    if (d_average_count == d_decimation_output_factor)
 | 
			
		||||
        {
 | 
			
		||||
            d_average_count = 0;
 | 
			
		||||
 
 | 
			
		||||
@@ -48,8 +48,7 @@ class gps_l1_ca_telemetry_decoder_cc;
 | 
			
		||||
typedef boost::shared_ptr<gps_l1_ca_telemetry_decoder_cc> gps_l1_ca_telemetry_decoder_cc_sptr;
 | 
			
		||||
 | 
			
		||||
gps_l1_ca_telemetry_decoder_cc_sptr
 | 
			
		||||
gps_l1_ca_make_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in, unsigned
 | 
			
		||||
    int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump);
 | 
			
		||||
gps_l1_ca_make_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump);
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 * \brief This class implements a block that decodes the NAV data defined in IS-GPS-200E
 | 
			
		||||
@@ -90,11 +89,9 @@ public:
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
    friend gps_l1_ca_telemetry_decoder_cc_sptr
 | 
			
		||||
    gps_l1_ca_make_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in,unsigned
 | 
			
		||||
            int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump);
 | 
			
		||||
    gps_l1_ca_make_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump);
 | 
			
		||||
 | 
			
		||||
    gps_l1_ca_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in, unsigned
 | 
			
		||||
            int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump);
 | 
			
		||||
    gps_l1_ca_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump);
 | 
			
		||||
 | 
			
		||||
    bool gps_word_parityCheck(unsigned int gpsword);
 | 
			
		||||
 | 
			
		||||
@@ -102,7 +99,7 @@ private:
 | 
			
		||||
    unsigned short int d_preambles_bits[GPS_CA_PREAMBLE_LENGTH_BITS];
 | 
			
		||||
    // class private vars
 | 
			
		||||
 | 
			
		||||
    signed int *d_preambles_symbols;
 | 
			
		||||
    int *d_preambles_symbols;
 | 
			
		||||
    unsigned int d_samples_per_bit;
 | 
			
		||||
    long unsigned int d_sample_counter;
 | 
			
		||||
    long unsigned int d_preamble_index;
 | 
			
		||||
@@ -125,14 +122,12 @@ private:
 | 
			
		||||
    int d_average_count;
 | 
			
		||||
    int d_decimation_output_factor;
 | 
			
		||||
 | 
			
		||||
    long d_fs_in;
 | 
			
		||||
    //double d_preamble_duration_seconds;
 | 
			
		||||
    // navigation message vars
 | 
			
		||||
    Gps_Navigation_Message d_nav;
 | 
			
		||||
    GpsL1CaSubframeFsm d_GPS_FSM;
 | 
			
		||||
 | 
			
		||||
    boost::shared_ptr<gr::msg_queue> d_queue;
 | 
			
		||||
    unsigned int d_vector_length;
 | 
			
		||||
    bool d_dump;
 | 
			
		||||
    Gnss_Satellite d_satellite;
 | 
			
		||||
    int d_channel;
 | 
			
		||||
 
 | 
			
		||||
@@ -48,21 +48,15 @@ using google::LogMessage;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
gps_l2_m_telemetry_decoder_cc_sptr
 | 
			
		||||
gps_l2_m_make_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in, unsigned
 | 
			
		||||
        int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump)
 | 
			
		||||
gps_l2_m_make_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump)
 | 
			
		||||
{
 | 
			
		||||
    return gps_l2_m_telemetry_decoder_cc_sptr(new gps_l2_m_telemetry_decoder_cc(satellite, if_freq,
 | 
			
		||||
            fs_in, vector_length, queue, dump));
 | 
			
		||||
    return gps_l2_m_telemetry_decoder_cc_sptr(new gps_l2_m_telemetry_decoder_cc(satellite, queue, dump));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
gps_l2_m_telemetry_decoder_cc::gps_l2_m_telemetry_decoder_cc(
 | 
			
		||||
        Gnss_Satellite satellite,
 | 
			
		||||
        long if_freq,
 | 
			
		||||
        long fs_in,
 | 
			
		||||
        unsigned
 | 
			
		||||
        int vector_length,
 | 
			
		||||
        boost::shared_ptr<gr::msg_queue> queue,
 | 
			
		||||
        bool dump) :
 | 
			
		||||
                gr::block("gps_l2_m_telemetry_decoder_cc",
 | 
			
		||||
@@ -73,7 +67,6 @@ gps_l2_m_telemetry_decoder_cc::gps_l2_m_telemetry_decoder_cc(
 | 
			
		||||
    d_dump = dump;
 | 
			
		||||
    d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
 | 
			
		||||
    LOG(INFO) << "GPS L2C M TELEMETRY PROCESSING: satellite " << d_satellite;
 | 
			
		||||
    d_fs_in = fs_in;
 | 
			
		||||
    d_block_size = GPS_L2_SAMPLES_PER_SYMBOL * GPS_L2_SYMBOLS_PER_BIT * GPS_L2_CNAV_DATA_PAGE_BITS * 2; // two CNAV frames
 | 
			
		||||
    d_decimation_output_factor = 0;
 | 
			
		||||
    //set_output_multiple (1);
 | 
			
		||||
@@ -99,9 +92,12 @@ gps_l2_m_telemetry_decoder_cc::~gps_l2_m_telemetry_decoder_cc()
 | 
			
		||||
 | 
			
		||||
void gps_l2_m_telemetry_decoder_cc::forecast (int noutput_items, gr_vector_int &ninput_items_required)
 | 
			
		||||
{
 | 
			
		||||
    unsigned ninputs = ninput_items_required.size ();
 | 
			
		||||
    for (unsigned i = 0; i < ninputs; i++)
 | 
			
		||||
        ninput_items_required[i] = noutput_items;
 | 
			
		||||
    if (noutput_items != 0)
 | 
			
		||||
        {
 | 
			
		||||
            unsigned ninputs = ninput_items_required.size ();
 | 
			
		||||
            for (unsigned i = 0; i < ninputs; i++)
 | 
			
		||||
                ninput_items_required[i] = noutput_items;
 | 
			
		||||
        }
 | 
			
		||||
    //LOG(INFO) << "forecast(): " << "noutput_items=" << noutput_items << "\tninput_items_required ninput_items_required.size()=" << ninput_items_required.size();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -262,6 +258,10 @@ int gps_l2_m_telemetry_decoder_cc::general_work (int noutput_items, gr_vector_in
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    d_average_count++;
 | 
			
		||||
    if((noutput_items == 0) || (ninput_items[0] == 0))
 | 
			
		||||
        {
 | 
			
		||||
            LOG(WARNING) << "noutput_items = 0";
 | 
			
		||||
        }
 | 
			
		||||
    if (d_average_count == d_decimation_output_factor)
 | 
			
		||||
        {
 | 
			
		||||
            d_average_count = 0;
 | 
			
		||||
 
 | 
			
		||||
@@ -53,8 +53,7 @@ class gps_l2_m_telemetry_decoder_cc;
 | 
			
		||||
typedef boost::shared_ptr<gps_l2_m_telemetry_decoder_cc> gps_l2_m_telemetry_decoder_cc_sptr;
 | 
			
		||||
 | 
			
		||||
gps_l2_m_telemetry_decoder_cc_sptr
 | 
			
		||||
gps_l2_m_make_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in, unsigned
 | 
			
		||||
    int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump);
 | 
			
		||||
gps_l2_m_make_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump);
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 * \brief This class implements a block that decodes the SBAS integrity and corrections data defined in RTCA MOPS DO-229
 | 
			
		||||
@@ -87,17 +86,14 @@ public:
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
    friend gps_l2_m_telemetry_decoder_cc_sptr
 | 
			
		||||
    gps_l2_m_make_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in,unsigned
 | 
			
		||||
            int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump);
 | 
			
		||||
    gps_l2_m_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in, unsigned
 | 
			
		||||
            int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump);
 | 
			
		||||
    gps_l2_m_make_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump);
 | 
			
		||||
    gps_l2_m_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump);
 | 
			
		||||
 | 
			
		||||
    void viterbi_decoder(double *page_part_symbols, int *page_part_bits);
 | 
			
		||||
    void align_samples();
 | 
			
		||||
 | 
			
		||||
    concurrent_queue<Gps_CNAV_Iono> *d_iono_queue;
 | 
			
		||||
    concurrent_queue<Gps_CNAV_Ephemeris> *d_ephemeris_queue;
 | 
			
		||||
    long d_fs_in;
 | 
			
		||||
 | 
			
		||||
    bool d_dump;
 | 
			
		||||
    Gnss_Satellite d_satellite;
 | 
			
		||||
 
 | 
			
		||||
@@ -48,21 +48,15 @@ using google::LogMessage;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
sbas_l1_telemetry_decoder_cc_sptr
 | 
			
		||||
sbas_l1_make_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in, unsigned
 | 
			
		||||
        int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump)
 | 
			
		||||
sbas_l1_make_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump)
 | 
			
		||||
{
 | 
			
		||||
    return sbas_l1_telemetry_decoder_cc_sptr(new sbas_l1_telemetry_decoder_cc(satellite, if_freq,
 | 
			
		||||
            fs_in, vector_length, queue, dump));
 | 
			
		||||
    return sbas_l1_telemetry_decoder_cc_sptr(new sbas_l1_telemetry_decoder_cc(satellite, queue, dump));
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
sbas_l1_telemetry_decoder_cc::sbas_l1_telemetry_decoder_cc(
 | 
			
		||||
        Gnss_Satellite satellite,
 | 
			
		||||
        long if_freq,
 | 
			
		||||
        long fs_in,
 | 
			
		||||
        unsigned
 | 
			
		||||
        int vector_length,
 | 
			
		||||
        boost::shared_ptr<gr::msg_queue> queue,
 | 
			
		||||
        bool dump) :
 | 
			
		||||
                gr::block("sbas_l1_telemetry_decoder_cc",
 | 
			
		||||
@@ -73,7 +67,6 @@ sbas_l1_telemetry_decoder_cc::sbas_l1_telemetry_decoder_cc(
 | 
			
		||||
    d_dump = dump;
 | 
			
		||||
    d_satellite = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
 | 
			
		||||
    LOG(INFO) << "SBAS L1 TELEMETRY PROCESSING: satellite " << d_satellite;
 | 
			
		||||
    d_fs_in = fs_in;
 | 
			
		||||
    d_block_size = d_samples_per_symbol * d_symbols_per_bit * d_block_size_in_bits;
 | 
			
		||||
    d_channel = 0;
 | 
			
		||||
    set_output_multiple (1);
 | 
			
		||||
@@ -187,6 +180,10 @@ int sbas_l1_telemetry_decoder_cc::general_work (int noutput_items, gr_vector_int
 | 
			
		||||
            current_synchro_data[i].Flag_valid_word = false; // indicate to observable block that this synchro object isn't valid for pseudorange computation
 | 
			
		||||
        }
 | 
			
		||||
    consume_each(noutput_items); // tell scheduler input items consumed
 | 
			
		||||
    if((noutput_items == 0) || (ninput_items[0] == 0))
 | 
			
		||||
        {
 | 
			
		||||
            LOG(WARNING) << "noutput_items = 0";
 | 
			
		||||
        }
 | 
			
		||||
    return noutput_items; // tell scheduler output items produced
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -49,8 +49,7 @@ class sbas_l1_telemetry_decoder_cc;
 | 
			
		||||
typedef boost::shared_ptr<sbas_l1_telemetry_decoder_cc> sbas_l1_telemetry_decoder_cc_sptr;
 | 
			
		||||
 | 
			
		||||
sbas_l1_telemetry_decoder_cc_sptr
 | 
			
		||||
sbas_l1_make_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in, unsigned
 | 
			
		||||
    int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump);
 | 
			
		||||
sbas_l1_make_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump);
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 * \brief This class implements a block that decodes the SBAS integrity and corrections data defined in RTCA MOPS DO-229
 | 
			
		||||
@@ -83,10 +82,8 @@ public:
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
    friend sbas_l1_telemetry_decoder_cc_sptr
 | 
			
		||||
    sbas_l1_make_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in,unsigned
 | 
			
		||||
            int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump);
 | 
			
		||||
    sbas_l1_telemetry_decoder_cc(Gnss_Satellite satellite, long if_freq, long fs_in, unsigned
 | 
			
		||||
            int vector_length, boost::shared_ptr<gr::msg_queue> queue, bool dump);
 | 
			
		||||
    sbas_l1_make_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump);
 | 
			
		||||
    sbas_l1_telemetry_decoder_cc(Gnss_Satellite satellite, boost::shared_ptr<gr::msg_queue> queue, bool dump);
 | 
			
		||||
 | 
			
		||||
    void viterbi_decoder(double *page_part_symbols, int *page_part_bits);
 | 
			
		||||
    void align_samples();
 | 
			
		||||
@@ -95,8 +92,6 @@ private:
 | 
			
		||||
    static const int d_symbols_per_bit = 2;
 | 
			
		||||
    static const int d_block_size_in_bits = 30;
 | 
			
		||||
 | 
			
		||||
    long d_fs_in;
 | 
			
		||||
 | 
			
		||||
    bool d_dump;
 | 
			
		||||
    Gnss_Satellite d_satellite;
 | 
			
		||||
    int d_channel;
 | 
			
		||||
 
 | 
			
		||||
@@ -84,7 +84,10 @@ galileo_e1_dll_pll_veml_make_tracking_cc(
 | 
			
		||||
void galileo_e1_dll_pll_veml_tracking_cc::forecast (int noutput_items,
 | 
			
		||||
        gr_vector_int &ninput_items_required)
 | 
			
		||||
{
 | 
			
		||||
    ninput_items_required[0] = static_cast<int>(d_vector_length) * 2; //set the required available samples in each call
 | 
			
		||||
    if (noutput_items != 0)
 | 
			
		||||
        {
 | 
			
		||||
            ninput_items_required[0] = static_cast<int>(d_vector_length) * 2; //set the required available samples in each call
 | 
			
		||||
        }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -210,10 +213,10 @@ void galileo_e1_dll_pll_veml_tracking_cc::start_tracking()
 | 
			
		||||
 | 
			
		||||
    d_carrier_lock_fail_counter = 0;
 | 
			
		||||
    d_rem_code_phase_samples = 0.0;
 | 
			
		||||
    d_rem_carr_phase_rad = 0;
 | 
			
		||||
    d_acc_carrier_phase_rad = 0;
 | 
			
		||||
    d_rem_carr_phase_rad = 0.0;
 | 
			
		||||
    d_acc_carrier_phase_rad = 0.0;
 | 
			
		||||
 | 
			
		||||
    d_acc_code_phase_secs = 0;
 | 
			
		||||
    d_acc_code_phase_secs = 0.0;
 | 
			
		||||
    d_carrier_doppler_hz = d_acq_carrier_doppler_hz;
 | 
			
		||||
    d_current_prn_length_samples = d_vector_length;
 | 
			
		||||
 | 
			
		||||
@@ -307,7 +310,7 @@ galileo_e1_dll_pll_veml_tracking_cc::~galileo_e1_dll_pll_veml_tracking_cc()
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
int galileo_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items,gr_vector_int &ninput_items,
 | 
			
		||||
int galileo_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items, gr_vector_int &ninput_items,
 | 
			
		||||
        gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
 | 
			
		||||
{
 | 
			
		||||
    double carr_error_hz = 0.0;
 | 
			
		||||
@@ -326,7 +329,7 @@ int galileo_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items,gr_vect
 | 
			
		||||
                    double acq_trk_shif_correction_samples;
 | 
			
		||||
                    int acq_to_trk_delay_samples;
 | 
			
		||||
                    acq_to_trk_delay_samples = d_sample_counter - d_acq_sample_stamp;
 | 
			
		||||
                    acq_trk_shif_correction_samples = d_current_prn_length_samples - std::fmod(static_cast<float>(acq_to_trk_delay_samples), static_cast<float>(d_current_prn_length_samples));
 | 
			
		||||
                    acq_trk_shif_correction_samples = d_current_prn_length_samples - std::fmod(static_cast<double>(acq_to_trk_delay_samples), static_cast<double>(d_current_prn_length_samples));
 | 
			
		||||
                    samples_offset = std::round(d_acq_code_phase_samples + acq_trk_shif_correction_samples);
 | 
			
		||||
                    d_sample_counter = d_sample_counter + samples_offset; //count for the processed samples
 | 
			
		||||
                    d_pull_in = false;
 | 
			
		||||
@@ -394,7 +397,7 @@ int galileo_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items,gr_vect
 | 
			
		||||
            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.0 / 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);
 | 
			
		||||
@@ -582,7 +585,11 @@ int galileo_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items,gr_vect
 | 
			
		||||
        }
 | 
			
		||||
    consume_each(d_current_prn_length_samples); // this is required for gr_block derivates
 | 
			
		||||
    d_sample_counter += d_current_prn_length_samples; //count for the processed samples
 | 
			
		||||
    //std::cout<<"Galileo tracking output at sample "<<d_sample_counter<<std::endl;
 | 
			
		||||
 | 
			
		||||
    if((noutput_items == 0) || (ninput_items[0] == 0))
 | 
			
		||||
        {
 | 
			
		||||
            LOG(WARNING) << "noutput_items = 0";
 | 
			
		||||
        }
 | 
			
		||||
    return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -86,7 +86,10 @@ galileo_e1_tcp_connector_tracking_cc_sptr galileo_e1_tcp_connector_make_tracking
 | 
			
		||||
void Galileo_E1_Tcp_Connector_Tracking_cc::forecast (int noutput_items,
 | 
			
		||||
        gr_vector_int &ninput_items_required)
 | 
			
		||||
{
 | 
			
		||||
    ninput_items_required[0] = (int)d_vector_length*2; // set the required available samples in each call
 | 
			
		||||
    if (noutput_items != 0)
 | 
			
		||||
        {
 | 
			
		||||
            ninput_items_required[0] = (int)d_vector_length*2; // set the required available samples in each call
 | 
			
		||||
        }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -589,6 +592,10 @@ int Galileo_E1_Tcp_Connector_Tracking_cc::general_work (int noutput_items, gr_ve
 | 
			
		||||
        }
 | 
			
		||||
    consume_each(d_current_prn_length_samples); // this is needed in gr::block derivates
 | 
			
		||||
    d_sample_counter += d_current_prn_length_samples; //count for the processed samples
 | 
			
		||||
    if((noutput_items == 0) || (ninput_items[0] == 0))
 | 
			
		||||
        {
 | 
			
		||||
            LOG(WARNING) << "noutput_items = 0";
 | 
			
		||||
        }
 | 
			
		||||
    return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -86,7 +86,10 @@ galileo_e5a_dll_pll_make_tracking_cc(
 | 
			
		||||
void Galileo_E5a_Dll_Pll_Tracking_cc::forecast (int noutput_items,
 | 
			
		||||
        gr_vector_int &ninput_items_required)
 | 
			
		||||
{
 | 
			
		||||
    ninput_items_required[0] = static_cast<int>(d_vector_length)*2; //set the required available samples in each call
 | 
			
		||||
    if (noutput_items != 0)
 | 
			
		||||
        {
 | 
			
		||||
            ninput_items_required[0] = static_cast<int>(d_vector_length)*2; //set the required available samples in each call
 | 
			
		||||
        }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Galileo_E5a_Dll_Pll_Tracking_cc::Galileo_E5a_Dll_Pll_Tracking_cc(
 | 
			
		||||
@@ -828,6 +831,10 @@ int Galileo_E5a_Dll_Pll_Tracking_cc::general_work (int noutput_items, gr_vector_
 | 
			
		||||
    d_secondary_delay = (d_secondary_delay + 1) % Galileo_E5a_Q_SECONDARY_CODE_LENGTH;
 | 
			
		||||
    d_sample_counter += d_current_prn_length_samples; //count for the processed samples
 | 
			
		||||
    consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates
 | 
			
		||||
    if((noutput_items == 0) || (ninput_items[0] == 0))
 | 
			
		||||
        {
 | 
			
		||||
            LOG(WARNING) << "noutput_items = 0";
 | 
			
		||||
        }
 | 
			
		||||
    return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -85,7 +85,10 @@ galileo_volk_e1_dll_pll_veml_make_tracking_cc(
 | 
			
		||||
void galileo_volk_e1_dll_pll_veml_tracking_cc::forecast (int noutput_items,
 | 
			
		||||
                                                    gr_vector_int &ninput_items_required)
 | 
			
		||||
{
 | 
			
		||||
    ninput_items_required[0] = static_cast<int>(d_vector_length) * 2; //set the required available samples in each call
 | 
			
		||||
    if (noutput_items != 0)
 | 
			
		||||
        {
 | 
			
		||||
            ninput_items_required[0] = static_cast<int>(d_vector_length) * 2; //set the required available samples in each call
 | 
			
		||||
        }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -135,21 +138,21 @@ gr::block("galileo_volk_e1_dll_pll_veml_tracking_cc", gr::io_signature::make(1,
 | 
			
		||||
    d_very_late_code = static_cast<gr_complex*>(volk_malloc(2 * d_vector_length * sizeof(gr_complex), volk_get_alignment()));
 | 
			
		||||
    d_carr_sign = static_cast<gr_complex*>(volk_malloc(2*d_vector_length * sizeof(gr_complex), volk_get_alignment()));
 | 
			
		||||
    
 | 
			
		||||
    d_very_early_code16=static_cast<lv_16sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_16sc_t), volk_get_alignment()));
 | 
			
		||||
    d_early_code16=static_cast<lv_16sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_16sc_t), volk_get_alignment()));
 | 
			
		||||
    d_prompt_code16=static_cast<lv_16sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_16sc_t), volk_get_alignment()));
 | 
			
		||||
    d_late_code16=static_cast<lv_16sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_16sc_t), volk_get_alignment()));
 | 
			
		||||
    d_very_late_code16=static_cast<lv_16sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_16sc_t), volk_get_alignment()));
 | 
			
		||||
    d_carr_sign16=static_cast<lv_16sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_16sc_t), volk_get_alignment()));
 | 
			
		||||
    in16=static_cast<lv_16sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_16sc_t), volk_get_alignment()));
 | 
			
		||||
    d_very_early_code16 = static_cast<lv_16sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_16sc_t), volk_get_alignment()));
 | 
			
		||||
    d_early_code16 = static_cast<lv_16sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_16sc_t), volk_get_alignment()));
 | 
			
		||||
    d_prompt_code16 = static_cast<lv_16sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_16sc_t), volk_get_alignment()));
 | 
			
		||||
    d_late_code16 = static_cast<lv_16sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_16sc_t), volk_get_alignment()));
 | 
			
		||||
    d_very_late_code16 = static_cast<lv_16sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_16sc_t), volk_get_alignment()));
 | 
			
		||||
    d_carr_sign16 = static_cast<lv_16sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_16sc_t), volk_get_alignment()));
 | 
			
		||||
    in16 = static_cast<lv_16sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_16sc_t), volk_get_alignment()));
 | 
			
		||||
    
 | 
			
		||||
    d_very_early_code8=static_cast<lv_8sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_8sc_t), volk_get_alignment()));
 | 
			
		||||
    d_early_code8=static_cast<lv_8sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_8sc_t), volk_get_alignment()));
 | 
			
		||||
    d_prompt_code8=static_cast<lv_8sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_8sc_t), volk_get_alignment()));
 | 
			
		||||
    d_late_code8=static_cast<lv_8sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_8sc_t), volk_get_alignment()));
 | 
			
		||||
    d_very_late_code8=static_cast<lv_8sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_8sc_t), volk_get_alignment()));
 | 
			
		||||
    d_carr_sign8=static_cast<lv_8sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_8sc_t), volk_get_alignment()));
 | 
			
		||||
    in8=static_cast<lv_8sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_8sc_t), volk_get_alignment()));
 | 
			
		||||
    d_very_early_code8 = static_cast<lv_8sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_8sc_t), volk_get_alignment()));
 | 
			
		||||
    d_early_code8 = static_cast<lv_8sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_8sc_t), volk_get_alignment()));
 | 
			
		||||
    d_prompt_code8 = static_cast<lv_8sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_8sc_t), volk_get_alignment()));
 | 
			
		||||
    d_late_code8 = static_cast<lv_8sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_8sc_t), volk_get_alignment()));
 | 
			
		||||
    d_very_late_code8 = static_cast<lv_8sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_8sc_t), volk_get_alignment()));
 | 
			
		||||
    d_carr_sign8 = static_cast<lv_8sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_8sc_t), volk_get_alignment()));
 | 
			
		||||
    in8 = static_cast<lv_8sc_t*>(volk_malloc(2 * d_vector_length * sizeof(lv_8sc_t), volk_get_alignment()));
 | 
			
		||||
    
 | 
			
		||||
    // correlator outputs (scalar)
 | 
			
		||||
    d_Very_Early = static_cast<gr_complex*>(volk_malloc(sizeof(gr_complex), volk_get_alignment()));
 | 
			
		||||
@@ -337,13 +340,13 @@ galileo_volk_e1_dll_pll_veml_tracking_cc::~galileo_volk_e1_dll_pll_veml_tracking
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
int galileo_volk_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items,gr_vector_int &ninput_items,
 | 
			
		||||
int galileo_volk_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items, gr_vector_int &ninput_items,
 | 
			
		||||
                                                       gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
 | 
			
		||||
{
 | 
			
		||||
    double carr_error_hz;
 | 
			
		||||
    double carr_error_filt_hz;
 | 
			
		||||
    double code_error_chips;
 | 
			
		||||
    double code_error_filt_chips;
 | 
			
		||||
    double carr_error_hz = 0.0;
 | 
			
		||||
    double carr_error_filt_hz = 0.0;
 | 
			
		||||
    double code_error_chips = 0.0;
 | 
			
		||||
    double code_error_filt_chips = 0.0;
 | 
			
		||||
    
 | 
			
		||||
    if (d_enable_tracking == true)
 | 
			
		||||
    {
 | 
			
		||||
@@ -411,7 +414,7 @@ int galileo_volk_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items,gr
 | 
			
		||||
 | 
			
		||||
        // ################## PLL ##########################################################
 | 
			
		||||
        // PLL discriminator
 | 
			
		||||
        carr_error_hz = pll_cloop_two_quadrant_atan(*d_Prompt) / static_cast<float>(GPS_TWO_PI);
 | 
			
		||||
        carr_error_hz = pll_cloop_two_quadrant_atan(*d_Prompt) / GPS_TWO_PI;
 | 
			
		||||
        // Carrier discriminator filter
 | 
			
		||||
        carr_error_filt_hz = d_carrier_loop_filter.get_carrier_nco(carr_error_hz);
 | 
			
		||||
        // New carrier Doppler frequency estimation
 | 
			
		||||
@@ -629,7 +632,11 @@ int galileo_volk_e1_dll_pll_veml_tracking_cc::general_work (int noutput_items,gr
 | 
			
		||||
    }
 | 
			
		||||
    consume_each(d_current_prn_length_samples); // this is required for gr_block derivates
 | 
			
		||||
    d_sample_counter += d_current_prn_length_samples; //count for the processed samples
 | 
			
		||||
    //std::cout<<"Galileo tracking output at sample "<<d_sample_counter<<std::endl;
 | 
			
		||||
 | 
			
		||||
    if((noutput_items == 0) || (ninput_items[0] == 0))
 | 
			
		||||
        {
 | 
			
		||||
            LOG(WARNING) << "noutput_items = 0";
 | 
			
		||||
        }
 | 
			
		||||
    return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -84,7 +84,10 @@ gps_l1_ca_dll_fll_pll_tracking_cc_sptr gps_l1_ca_dll_fll_pll_make_tracking_cc(
 | 
			
		||||
 | 
			
		||||
void Gps_L1_Ca_Dll_Fll_Pll_Tracking_cc::forecast (int noutput_items, gr_vector_int &ninput_items_required)
 | 
			
		||||
{
 | 
			
		||||
    ninput_items_required[0] = d_vector_length * 2; //set the required available samples in each call
 | 
			
		||||
    if (noutput_items != 0)
 | 
			
		||||
        {
 | 
			
		||||
            ninput_items_required[0] = d_vector_length * 2; //set the required available samples in each call
 | 
			
		||||
        }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -650,6 +653,10 @@ int Gps_L1_Ca_Dll_Fll_Pll_Tracking_cc::general_work (int noutput_items, gr_vecto
 | 
			
		||||
        }
 | 
			
		||||
    consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates
 | 
			
		||||
    d_sample_counter += d_current_prn_length_samples; //count for the processed samples
 | 
			
		||||
    if((noutput_items == 0) || (ninput_items[0] == 0))
 | 
			
		||||
        {
 | 
			
		||||
            LOG(WARNING) << "noutput_items = 0";
 | 
			
		||||
        }
 | 
			
		||||
    return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -77,7 +77,10 @@ gps_l1_ca_dll_pll_c_aid_make_tracking_cc(
 | 
			
		||||
void gps_l1_ca_dll_pll_c_aid_tracking_cc::forecast (int noutput_items,
 | 
			
		||||
        gr_vector_int &ninput_items_required)
 | 
			
		||||
{
 | 
			
		||||
    ninput_items_required[0] = static_cast<int>(d_vector_length) * 2; //set the required available samples in each call
 | 
			
		||||
    if (noutput_items != 0)
 | 
			
		||||
        {
 | 
			
		||||
            ninput_items_required[0] = static_cast<int>(d_vector_length) * 2; //set the required available samples in each call
 | 
			
		||||
        }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -170,6 +173,9 @@ gps_l1_ca_dll_pll_c_aid_tracking_cc::gps_l1_ca_dll_pll_c_aid_tracking_cc(
 | 
			
		||||
    d_code_phase_samples = 0.0;
 | 
			
		||||
 | 
			
		||||
    d_pll_to_dll_assist_secs_Ti = 0.0;
 | 
			
		||||
    d_rem_code_phase_chips = 0.0;
 | 
			
		||||
    d_code_phase_step_chips = 0.0;
 | 
			
		||||
    d_carrier_phase_step_rad = 0.0;
 | 
			
		||||
    //set_min_output_buffer((long int)300);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@@ -319,21 +325,21 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items, gr_vec
 | 
			
		||||
            // ################# CARRIER WIPEOFF AND CORRELATORS ##############################
 | 
			
		||||
            // perform carrier wipe-off and compute Early, Prompt and Late correlation
 | 
			
		||||
            multicorrelator_cpu.set_input_output_vectors(d_correlator_outs,in);
 | 
			
		||||
            multicorrelator_cpu.Carrier_wipeoff_multicorrelator_resampler(d_rem_carrier_phase_rad,d_carrier_phase_step_rad,d_rem_code_phase_chips,d_code_phase_step_chips,d_correlation_length_samples);
 | 
			
		||||
            multicorrelator_cpu.Carrier_wipeoff_multicorrelator_resampler(d_rem_carrier_phase_rad, d_carrier_phase_step_rad, d_rem_code_phase_chips, d_code_phase_step_chips, d_correlation_length_samples);
 | 
			
		||||
 | 
			
		||||
            // UPDATE INTEGRATION TIME
 | 
			
		||||
            CURRENT_INTEGRATION_TIME_S=(static_cast<double>(d_correlation_length_samples)/static_cast<double>(d_fs_in));
 | 
			
		||||
            CURRENT_INTEGRATION_TIME_S = static_cast<double>(d_correlation_length_samples) / static_cast<double>(d_fs_in);
 | 
			
		||||
 | 
			
		||||
            // ################## PLL ##########################################################
 | 
			
		||||
            // Update PLL discriminator [rads/Ti -> Secs/Ti]
 | 
			
		||||
            carr_phase_error_secs_Ti = pll_cloop_two_quadrant_atan(d_correlator_outs[1])/GPS_TWO_PI; //prompt output
 | 
			
		||||
            carr_phase_error_secs_Ti = pll_cloop_two_quadrant_atan(d_correlator_outs[1]) / GPS_TWO_PI; //prompt output
 | 
			
		||||
            // Carrier discriminator filter
 | 
			
		||||
            // NOTICE: The carrier loop filter includes the Carrier Doppler accumulator, as described in Kaplan
 | 
			
		||||
            //d_carrier_doppler_hz = d_acq_carrier_doppler_hz + carr_phase_error_filt_secs_ti/INTEGRATION_TIME;
 | 
			
		||||
            // Input [s/Ti] -> output [Hz]
 | 
			
		||||
            d_carrier_doppler_hz = d_carrier_loop_filter.get_carrier_error(0.0, carr_phase_error_secs_Ti, CURRENT_INTEGRATION_TIME_S);
 | 
			
		||||
            // PLL to DLL assistance [Secs/Ti]
 | 
			
		||||
            d_pll_to_dll_assist_secs_Ti = (d_carrier_doppler_hz*CURRENT_INTEGRATION_TIME_S)/GPS_L1_FREQ_HZ;
 | 
			
		||||
            d_pll_to_dll_assist_secs_Ti = (d_carrier_doppler_hz * CURRENT_INTEGRATION_TIME_S) / GPS_L1_FREQ_HZ;
 | 
			
		||||
            // code Doppler frequency update
 | 
			
		||||
            d_code_freq_chips = GPS_L1_CA_CODE_RATE_HZ + ((d_carrier_doppler_hz * GPS_L1_CA_CODE_RATE_HZ) / GPS_L1_FREQ_HZ);
 | 
			
		||||
 | 
			
		||||
@@ -345,7 +351,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items, gr_vec
 | 
			
		||||
            code_error_filt_secs_Ti = code_error_filt_chips*CURRENT_INTEGRATION_TIME_S/d_code_freq_chips; // [s/Ti]
 | 
			
		||||
            // DLL code error estimation [s/Ti]
 | 
			
		||||
            // TODO: PLL carrier aid to DLL is disabled. Re-enable it and measure performance
 | 
			
		||||
            dll_code_error_secs_Ti=-code_error_filt_secs_Ti+d_pll_to_dll_assist_secs_Ti;
 | 
			
		||||
            dll_code_error_secs_Ti = - code_error_filt_secs_Ti + d_pll_to_dll_assist_secs_Ti;
 | 
			
		||||
 | 
			
		||||
            // ################## CARRIER AND CODE NCO BUFFER ALIGNEMENT #######################
 | 
			
		||||
            // keep alignment parameters for the next input buffer
 | 
			
		||||
@@ -363,19 +369,17 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items, gr_vec
 | 
			
		||||
            old_d_rem_code_phase_samples=d_rem_code_phase_samples;
 | 
			
		||||
            d_rem_code_phase_samples = K_blk_samples - static_cast<double>(d_correlation_length_samples); //rounding error < 1 sample
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            // UPDATE REMNANT CARRIER PHASE
 | 
			
		||||
            CORRECTED_INTEGRATION_TIME_S=(static_cast<double>(d_correlation_length_samples)/static_cast<double>(d_fs_in));
 | 
			
		||||
            //remnant carrier phase [rad]
 | 
			
		||||
            d_rem_carrier_phase_rad = fmod(d_rem_carrier_phase_rad + GPS_TWO_PI * d_carrier_doppler_hz * CORRECTED_INTEGRATION_TIME_S,GPS_TWO_PI);
 | 
			
		||||
            d_rem_carrier_phase_rad = fmod(d_rem_carrier_phase_rad + GPS_TWO_PI * d_carrier_doppler_hz * CORRECTED_INTEGRATION_TIME_S, GPS_TWO_PI);
 | 
			
		||||
            // UPDATE CARRIER PHASE ACCUULATOR
 | 
			
		||||
            //carrier phase accumulator prior to update the PLL estimators (accumulated carrier in this loop depends on the old estimations!)
 | 
			
		||||
            d_acc_carrier_phase_cycles -= d_carrier_doppler_hz*CORRECTED_INTEGRATION_TIME_S;
 | 
			
		||||
 | 
			
		||||
            d_acc_carrier_phase_cycles -= d_carrier_doppler_hz * CORRECTED_INTEGRATION_TIME_S;
 | 
			
		||||
 | 
			
		||||
            //################### PLL COMMANDS #################################################
 | 
			
		||||
            //carrier phase step (NCO phase increment per sample) [rads/sample]
 | 
			
		||||
            d_carrier_phase_step_rad=GPS_TWO_PI*d_carrier_doppler_hz/static_cast<double>(d_fs_in);
 | 
			
		||||
            d_carrier_phase_step_rad = GPS_TWO_PI * d_carrier_doppler_hz / static_cast<double>(d_fs_in);
 | 
			
		||||
 | 
			
		||||
            //################### DLL COMMANDS #################################################
 | 
			
		||||
            //code phase step (Code resampler phase increment per sample) [chips/sample]
 | 
			
		||||
@@ -383,7 +387,6 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items, gr_vec
 | 
			
		||||
            //remnant code phase [chips]
 | 
			
		||||
            d_rem_code_phase_chips = d_rem_code_phase_samples * (d_code_freq_chips / static_cast<double>(d_fs_in));
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
            // ####### CN0 ESTIMATION AND LOCK DETECTORS #######################################
 | 
			
		||||
            if (d_cn0_estimation_counter < CN0_ESTIMATION_SAMPLES)
 | 
			
		||||
                {
 | 
			
		||||
@@ -428,7 +431,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items, gr_vec
 | 
			
		||||
            current_synchro_data.Tracking_timestamp_secs = (static_cast<double>(d_sample_counter) + old_d_rem_code_phase_samples) / static_cast<double>(d_fs_in);
 | 
			
		||||
            // This tracking block aligns the Tracking_timestamp_secs with the start sample of the PRN, thus, Code_phase_secs=0
 | 
			
		||||
            current_synchro_data.Code_phase_secs = 0;
 | 
			
		||||
            current_synchro_data.Carrier_phase_rads = GPS_TWO_PI*d_acc_carrier_phase_cycles;
 | 
			
		||||
            current_synchro_data.Carrier_phase_rads = GPS_TWO_PI * d_acc_carrier_phase_cycles;
 | 
			
		||||
            current_synchro_data.Carrier_Doppler_hz = d_carrier_doppler_hz;
 | 
			
		||||
            current_synchro_data.CN0_dB_hz = d_CN0_SNV_dB_Hz;
 | 
			
		||||
            current_synchro_data.Flag_valid_pseudorange = false;
 | 
			
		||||
@@ -446,7 +449,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items, gr_vec
 | 
			
		||||
                            d_last_seg = floor(d_sample_counter / d_fs_in);
 | 
			
		||||
                            std::cout << "Current input signal time = " << d_last_seg << " [s]" << std::endl;
 | 
			
		||||
                            DLOG(INFO) << "GPS L1 C/A Tracking CH " << d_channel <<  ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN)
 | 
			
		||||
                                      << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]" << std::endl;
 | 
			
		||||
                                              << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]" << std::endl;
 | 
			
		||||
                            //if (d_last_seg==5) d_carrier_lock_fail_counter=500; //DEBUG: force unlock!
 | 
			
		||||
                        }
 | 
			
		||||
                }
 | 
			
		||||
@@ -456,7 +459,7 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items, gr_vec
 | 
			
		||||
                        {
 | 
			
		||||
                            d_last_seg = floor(d_sample_counter / d_fs_in);
 | 
			
		||||
                            DLOG(INFO) << "Tracking CH " << d_channel <<  ": Satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN)
 | 
			
		||||
                                       << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]";
 | 
			
		||||
                                               << ", CN0 = " << d_CN0_SNV_dB_Hz << " [dB-Hz]";
 | 
			
		||||
                        }
 | 
			
		||||
                }
 | 
			
		||||
        }
 | 
			
		||||
@@ -544,9 +547,13 @@ int gps_l1_ca_dll_pll_c_aid_tracking_cc::general_work (int noutput_items, gr_vec
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
	consume_each(d_correlation_length_samples); // this is necessary in gr::block derivates
 | 
			
		||||
	d_sample_counter += d_correlation_length_samples; //count for the processed samples
 | 
			
		||||
    consume_each(d_correlation_length_samples); // this is necessary in gr::block derivates
 | 
			
		||||
    d_sample_counter += d_correlation_length_samples; //count for the processed samples
 | 
			
		||||
 | 
			
		||||
    if((noutput_items == 0) || (ninput_items[0] == 0))
 | 
			
		||||
        {
 | 
			
		||||
            LOG(WARNING) << "noutput_items = 0";
 | 
			
		||||
        }
 | 
			
		||||
    return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -82,7 +82,10 @@ gps_l1_ca_dll_pll_make_optim_tracking_cc(
 | 
			
		||||
void Gps_L1_Ca_Dll_Pll_Optim_Tracking_cc::forecast (int noutput_items,
 | 
			
		||||
        gr_vector_int &ninput_items_required)
 | 
			
		||||
{
 | 
			
		||||
    ninput_items_required[0] = d_gnuradio_forecast_samples; //set the required available samples in each call
 | 
			
		||||
    if (noutput_items != 0)
 | 
			
		||||
        {
 | 
			
		||||
            ninput_items_required[0] = d_gnuradio_forecast_samples; //set the required available samples in each call
 | 
			
		||||
        }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -338,10 +341,10 @@ int Gps_L1_Ca_Dll_Pll_Optim_Tracking_cc::general_work (int noutput_items, gr_vec
 | 
			
		||||
{
 | 
			
		||||
    // stream to collect cout calls to improve thread safety
 | 
			
		||||
    std::stringstream tmp_str_stream;
 | 
			
		||||
    double carr_error_hz;
 | 
			
		||||
    double carr_error_filt_hz;
 | 
			
		||||
    double code_error_chips;
 | 
			
		||||
    double code_error_filt_chips;
 | 
			
		||||
    double carr_error_hz = 0.0;
 | 
			
		||||
    double carr_error_filt_hz = 0.0;
 | 
			
		||||
    double code_error_chips = 0.0;
 | 
			
		||||
    double code_error_filt_chips = 0.0;
 | 
			
		||||
 | 
			
		||||
    if (d_enable_tracking == true)
 | 
			
		||||
        {
 | 
			
		||||
@@ -604,6 +607,10 @@ int Gps_L1_Ca_Dll_Pll_Optim_Tracking_cc::general_work (int noutput_items, gr_vec
 | 
			
		||||
 | 
			
		||||
    consume_each(d_current_prn_length_samples); // this is necesary in gr_block derivates
 | 
			
		||||
    d_sample_counter += d_current_prn_length_samples; //count for the processed samples
 | 
			
		||||
    if((noutput_items == 0) || (ninput_items[0] == 0))
 | 
			
		||||
        {
 | 
			
		||||
            LOG(WARNING) << "noutput_items = 0";
 | 
			
		||||
        }
 | 
			
		||||
    return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -83,7 +83,10 @@ gps_l1_ca_dll_pll_make_tracking_cc(
 | 
			
		||||
void Gps_L1_Ca_Dll_Pll_Tracking_cc::forecast (int noutput_items,
 | 
			
		||||
        gr_vector_int &ninput_items_required)
 | 
			
		||||
{
 | 
			
		||||
    ninput_items_required[0] = static_cast<int>(d_vector_length) * 2; //set the required available samples in each call
 | 
			
		||||
    if (noutput_items != 0)
 | 
			
		||||
        {
 | 
			
		||||
            ninput_items_required[0] = static_cast<int>(d_vector_length) * 2; //set the required available samples in each call
 | 
			
		||||
        }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -204,16 +207,16 @@ void Gps_L1_Ca_Dll_Pll_Tracking_cc::start_tracking()
 | 
			
		||||
    d_code_freq_chips = radial_velocity * GPS_L1_CA_CODE_RATE_HZ;
 | 
			
		||||
    T_chip_mod_seconds = 1/d_code_freq_chips;
 | 
			
		||||
    T_prn_mod_seconds = T_chip_mod_seconds * GPS_L1_CA_CODE_LENGTH_CHIPS;
 | 
			
		||||
    T_prn_mod_samples = T_prn_mod_seconds * static_cast<float>(d_fs_in);
 | 
			
		||||
    T_prn_mod_samples = T_prn_mod_seconds * static_cast<double>(d_fs_in);
 | 
			
		||||
 | 
			
		||||
    d_current_prn_length_samples = round(T_prn_mod_samples);
 | 
			
		||||
 | 
			
		||||
    double T_prn_true_seconds = GPS_L1_CA_CODE_LENGTH_CHIPS / GPS_L1_CA_CODE_RATE_HZ;
 | 
			
		||||
    double T_prn_true_samples = T_prn_true_seconds * static_cast<float>(d_fs_in);
 | 
			
		||||
    double T_prn_diff_seconds=  T_prn_true_seconds - T_prn_mod_seconds;
 | 
			
		||||
    double T_prn_true_samples = T_prn_true_seconds * static_cast<double>(d_fs_in);
 | 
			
		||||
    double T_prn_diff_seconds = T_prn_true_seconds - T_prn_mod_seconds;
 | 
			
		||||
    double N_prn_diff = acq_trk_diff_seconds / T_prn_true_seconds;
 | 
			
		||||
    double corrected_acq_phase_samples, delay_correction_samples;
 | 
			
		||||
    corrected_acq_phase_samples = fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast<float>(d_fs_in)), T_prn_true_samples);
 | 
			
		||||
    corrected_acq_phase_samples = fmod((d_acq_code_phase_samples + T_prn_diff_seconds * N_prn_diff * static_cast<double>(d_fs_in)), T_prn_true_samples);
 | 
			
		||||
    if (corrected_acq_phase_samples < 0)
 | 
			
		||||
        {
 | 
			
		||||
            corrected_acq_phase_samples = T_prn_mod_samples + corrected_acq_phase_samples;
 | 
			
		||||
@@ -235,9 +238,9 @@ void Gps_L1_Ca_Dll_Pll_Tracking_cc::start_tracking()
 | 
			
		||||
 | 
			
		||||
    d_carrier_lock_fail_counter = 0;
 | 
			
		||||
    d_rem_code_phase_samples = 0;
 | 
			
		||||
    d_rem_carr_phase_rad = 0;
 | 
			
		||||
    d_acc_carrier_phase_rad = 0;
 | 
			
		||||
    d_acc_code_phase_secs = 0;
 | 
			
		||||
    d_rem_carr_phase_rad = 0.0;
 | 
			
		||||
    d_acc_carrier_phase_rad = 0.0;
 | 
			
		||||
    d_acc_code_phase_secs = 0.0;
 | 
			
		||||
 | 
			
		||||
    d_code_phase_samples = d_acq_code_phase_samples;
 | 
			
		||||
 | 
			
		||||
@@ -248,7 +251,6 @@ void Gps_L1_Ca_Dll_Pll_Tracking_cc::start_tracking()
 | 
			
		||||
    std::cout << "Tracking start on channel " << d_channel << " for satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << std::endl;
 | 
			
		||||
    LOG(INFO) << "Starting tracking of satellite " << Gnss_Satellite(systemName[sys], d_acquisition_gnss_synchro->PRN) << " on channel " << d_channel;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    // enable tracking
 | 
			
		||||
    d_pull_in = true;
 | 
			
		||||
    d_enable_tracking = true;
 | 
			
		||||
@@ -336,10 +338,10 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items, gr_vector_in
 | 
			
		||||
        gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
 | 
			
		||||
{
 | 
			
		||||
    // process vars
 | 
			
		||||
    double carr_error_hz;
 | 
			
		||||
    double carr_error_filt_hz;
 | 
			
		||||
    double code_error_chips;
 | 
			
		||||
    double code_error_filt_chips;
 | 
			
		||||
    double carr_error_hz = 0.0;
 | 
			
		||||
    double carr_error_filt_hz = 0.0;
 | 
			
		||||
    double code_error_chips = 0.0;
 | 
			
		||||
    double code_error_filt_chips = 0.0;
 | 
			
		||||
 | 
			
		||||
    // Block input data and block output stream pointers
 | 
			
		||||
    const gr_complex* in = (gr_complex*) input_items[0]; //PRN start block alignment
 | 
			
		||||
@@ -623,7 +625,11 @@ int Gps_L1_Ca_Dll_Pll_Tracking_cc::general_work (int noutput_items, gr_vector_in
 | 
			
		||||
 | 
			
		||||
    consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates
 | 
			
		||||
    d_sample_counter += d_current_prn_length_samples; //count for the processed samples
 | 
			
		||||
    //LOG(INFO)<<"GPS tracking output end on CH="<<this->d_channel << " SAMPLE STAMP="<<d_sample_counter<<std::endl;
 | 
			
		||||
 | 
			
		||||
    if((noutput_items == 0) || (ninput_items[0] == 0))
 | 
			
		||||
        {
 | 
			
		||||
            LOG(WARNING) << "noutput_items = 0";
 | 
			
		||||
        }
 | 
			
		||||
    return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -84,7 +84,10 @@ gps_l1_ca_tcp_connector_make_tracking_cc(
 | 
			
		||||
void Gps_L1_Ca_Tcp_Connector_Tracking_cc::forecast (int noutput_items,
 | 
			
		||||
        gr_vector_int &ninput_items_required)
 | 
			
		||||
{
 | 
			
		||||
    ninput_items_required[0] = (int)d_vector_length*2; //set the required available samples in each call
 | 
			
		||||
    if (noutput_items != 0)
 | 
			
		||||
        {
 | 
			
		||||
            ninput_items_required[0] = (int)d_vector_length*2; //set the required available samples in each call
 | 
			
		||||
        }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -660,6 +663,10 @@ int Gps_L1_Ca_Tcp_Connector_Tracking_cc::general_work (int noutput_items, gr_vec
 | 
			
		||||
    consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates
 | 
			
		||||
    d_sample_counter_seconds = d_sample_counter_seconds + ( ((double)d_current_prn_length_samples) / (double)d_fs_in );
 | 
			
		||||
    d_sample_counter += d_current_prn_length_samples; //count for the processed samples
 | 
			
		||||
    if((noutput_items == 0) || (ninput_items[0] == 0))
 | 
			
		||||
        {
 | 
			
		||||
            LOG(WARNING) << "noutput_items = 0";
 | 
			
		||||
        }
 | 
			
		||||
    return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -82,7 +82,10 @@ gps_l2_m_dll_pll_make_tracking_cc(
 | 
			
		||||
void gps_l2_m_dll_pll_tracking_cc::forecast (int noutput_items,
 | 
			
		||||
        gr_vector_int &ninput_items_required)
 | 
			
		||||
{
 | 
			
		||||
    ninput_items_required[0] = static_cast<int>(d_vector_length) * 2; //set the required available samples in each call
 | 
			
		||||
    if (noutput_items != 0)
 | 
			
		||||
        {
 | 
			
		||||
            ninput_items_required[0] = static_cast<int>(d_vector_length) * 2; //set the required available samples in each call
 | 
			
		||||
        }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -627,7 +630,10 @@ int gps_l2_m_dll_pll_tracking_cc::general_work (int noutput_items, gr_vector_int
 | 
			
		||||
        }
 | 
			
		||||
    consume_each(d_current_prn_length_samples); // this is necessary in gr::block derivates
 | 
			
		||||
    d_sample_counter += d_current_prn_length_samples; //count for the processed samples
 | 
			
		||||
    //LOG(INFO)<<"GPS L2 tracking output end on CH="<<this->d_channel << " SAMPLE STAMP="<<d_sample_counter<<std::endl;
 | 
			
		||||
    if((noutput_items == 0) || (ninput_items[0] == 0))
 | 
			
		||||
        {
 | 
			
		||||
            LOG(WARNING) << "noutput_items = 0";
 | 
			
		||||
        }
 | 
			
		||||
    return 1; //output tracking result ALWAYS even in the case of d_enable_tracking==false
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -146,6 +146,7 @@ cpu_multicorrelator::cpu_multicorrelator()
 | 
			
		||||
    d_local_code_in = NULL;
 | 
			
		||||
    d_shifts_chips = NULL;
 | 
			
		||||
    d_corr_out = NULL;
 | 
			
		||||
    d_local_codes_resampled = NULL;
 | 
			
		||||
    d_code_length_chips = 0;
 | 
			
		||||
    d_n_correlators = 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -41,7 +41,7 @@ gnss_sdr_supl_client::gnss_sdr_supl_client()
 | 
			
		||||
    lac = 0;
 | 
			
		||||
    ci = 0;
 | 
			
		||||
    supl_ctx_new(&ctx);
 | 
			
		||||
    assist = {0};
 | 
			
		||||
    assist = {};
 | 
			
		||||
    server_port = 0;
 | 
			
		||||
    request = 0;
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -512,6 +512,12 @@ std::string Gnss_Satellite::what_block(const std::string& system_, unsigned int
 | 
			
		||||
            case 22 :
 | 
			
		||||
                block_ = std::string("FOC-FM4"); // Galileo Full Operational Capability (FOC) satellite FM4, launched on March 27, 2015.
 | 
			
		||||
                break;
 | 
			
		||||
            case 24 :
 | 
			
		||||
                block_ = std::string("FOC-FM5"); // Galileo Full Operational Capability (FOC) satellite FM5, launched on Sept. 11, 2015.
 | 
			
		||||
                break;
 | 
			
		||||
            case 30 :
 | 
			
		||||
                block_ = std::string("FOC-FM6"); // Galileo Full Operational Capability (FOC) satellite FM6, launched on Sept. 11, 2015.
 | 
			
		||||
                break;
 | 
			
		||||
            default:
 | 
			
		||||
                block_ = std::string("Unknown(Simulated)");
 | 
			
		||||
            }
 | 
			
		||||
 
 | 
			
		||||
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							@@ -36,26 +36,70 @@
 | 
			
		||||
#include <bitset>
 | 
			
		||||
#include <map>
 | 
			
		||||
#include <string>
 | 
			
		||||
#include <utility>
 | 
			
		||||
#include <vector>
 | 
			
		||||
#include <boost/crc.hpp>
 | 
			
		||||
#include <boost/date_time/posix_time/posix_time.hpp>
 | 
			
		||||
#include "gnss_synchro.h"
 | 
			
		||||
#include "galileo_fnav_message.h"
 | 
			
		||||
#include "gps_navigation_message.h"
 | 
			
		||||
#include "gps_cnav_navigation_message.h"
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/*!
 | 
			
		||||
 * \brief This class implements the generation and reading of some Message Types
 | 
			
		||||
 * defined in the RTCM 3.2 Standard.
 | 
			
		||||
 * This class implements the generation and reading of some Message Types
 | 
			
		||||
 * defined in the RTCM 3.2 Standard, plus some utilities to handle messages.
 | 
			
		||||
 *
 | 
			
		||||
 * Generation of the following Message Types:
 | 
			
		||||
 *   1001, 1002, 1003, 1004, 1005, 1019, 1045
 | 
			
		||||
 *
 | 
			
		||||
 * Decoding of the following Message Types:
 | 
			
		||||
 *   1019, 1045
 | 
			
		||||
 *
 | 
			
		||||
 * Generation of the following Multiple Signal Messages:
 | 
			
		||||
 *   MSM1 (message types 1071, 1091)
 | 
			
		||||
 *   MSM2 (message types 1072, 1092)
 | 
			
		||||
 *   MSM3 (message types 1073, 1093)
 | 
			
		||||
 *   MSM4 (message types 1074, 1094)
 | 
			
		||||
 *   MSM5 (message types 1075, 1095)
 | 
			
		||||
 *   MSM6 (message types 1076, 1096)
 | 
			
		||||
 *   MSM7 (message types 1077, 1097)
 | 
			
		||||
 *
 | 
			
		||||
 * RTCM 3 message format (size in bits):
 | 
			
		||||
 *   +----------+--------+-----------+--------------------+----------+
 | 
			
		||||
 *   | preamble | 000000 |  length   |    data message    |  parity  |
 | 
			
		||||
 *   +----------+--------+-----------+--------------------+----------+
 | 
			
		||||
 *   |<-- 8 --->|<- 6 -->|<-- 10 --->|<--- length x 8 --->|<-- 24 -->|
 | 
			
		||||
 *   +----------+--------+-----------+--------------------+----------+
 | 
			
		||||
 *
 | 
			
		||||
 *
 | 
			
		||||
 *   (C) Carles Fernandez-Prades, 2015. cfernandez(at)cttc.es
 | 
			
		||||
 */
 | 
			
		||||
class Rtcm
 | 
			
		||||
{
 | 
			
		||||
public:
 | 
			
		||||
    Rtcm(); //<! Default constructor
 | 
			
		||||
 | 
			
		||||
    /*!
 | 
			
		||||
     * \brief Prints message type 1001 (L1-Only GPS RTK Observables)
 | 
			
		||||
     */
 | 
			
		||||
    std::string print_MT1001(const Gps_Ephemeris& gps_eph, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges);
 | 
			
		||||
 | 
			
		||||
    /*!
 | 
			
		||||
     * \brief Prints message type 1002 (Extended L1-Only GPS RTK Observables)
 | 
			
		||||
     */
 | 
			
		||||
    std::string print_MT1002(const Gps_Ephemeris & gps_eph, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges);
 | 
			
		||||
 | 
			
		||||
    /*!
 | 
			
		||||
     * \brief Prints message type 1003 (L1 & L2 GPS RTK Observables)
 | 
			
		||||
     */
 | 
			
		||||
    std::string print_MT1003(const Gps_Ephemeris & ephL1, const Gps_CNAV_Ephemeris & ephL2, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges);
 | 
			
		||||
 | 
			
		||||
    /*!
 | 
			
		||||
     * \brief Prints message type 1004 (Extended L1 & L2 GPS RTK Observables)
 | 
			
		||||
     */
 | 
			
		||||
    std::string print_MT1004(const Gps_Ephemeris & ephL1, const Gps_CNAV_Ephemeris & ephL2, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges);
 | 
			
		||||
 | 
			
		||||
    /*!
 | 
			
		||||
     * \brief Prints message type 1005 (Stationary Antenna Reference Point)
 | 
			
		||||
     */
 | 
			
		||||
@@ -87,7 +131,11 @@ public:
 | 
			
		||||
     */
 | 
			
		||||
    int read_MT1045(const std::string & message, Galileo_Ephemeris & gal_eph);
 | 
			
		||||
 | 
			
		||||
    /*!
 | 
			
		||||
     * \brief Prints messages of type MSM1 (Compact GNSS pseudoranges)
 | 
			
		||||
     */
 | 
			
		||||
    std::string print_MSM_1( const Gps_Ephemeris & gps_eph,
 | 
			
		||||
            const Gps_CNAV_Ephemeris & gps_cnav_eph,
 | 
			
		||||
            const Galileo_Ephemeris & gal_eph,
 | 
			
		||||
            double obs_time,
 | 
			
		||||
            const std::map<int, Gnss_Synchro> & pseudoranges,
 | 
			
		||||
@@ -99,6 +147,106 @@ public:
 | 
			
		||||
            bool divergence_free,
 | 
			
		||||
            bool more_messages);
 | 
			
		||||
 | 
			
		||||
    /*!
 | 
			
		||||
     * \brief Prints messages of type MSM2 (Compact GNSS phaseranges)
 | 
			
		||||
     */
 | 
			
		||||
    std::string print_MSM_2( const Gps_Ephemeris & gps_eph,
 | 
			
		||||
            const Gps_CNAV_Ephemeris & gps_cnav_eph,
 | 
			
		||||
            const Galileo_Ephemeris & gal_eph,
 | 
			
		||||
            double obs_time,
 | 
			
		||||
            const std::map<int, Gnss_Synchro> & pseudoranges,
 | 
			
		||||
            unsigned int ref_id,
 | 
			
		||||
            unsigned int clock_steering_indicator,
 | 
			
		||||
            unsigned int external_clock_indicator,
 | 
			
		||||
            int smooth_int,
 | 
			
		||||
            bool sync_flag,
 | 
			
		||||
            bool divergence_free,
 | 
			
		||||
            bool more_messages);
 | 
			
		||||
 | 
			
		||||
    /*!
 | 
			
		||||
     * \brief Prints messages of type MSM3 (Compact GNSS pseudoranges and phaseranges)
 | 
			
		||||
     */
 | 
			
		||||
    std::string print_MSM_3( const Gps_Ephemeris & gps_eph,
 | 
			
		||||
            const Gps_CNAV_Ephemeris & gps_cnav_eph,
 | 
			
		||||
            const Galileo_Ephemeris & gal_eph,
 | 
			
		||||
            double obs_time,
 | 
			
		||||
            const std::map<int, Gnss_Synchro> & pseudoranges,
 | 
			
		||||
            unsigned int ref_id,
 | 
			
		||||
            unsigned int clock_steering_indicator,
 | 
			
		||||
            unsigned int external_clock_indicator,
 | 
			
		||||
            int smooth_int,
 | 
			
		||||
            bool sync_flag,
 | 
			
		||||
            bool divergence_free,
 | 
			
		||||
            bool more_messages);
 | 
			
		||||
 | 
			
		||||
    /*!
 | 
			
		||||
     * \brief Prints messages of type MSM4 (Full GNSS pseudoranges and phaseranges plus CNR)
 | 
			
		||||
     */
 | 
			
		||||
    std::string print_MSM_4( const Gps_Ephemeris & gps_eph,
 | 
			
		||||
            const Gps_CNAV_Ephemeris & gps_cnav_eph,
 | 
			
		||||
            const Galileo_Ephemeris & gal_eph,
 | 
			
		||||
            double obs_time,
 | 
			
		||||
            const std::map<int, Gnss_Synchro> & pseudoranges,
 | 
			
		||||
            unsigned int ref_id,
 | 
			
		||||
            unsigned int clock_steering_indicator,
 | 
			
		||||
            unsigned int external_clock_indicator,
 | 
			
		||||
            int smooth_int,
 | 
			
		||||
            bool sync_flag,
 | 
			
		||||
            bool divergence_free,
 | 
			
		||||
            bool more_messages);
 | 
			
		||||
 | 
			
		||||
    /*!
 | 
			
		||||
     * \brief Prints messages of type MSM5 (Full GNSS pseudoranges, phaseranges, phaserange rate and CNR)
 | 
			
		||||
     */
 | 
			
		||||
    std::string print_MSM_5( const Gps_Ephemeris & gps_eph,
 | 
			
		||||
            const Gps_CNAV_Ephemeris & gps_cnav_eph,
 | 
			
		||||
            const Galileo_Ephemeris & gal_eph,
 | 
			
		||||
            double obs_time,
 | 
			
		||||
            const std::map<int, Gnss_Synchro> & pseudoranges,
 | 
			
		||||
            unsigned int ref_id,
 | 
			
		||||
            unsigned int clock_steering_indicator,
 | 
			
		||||
            unsigned int external_clock_indicator,
 | 
			
		||||
            int smooth_int,
 | 
			
		||||
            bool sync_flag,
 | 
			
		||||
            bool divergence_free,
 | 
			
		||||
            bool more_messages);
 | 
			
		||||
 | 
			
		||||
    /*!
 | 
			
		||||
     * \brief Prints messages of type MSM6 (Full GNSS pseudoranges and phaseranges plus CNR, high resolution)
 | 
			
		||||
     */
 | 
			
		||||
    std::string print_MSM_6( const Gps_Ephemeris & gps_eph,
 | 
			
		||||
            const Gps_CNAV_Ephemeris & gps_cnav_eph,
 | 
			
		||||
            const Galileo_Ephemeris & gal_eph,
 | 
			
		||||
            double obs_time,
 | 
			
		||||
            const std::map<int, Gnss_Synchro> & pseudoranges,
 | 
			
		||||
            unsigned int ref_id,
 | 
			
		||||
            unsigned int clock_steering_indicator,
 | 
			
		||||
            unsigned int external_clock_indicator,
 | 
			
		||||
            int smooth_int,
 | 
			
		||||
            bool sync_flag,
 | 
			
		||||
            bool divergence_free,
 | 
			
		||||
            bool more_messages);
 | 
			
		||||
 | 
			
		||||
    /*!
 | 
			
		||||
     * \brief Prints messages of type MSM7 (Full GNSS pseudoranges, phaseranges, phaserange rate and CNR, high resolution)
 | 
			
		||||
     */
 | 
			
		||||
    std::string print_MSM_7( const Gps_Ephemeris & gps_eph,
 | 
			
		||||
            const Gps_CNAV_Ephemeris & gps_cnav_eph,
 | 
			
		||||
            const Galileo_Ephemeris & gal_eph,
 | 
			
		||||
            double obs_time,
 | 
			
		||||
            const std::map<int, Gnss_Synchro> & pseudoranges,
 | 
			
		||||
            unsigned int ref_id,
 | 
			
		||||
            unsigned int clock_steering_indicator,
 | 
			
		||||
            unsigned int external_clock_indicator,
 | 
			
		||||
            int smooth_int,
 | 
			
		||||
            bool sync_flag,
 | 
			
		||||
            bool divergence_free,
 | 
			
		||||
            bool more_messages);
 | 
			
		||||
 | 
			
		||||
    unsigned int lock_time(const Gps_Ephemeris & eph, double obs_time, const Gnss_Synchro & gnss_synchro); //<! Returns the time period in which GPS L1 signals have been continually tracked.
 | 
			
		||||
    unsigned int lock_time(const Gps_CNAV_Ephemeris & eph, double obs_time, const Gnss_Synchro & gnss_synchro); //<! Returns the time period in which GPS L2 signals have been continually tracked.
 | 
			
		||||
    unsigned int lock_time(const Galileo_Ephemeris & eph, double obs_time, const Gnss_Synchro & gnss_synchro); //<! Returns the time period in which Galileo signals have been continually tracked.
 | 
			
		||||
 | 
			
		||||
    std::string bin_to_hex(const std::string& s); //<! Returns a string of hexadecimal symbols from a string of binary symbols
 | 
			
		||||
    std::string hex_to_bin(const std::string& s); //<! Returns a string of binary symbols from a string of hexadecimal symbols
 | 
			
		||||
 | 
			
		||||
@@ -115,18 +263,8 @@ public:
 | 
			
		||||
 | 
			
		||||
private:
 | 
			
		||||
    //
 | 
			
		||||
    // Messages
 | 
			
		||||
    // Generation of messages content
 | 
			
		||||
    //
 | 
			
		||||
    std::bitset<64> message1001_header;
 | 
			
		||||
    std::bitset<58> message1001_content;
 | 
			
		||||
    std::bitset<64> message1002_header;
 | 
			
		||||
    std::bitset<74> message1002_content;
 | 
			
		||||
    std::bitset<488> message1019_content;
 | 
			
		||||
    std::bitset<496> message1045_content;
 | 
			
		||||
    std::bitset<169> MSM_header; // 169+X
 | 
			
		||||
    std::vector<std::bitset<18> > MSM4_content; // 18 * Nsat
 | 
			
		||||
    std::vector<std::bitset<36> > MSM5_content; // 36 * Nsat
 | 
			
		||||
 | 
			
		||||
    std::bitset<64> get_MT1001_4_header(unsigned int msg_number,
 | 
			
		||||
            const Gps_Ephemeris & gps_eph,
 | 
			
		||||
            double obs_time,
 | 
			
		||||
@@ -136,12 +274,15 @@ private:
 | 
			
		||||
            bool sync_flag,
 | 
			
		||||
            bool divergence_free);
 | 
			
		||||
 | 
			
		||||
    std::bitset<58> get_MT1001_sat_content(const Gnss_Synchro & gnss_synchro);
 | 
			
		||||
    std::bitset<74>get_MT1002_sat_content(const Gnss_Synchro & gnss_synchro);
 | 
			
		||||
    std::bitset<58> get_MT1001_sat_content(const Gps_Ephemeris & eph, double obs_time, const Gnss_Synchro & gnss_synchro);
 | 
			
		||||
    std::bitset<74> get_MT1002_sat_content(const Gps_Ephemeris & eph, double obs_time, const Gnss_Synchro & gnss_synchro);
 | 
			
		||||
    std::bitset<101> get_MT1003_sat_content(const Gps_Ephemeris & ephL1, const Gps_CNAV_Ephemeris & ephL2, double obs_time, const Gnss_Synchro & gnss_synchroL1, const Gnss_Synchro & gnss_synchroL2);
 | 
			
		||||
    std::bitset<125> get_MT1004_sat_content(const Gps_Ephemeris & ephL1, const Gps_CNAV_Ephemeris & ephL2, double obs_time, const Gnss_Synchro & gnss_synchroL1, const Gnss_Synchro & gnss_synchroL2);
 | 
			
		||||
 | 
			
		||||
    std::bitset<152> get_MT1005_test();
 | 
			
		||||
 | 
			
		||||
    std::string get_MSM_header(unsigned int msg_number, const Gps_Ephemeris & gps_eph,
 | 
			
		||||
            const Gps_CNAV_Ephemeris & gps_cnav_eph,
 | 
			
		||||
            const Galileo_Ephemeris & gal_eph,
 | 
			
		||||
            double obs_time,
 | 
			
		||||
            const std::map<int, Gnss_Synchro> & pseudoranges,
 | 
			
		||||
@@ -154,9 +295,34 @@ private:
 | 
			
		||||
            bool more_messages);
 | 
			
		||||
 | 
			
		||||
    std::string get_MSM_1_content_sat_data(const std::map<int, Gnss_Synchro> & pseudoranges);
 | 
			
		||||
    std::string get_MSM_1_content_signal_data(const std::map<int, Gnss_Synchro> & pseudoranges);
 | 
			
		||||
 | 
			
		||||
    std::string get_MSM_4_content_sat_data(const std::map<int, Gnss_Synchro> & pseudoranges);
 | 
			
		||||
    std::string get_MSM_5_content_sat_data(const std::map<int, Gnss_Synchro> & pseudoranges);
 | 
			
		||||
 | 
			
		||||
    std::string get_MSM_1_content_signal_data(const std::map<int, Gnss_Synchro> & pseudoranges);
 | 
			
		||||
    std::string get_MSM_2_content_signal_data(const Gps_Ephemeris & ephNAV, const Gps_CNAV_Ephemeris & ephCNAV, const Galileo_Ephemeris & ephFNAV, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges);
 | 
			
		||||
    std::string get_MSM_3_content_signal_data(const Gps_Ephemeris & ephNAV, const Gps_CNAV_Ephemeris & ephCNAV, const Galileo_Ephemeris & ephFNAV, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges);
 | 
			
		||||
    std::string get_MSM_4_content_signal_data(const Gps_Ephemeris & ephNAV, const Gps_CNAV_Ephemeris & ephCNAV, const Galileo_Ephemeris & ephFNAV, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges);
 | 
			
		||||
    std::string get_MSM_5_content_signal_data(const Gps_Ephemeris & ephNAV, const Gps_CNAV_Ephemeris & ephCNAV, const Galileo_Ephemeris & ephFNAV, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges);
 | 
			
		||||
    std::string get_MSM_6_content_signal_data(const Gps_Ephemeris & ephNAV, const Gps_CNAV_Ephemeris & ephCNAV, const Galileo_Ephemeris & ephFNAV, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges);
 | 
			
		||||
    std::string get_MSM_7_content_signal_data(const Gps_Ephemeris & ephNAV, const Gps_CNAV_Ephemeris & ephCNAV, const Galileo_Ephemeris & ephFNAV, double obs_time, const std::map<int, Gnss_Synchro> & pseudoranges);
 | 
			
		||||
 | 
			
		||||
    //
 | 
			
		||||
    // Utilities
 | 
			
		||||
    //
 | 
			
		||||
    static std::map<std::string, int> galileo_signal_map;
 | 
			
		||||
    static std::map<std::string, int> gps_signal_map;
 | 
			
		||||
    std::vector<std::pair<int, Gnss_Synchro> > sort_by_signal(const std::vector<std::pair<int, Gnss_Synchro> >  & synchro_map);
 | 
			
		||||
    std::vector<std::pair<int, Gnss_Synchro> > sort_by_PRN_mask(const std::vector<std::pair<int, Gnss_Synchro> >  & synchro_map);
 | 
			
		||||
    boost::posix_time::ptime compute_GPS_time(const Gps_Ephemeris& eph, double obs_time);
 | 
			
		||||
    boost::posix_time::ptime compute_GPS_time(const Gps_CNAV_Ephemeris & eph, double obs_time);
 | 
			
		||||
    boost::posix_time::ptime compute_Galileo_time(const Galileo_Ephemeris& eph, double obs_time);
 | 
			
		||||
    boost::posix_time::ptime gps_L1_last_lock_time[64];
 | 
			
		||||
    boost::posix_time::ptime gps_L2_last_lock_time[64];
 | 
			
		||||
    boost::posix_time::ptime gal_E1_last_lock_time[64];
 | 
			
		||||
    boost::posix_time::ptime gal_E5_last_lock_time[64];
 | 
			
		||||
    unsigned int lock_time_indicator(unsigned int lock_time_period_s);
 | 
			
		||||
    unsigned int msm_lock_time_indicator(unsigned int lock_time_period_s);
 | 
			
		||||
    unsigned int msm_extended_lock_time_indicator(unsigned int lock_time_period_s);
 | 
			
		||||
 | 
			
		||||
    //
 | 
			
		||||
    // Transport Layer
 | 
			
		||||
@@ -182,6 +348,7 @@ private:
 | 
			
		||||
 | 
			
		||||
    std::bitset<30> DF004;
 | 
			
		||||
    int set_DF004(const Gps_Ephemeris & gps_eph, double obs_time);
 | 
			
		||||
    int set_DF004(const Gps_CNAV_Ephemeris & gps_eph, double obs_time);
 | 
			
		||||
 | 
			
		||||
    std::bitset<1> DF005;
 | 
			
		||||
    int set_DF005(bool sync_flag);
 | 
			
		||||
@@ -209,12 +376,25 @@ private:
 | 
			
		||||
    int set_DF012(const Gnss_Synchro & gnss_synchro);
 | 
			
		||||
 | 
			
		||||
    std::bitset<7> DF013;
 | 
			
		||||
    int set_DF013(const Gps_Ephemeris & eph, double obs_time, const Gnss_Synchro & gnss_synchro);
 | 
			
		||||
 | 
			
		||||
    std::bitset<8> DF014;
 | 
			
		||||
    int set_DF014(const Gnss_Synchro & gnss_synchro);
 | 
			
		||||
 | 
			
		||||
    std::bitset<8> DF015;
 | 
			
		||||
    int set_DF015(const Gnss_Synchro & gnss_synchro);
 | 
			
		||||
 | 
			
		||||
    std::bitset<14> DF017;
 | 
			
		||||
    int set_DF017(const Gnss_Synchro & gnss_synchroL1, const Gnss_Synchro & gnss_synchroL2);
 | 
			
		||||
 | 
			
		||||
    std::bitset<20> DF018;
 | 
			
		||||
    int set_DF018(const Gnss_Synchro & gnss_synchroL1, const Gnss_Synchro & gnss_synchroL2);
 | 
			
		||||
 | 
			
		||||
    std::bitset<7> DF019;
 | 
			
		||||
    int set_DF019(const Gps_CNAV_Ephemeris & eph, double obs_time, const Gnss_Synchro & gnss_synchro);
 | 
			
		||||
 | 
			
		||||
    std::bitset<8> DF020;
 | 
			
		||||
    int set_DF020(const Gnss_Synchro & gnss_synchro);
 | 
			
		||||
 | 
			
		||||
    std::bitset<6> DF021;
 | 
			
		||||
    int set_DF021();
 | 
			
		||||
@@ -329,7 +509,6 @@ private:
 | 
			
		||||
    int set_DF137(const Gps_Ephemeris & gps_eph);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    std::bitset<1> DF141;
 | 
			
		||||
    int set_DF141(const Gps_Ephemeris & gps_eph);
 | 
			
		||||
 | 
			
		||||
@@ -450,6 +629,30 @@ private:
 | 
			
		||||
    std::bitset<15> DF400;
 | 
			
		||||
    int set_DF400(const Gnss_Synchro & gnss_synchro);
 | 
			
		||||
 | 
			
		||||
    std::bitset<22> DF401;
 | 
			
		||||
    int set_DF401(const Gnss_Synchro & gnss_synchro);
 | 
			
		||||
 | 
			
		||||
    std::bitset<4> DF402;
 | 
			
		||||
    int set_DF402(const Gps_Ephemeris & ephNAV, const Gps_CNAV_Ephemeris & ephCNAV, const Galileo_Ephemeris & ephFNAV, double obs_time, const Gnss_Synchro & gnss_synchro);
 | 
			
		||||
 | 
			
		||||
    std::bitset<6> DF403;
 | 
			
		||||
    int set_DF403(const Gnss_Synchro & gnss_synchro);
 | 
			
		||||
 | 
			
		||||
    std::bitset<15> DF404;
 | 
			
		||||
    int set_DF404(const Gnss_Synchro & gnss_synchro);
 | 
			
		||||
 | 
			
		||||
    std::bitset<20> DF405;
 | 
			
		||||
    int set_DF405(const Gnss_Synchro & gnss_synchro);
 | 
			
		||||
 | 
			
		||||
    std::bitset<24> DF406;
 | 
			
		||||
    int set_DF406(const Gnss_Synchro & gnss_synchro);
 | 
			
		||||
 | 
			
		||||
    std::bitset<10> DF407;
 | 
			
		||||
    int set_DF407(const Gps_Ephemeris & ephNAV, const Gps_CNAV_Ephemeris & ephCNAV, const Galileo_Ephemeris & ephFNAV, double obs_time, const Gnss_Synchro & gnss_synchro);
 | 
			
		||||
 | 
			
		||||
    std::bitset<10> DF408;
 | 
			
		||||
    int set_DF408(const Gnss_Synchro & gnss_synchro);
 | 
			
		||||
 | 
			
		||||
    std::bitset<3> DF409;
 | 
			
		||||
    int set_DF409(unsigned int iods);
 | 
			
		||||
 | 
			
		||||
@@ -464,6 +667,9 @@ private:
 | 
			
		||||
 | 
			
		||||
    std::bitset<3> DF418;
 | 
			
		||||
    int set_DF418(int carrier_smoothing_interval_s);
 | 
			
		||||
 | 
			
		||||
    std::bitset<1> DF420;
 | 
			
		||||
    int set_DF420(const Gnss_Synchro & gnss_synchro);
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
#endif
 | 
			
		||||
 
 | 
			
		||||
@@ -467,8 +467,8 @@ int Sbas_Telemetry_Data::getbits(const unsigned char *buff, int pos, int len)
 | 
			
		||||
 *-----------------------------------------------------------------------------*/
 | 
			
		||||
Sbas_Telemetry_Data::gtime_t Sbas_Telemetry_Data::epoch2time(const double *ep)
 | 
			
		||||
{
 | 
			
		||||
    const int doy[]={1, 32, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335};
 | 
			
		||||
    gtime_t time = {0};
 | 
			
		||||
    const int doy[] = {1, 32, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335};
 | 
			
		||||
    gtime_t time = {};
 | 
			
		||||
    int days, sec, year = (int)ep[0], mon = (int)ep[1], day = (int)ep[2];
 | 
			
		||||
 | 
			
		||||
    if (year < 1970 || 2099 < year || mon < 1 || 12 < mon) return time;
 | 
			
		||||
 
 | 
			
		||||
@@ -30,8 +30,6 @@
 | 
			
		||||
 */
 | 
			
		||||
 | 
			
		||||
#include "tracking_loop_filter.h"
 | 
			
		||||
#include "tracking_2nd_PLL_filter.h"
 | 
			
		||||
 | 
			
		||||
#include <gtest/gtest.h>
 | 
			
		||||
 | 
			
		||||
TEST(TrackingLoopFilterTest, FirstOrderLoop)
 | 
			
		||||
@@ -51,21 +49,21 @@ TEST(TrackingLoopFilterTest, FirstOrderLoop)
 | 
			
		||||
    EXPECT_EQ( theFilter.get_include_last_integrator(), include_last_integrator );
 | 
			
		||||
    EXPECT_EQ( theFilter.get_order(), loop_order );
 | 
			
		||||
 | 
			
		||||
    std::vector< float > sample_data = { 0, 0, 1.0, 0.0, 0.0, 0.0 };
 | 
			
		||||
    std::vector< float > sample_data = { 0.0, 0.0, 1.0, 0.0, 0.0, 0.0 };
 | 
			
		||||
 | 
			
		||||
    theFilter.initialize( 0.0 );
 | 
			
		||||
 | 
			
		||||
    float g1 = noise_bandwidth*4.0;
 | 
			
		||||
    float g1 = noise_bandwidth * 4.0;
 | 
			
		||||
 | 
			
		||||
    float result = 0.0;
 | 
			
		||||
    for( unsigned int i = 0; i < sample_data.size(); ++i )
 | 
			
		||||
    {
 | 
			
		||||
        result = theFilter.apply( sample_data[i] );
 | 
			
		||||
 | 
			
		||||
        ASSERT_FLOAT_EQ( result, sample_data[i]*g1 );
 | 
			
		||||
        EXPECT_FLOAT_EQ( result, sample_data[i]*g1 );
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
TEST(TrackingLoopFilterTest, FirstOrderLoopWithLastIntegrator)
 | 
			
		||||
{
 | 
			
		||||
    int loop_order = 1;
 | 
			
		||||
@@ -83,20 +81,17 @@ TEST(TrackingLoopFilterTest, FirstOrderLoopWithLastIntegrator)
 | 
			
		||||
    EXPECT_EQ( theFilter.get_include_last_integrator(), include_last_integrator );
 | 
			
		||||
    EXPECT_EQ( theFilter.get_order(), loop_order );
 | 
			
		||||
 | 
			
		||||
    std::vector< float > sample_data = { 0, 0, 1.0, 0.0, 0.0, 0.0 };
 | 
			
		||||
    std::vector< float > sample_data = { 0.0, 0.0, 1.0, 0.0, 0.0, 0.0 };
 | 
			
		||||
    std::vector< float > expected_out = { 0.0, 0.0, 0.01, 0.02, 0.02, 0.02 };
 | 
			
		||||
 | 
			
		||||
    theFilter.initialize( 0.0 );
 | 
			
		||||
 | 
			
		||||
    float g1 = noise_bandwidth*4.0;
 | 
			
		||||
 | 
			
		||||
    float result = 0.0;
 | 
			
		||||
    for( unsigned int i = 0; i < sample_data.size(); ++i )
 | 
			
		||||
    {
 | 
			
		||||
        result = theFilter.apply( sample_data[i] );
 | 
			
		||||
        ASSERT_NEAR( result, expected_out[i], 1e-4 );
 | 
			
		||||
        EXPECT_NEAR( result, expected_out[i], 1e-4 );
 | 
			
		||||
    }
 | 
			
		||||
    std::cout << std::endl;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -118,7 +113,7 @@ TEST(TrackingLoopFilterTest, SecondOrderLoop)
 | 
			
		||||
    EXPECT_EQ( theFilter.get_include_last_integrator(), include_last_integrator );
 | 
			
		||||
    EXPECT_EQ( theFilter.get_order(), loop_order );
 | 
			
		||||
 | 
			
		||||
    std::vector< float > sample_data = { 0, 0, 1.0, 0.0, 0.0, 0.0 };
 | 
			
		||||
    std::vector< float > sample_data = { 0.0, 0.0, 1.0, 0.0, 0.0, 0.0 };
 | 
			
		||||
    std::vector< float > expected_out = { 0.0, 0.0, 13.37778, 0.0889, 0.0889, 0.0889 };
 | 
			
		||||
 | 
			
		||||
    theFilter.initialize( 0.0 );
 | 
			
		||||
@@ -127,11 +122,11 @@ TEST(TrackingLoopFilterTest, SecondOrderLoop)
 | 
			
		||||
    for( unsigned int i = 0; i < sample_data.size(); ++i )
 | 
			
		||||
    {
 | 
			
		||||
        result = theFilter.apply( sample_data[i] );
 | 
			
		||||
 | 
			
		||||
        ASSERT_NEAR( result, expected_out[i], 1e-4 );
 | 
			
		||||
        EXPECT_NEAR( result, expected_out[i], 1e-4 );
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
TEST(TrackingLoopFilterTest, SecondOrderLoopWithLastIntegrator)
 | 
			
		||||
{
 | 
			
		||||
    int loop_order = 2;
 | 
			
		||||
@@ -149,21 +144,17 @@ TEST(TrackingLoopFilterTest, SecondOrderLoopWithLastIntegrator)
 | 
			
		||||
    EXPECT_EQ( theFilter.get_include_last_integrator(), include_last_integrator );
 | 
			
		||||
    EXPECT_EQ( theFilter.get_order(), loop_order );
 | 
			
		||||
 | 
			
		||||
    std::vector< float > sample_data = { 0, 0, 1.0, 0.0, 0.0, 0.0 };
 | 
			
		||||
    std::vector< float > sample_data = { 0.0, 0.0, 1.0, 0.0, 0.0, 0.0 };
 | 
			
		||||
    std::vector< float > expected_out = { 0.0, 0.0,  0.006689, 0.013422, 0.013511, 0.013600 };
 | 
			
		||||
 | 
			
		||||
    theFilter.initialize( 0.0 );
 | 
			
		||||
 | 
			
		||||
    float g1 = noise_bandwidth*4.0;
 | 
			
		||||
 | 
			
		||||
    float result = 0.0;
 | 
			
		||||
    for( unsigned int i = 0; i < sample_data.size(); ++i )
 | 
			
		||||
    {
 | 
			
		||||
        result = theFilter.apply( sample_data[i] );
 | 
			
		||||
 | 
			
		||||
        ASSERT_NEAR( result, expected_out[i], 1e-4 );
 | 
			
		||||
        EXPECT_NEAR( result, expected_out[i], 1e-4 );
 | 
			
		||||
    }
 | 
			
		||||
    std::cout << std::endl;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -184,7 +175,7 @@ TEST(TrackingLoopFilterTest, ThirdOrderLoop)
 | 
			
		||||
    EXPECT_EQ( theFilter.get_include_last_integrator(), include_last_integrator );
 | 
			
		||||
    EXPECT_EQ( theFilter.get_order(), loop_order );
 | 
			
		||||
 | 
			
		||||
    std::vector< float > sample_data = { 0, 0, 1.0, 0.0, 0.0, 0.0 };
 | 
			
		||||
    std::vector< float > sample_data = { 0.0, 0.0, 1.0, 0.0, 0.0, 0.0 };
 | 
			
		||||
    std::vector< float > expected_out = { 0.0, 0.0, 15.31877, 0.04494, 0.04520, 0.04546};
 | 
			
		||||
 | 
			
		||||
    theFilter.initialize( 0.0 );
 | 
			
		||||
@@ -193,11 +184,11 @@ TEST(TrackingLoopFilterTest, ThirdOrderLoop)
 | 
			
		||||
    for( unsigned int i = 0; i < sample_data.size(); ++i )
 | 
			
		||||
    {
 | 
			
		||||
        result = theFilter.apply( sample_data[i] );
 | 
			
		||||
 | 
			
		||||
        ASSERT_NEAR( result, expected_out[i], 1e-4 );
 | 
			
		||||
        EXPECT_NEAR( result, expected_out[i], 1e-4 );
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
TEST(TrackingLoopFilterTest, ThirdOrderLoopWithLastIntegrator)
 | 
			
		||||
{
 | 
			
		||||
    int loop_order = 3;
 | 
			
		||||
@@ -215,20 +206,17 @@ TEST(TrackingLoopFilterTest, ThirdOrderLoopWithLastIntegrator)
 | 
			
		||||
    EXPECT_EQ( theFilter.get_include_last_integrator(), include_last_integrator );
 | 
			
		||||
    EXPECT_EQ( theFilter.get_order(), loop_order );
 | 
			
		||||
 | 
			
		||||
    std::vector< float > sample_data = { 0, 0, 1.0, 0.0, 0.0, 0.0 };
 | 
			
		||||
    std::vector< float > sample_data = { 0.0, 0.0, 1.0, 0.0, 0.0, 0.0 };
 | 
			
		||||
    std::vector< float > expected_out = { 0.0, 0.0, 0.007659, 0.015341, 0.015386, 0.015432};
 | 
			
		||||
 | 
			
		||||
    theFilter.initialize( 0.0 );
 | 
			
		||||
 | 
			
		||||
    float g1 = noise_bandwidth*4.0;
 | 
			
		||||
 | 
			
		||||
    float result = 0.0;
 | 
			
		||||
    for( unsigned int i = 0; i < sample_data.size(); ++i )
 | 
			
		||||
    {
 | 
			
		||||
        result = theFilter.apply( sample_data[i] );
 | 
			
		||||
        ASSERT_NEAR( result, expected_out[i], 1e-4 );
 | 
			
		||||
        EXPECT_NEAR( result, expected_out[i], 1e-4 );
 | 
			
		||||
    }
 | 
			
		||||
    std::cout << std::endl;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -269,7 +269,7 @@ TEST(Rtcm_Test, MT1001)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
TEST(Rtcm_Test, MSM1)
 | 
			
		||||
TEST(Rtcm_Test, MSMCell)
 | 
			
		||||
{
 | 
			
		||||
    auto rtcm = std::make_shared<Rtcm>();
 | 
			
		||||
    Gps_Ephemeris gps_eph = Gps_Ephemeris();
 | 
			
		||||
@@ -279,10 +279,144 @@ TEST(Rtcm_Test, MSM1)
 | 
			
		||||
    Gnss_Synchro gnss_synchro;
 | 
			
		||||
    Gnss_Synchro gnss_synchro2;
 | 
			
		||||
    Gnss_Synchro gnss_synchro3;
 | 
			
		||||
    Gnss_Synchro gnss_synchro4;
 | 
			
		||||
    Gnss_Synchro gnss_synchro5;
 | 
			
		||||
 | 
			
		||||
    gnss_synchro.PRN = 4;
 | 
			
		||||
    gnss_synchro2.PRN = 8;
 | 
			
		||||
    gnss_synchro3.PRN = 32;
 | 
			
		||||
    gnss_synchro4.PRN = 10;
 | 
			
		||||
    gnss_synchro5.PRN = 10;
 | 
			
		||||
 | 
			
		||||
    std::string gps = "G";
 | 
			
		||||
    std::string gal = "E";
 | 
			
		||||
 | 
			
		||||
    std::string c1 = "1C";
 | 
			
		||||
    std::string s2 = "2S";
 | 
			
		||||
    std::string x5 = "5X";
 | 
			
		||||
 | 
			
		||||
    gnss_synchro.System = *gal.c_str();
 | 
			
		||||
    gnss_synchro2.System = *gps.c_str();
 | 
			
		||||
    gnss_synchro3.System = *gps.c_str();
 | 
			
		||||
    gnss_synchro4.System = *gal.c_str();
 | 
			
		||||
    gnss_synchro5.System = *gps.c_str();
 | 
			
		||||
 | 
			
		||||
    std::memcpy((void*)gnss_synchro.Signal, x5.c_str(), 3);
 | 
			
		||||
    std::memcpy((void*)gnss_synchro2.Signal, s2.c_str(), 3);
 | 
			
		||||
    std::memcpy((void*)gnss_synchro3.Signal, c1.c_str(), 3);
 | 
			
		||||
    std::memcpy((void*)gnss_synchro4.Signal, x5.c_str(), 3);
 | 
			
		||||
    std::memcpy((void*)gnss_synchro5.Signal, c1.c_str(), 3);
 | 
			
		||||
 | 
			
		||||
    gnss_synchro.Pseudorange_m = 20000000.0;
 | 
			
		||||
    gnss_synchro2.Pseudorange_m = 20001010.0;
 | 
			
		||||
    gnss_synchro3.Pseudorange_m = 24002020.0;
 | 
			
		||||
    gnss_synchro4.Pseudorange_m = 20003010.1;
 | 
			
		||||
    gnss_synchro5.Pseudorange_m = 22003010.1;
 | 
			
		||||
 | 
			
		||||
    pseudoranges.insert(std::pair<int, Gnss_Synchro>(1, gnss_synchro));
 | 
			
		||||
    pseudoranges.insert(std::pair<int, Gnss_Synchro>(2, gnss_synchro2));
 | 
			
		||||
    pseudoranges.insert(std::pair<int, Gnss_Synchro>(3, gnss_synchro3));
 | 
			
		||||
    pseudoranges.insert(std::pair<int, Gnss_Synchro>(4, gnss_synchro4));
 | 
			
		||||
    pseudoranges.insert(std::pair<int, Gnss_Synchro>(5, gnss_synchro5));
 | 
			
		||||
 | 
			
		||||
    unsigned int ref_id = 1234;
 | 
			
		||||
    unsigned int clock_steering_indicator = 0;
 | 
			
		||||
    unsigned int external_clock_indicator = 0;
 | 
			
		||||
    int smooth_int = 0;
 | 
			
		||||
    bool sync_flag = false;
 | 
			
		||||
    bool divergence_free = false;
 | 
			
		||||
    bool more_messages = false;
 | 
			
		||||
    double obs_time = 25.0;
 | 
			
		||||
 | 
			
		||||
    gps_eph.i_satellite_PRN = gnss_synchro2.PRN;
 | 
			
		||||
    gal_eph.i_satellite_PRN = gnss_synchro.PRN;
 | 
			
		||||
 | 
			
		||||
    std::string MSM1 = rtcm->print_MSM_1(gps_eph,
 | 
			
		||||
            {},
 | 
			
		||||
            gal_eph,
 | 
			
		||||
            obs_time,
 | 
			
		||||
            pseudoranges,
 | 
			
		||||
            ref_id,
 | 
			
		||||
            clock_steering_indicator,
 | 
			
		||||
            external_clock_indicator,
 | 
			
		||||
            smooth_int,
 | 
			
		||||
            sync_flag,
 | 
			
		||||
            divergence_free,
 | 
			
		||||
            more_messages);
 | 
			
		||||
 | 
			
		||||
    std::string MSM1_bin = rtcm->hex_to_bin(MSM1);
 | 
			
		||||
    unsigned int Nsat = 4;
 | 
			
		||||
    unsigned int Nsig = 3;
 | 
			
		||||
    unsigned int size_header = 14;
 | 
			
		||||
    unsigned int size_msg_length = 10;
 | 
			
		||||
    EXPECT_EQ(0, MSM1_bin.substr(size_header + size_msg_length + 169, Nsat * Nsig).compare("001010101100")); // check cell mask
 | 
			
		||||
 | 
			
		||||
    std::map<int, Gnss_Synchro> pseudoranges2;
 | 
			
		||||
    pseudoranges2.insert(std::pair<int, Gnss_Synchro>(1, gnss_synchro5));
 | 
			
		||||
    pseudoranges2.insert(std::pair<int, Gnss_Synchro>(2, gnss_synchro4));
 | 
			
		||||
    pseudoranges2.insert(std::pair<int, Gnss_Synchro>(3, gnss_synchro3));
 | 
			
		||||
    pseudoranges2.insert(std::pair<int, Gnss_Synchro>(4, gnss_synchro2));
 | 
			
		||||
    pseudoranges2.insert(std::pair<int, Gnss_Synchro>(5, gnss_synchro));
 | 
			
		||||
    std::string MSM1_2 = rtcm->print_MSM_1(gps_eph,
 | 
			
		||||
             {},
 | 
			
		||||
             gal_eph,
 | 
			
		||||
             obs_time,
 | 
			
		||||
             pseudoranges2,
 | 
			
		||||
             ref_id,
 | 
			
		||||
             clock_steering_indicator,
 | 
			
		||||
             external_clock_indicator,
 | 
			
		||||
             smooth_int,
 | 
			
		||||
             sync_flag,
 | 
			
		||||
             divergence_free,
 | 
			
		||||
             more_messages);
 | 
			
		||||
    std::string MSM1_bin_2 = rtcm->hex_to_bin(MSM1_2);
 | 
			
		||||
    EXPECT_EQ(0, MSM1_bin_2.substr(size_header + size_msg_length + 169, Nsat * Nsig).compare("001010101100")); // check cell mask
 | 
			
		||||
 | 
			
		||||
    Gnss_Synchro gnss_synchro6;
 | 
			
		||||
    gnss_synchro6.PRN = 10;
 | 
			
		||||
    gnss_synchro6.System = *gps.c_str();
 | 
			
		||||
    std::memcpy((void*)gnss_synchro6.Signal, s2.c_str(), 3);
 | 
			
		||||
    gnss_synchro6.Pseudorange_m = 24000000.0;
 | 
			
		||||
 | 
			
		||||
    std::map<int, Gnss_Synchro> pseudoranges3;
 | 
			
		||||
    pseudoranges3.insert(std::pair<int, Gnss_Synchro>(1, gnss_synchro));
 | 
			
		||||
    pseudoranges3.insert(std::pair<int, Gnss_Synchro>(2, gnss_synchro2));
 | 
			
		||||
    pseudoranges3.insert(std::pair<int, Gnss_Synchro>(3, gnss_synchro6));
 | 
			
		||||
    pseudoranges3.insert(std::pair<int, Gnss_Synchro>(4, gnss_synchro4));
 | 
			
		||||
    pseudoranges3.insert(std::pair<int, Gnss_Synchro>(5, gnss_synchro5));
 | 
			
		||||
 | 
			
		||||
    std::string MSM1_3 = rtcm->print_MSM_1(gps_eph,
 | 
			
		||||
                {},
 | 
			
		||||
                gal_eph,
 | 
			
		||||
                obs_time,
 | 
			
		||||
                pseudoranges3,
 | 
			
		||||
                ref_id,
 | 
			
		||||
                clock_steering_indicator,
 | 
			
		||||
                external_clock_indicator,
 | 
			
		||||
                smooth_int,
 | 
			
		||||
                sync_flag,
 | 
			
		||||
                divergence_free,
 | 
			
		||||
                more_messages);
 | 
			
		||||
    std::string MSM1_bin_3 = rtcm->hex_to_bin(MSM1_3);
 | 
			
		||||
    EXPECT_EQ(0, MSM1_bin_3.substr(size_header + size_msg_length + 169, (Nsat-1) * Nsig).compare("001010111")); // check cell mask
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
TEST(Rtcm_Test, MSM1)
 | 
			
		||||
{
 | 
			
		||||
    auto rtcm = std::make_shared<Rtcm>();
 | 
			
		||||
    Gps_Ephemeris gps_eph = Gps_Ephemeris();
 | 
			
		||||
    std::map<int, Gnss_Synchro> pseudoranges;
 | 
			
		||||
 | 
			
		||||
    Gnss_Synchro gnss_synchro;
 | 
			
		||||
    Gnss_Synchro gnss_synchro2;
 | 
			
		||||
    Gnss_Synchro gnss_synchro3;
 | 
			
		||||
    Gnss_Synchro gnss_synchro4;
 | 
			
		||||
 | 
			
		||||
    gnss_synchro.PRN = 2;
 | 
			
		||||
    gnss_synchro2.PRN = 4;
 | 
			
		||||
    gnss_synchro3.PRN = 32;
 | 
			
		||||
    gnss_synchro4.PRN = 4;
 | 
			
		||||
 | 
			
		||||
    std::string sys = "G";
 | 
			
		||||
 | 
			
		||||
@@ -292,18 +426,22 @@ TEST(Rtcm_Test, MSM1)
 | 
			
		||||
    gnss_synchro.System = *sys.c_str();
 | 
			
		||||
    gnss_synchro2.System = *sys.c_str();
 | 
			
		||||
    gnss_synchro3.System = *sys.c_str();
 | 
			
		||||
    gnss_synchro4.System = *sys.c_str();
 | 
			
		||||
 | 
			
		||||
    std::memcpy((void*)gnss_synchro.Signal, sig.c_str(), 3);
 | 
			
		||||
    std::memcpy((void*)gnss_synchro2.Signal, sig.c_str(), 3);
 | 
			
		||||
    std::memcpy((void*)gnss_synchro3.Signal, sig2.c_str(), 3);
 | 
			
		||||
    std::memcpy((void*)gnss_synchro4.Signal, sig2.c_str(), 3);
 | 
			
		||||
 | 
			
		||||
    gnss_synchro.Pseudorange_m = 20000000.0;
 | 
			
		||||
    gnss_synchro2.Pseudorange_m = 20000010.0;
 | 
			
		||||
    gnss_synchro3.Pseudorange_m = 20000020.0;
 | 
			
		||||
    gnss_synchro2.Pseudorange_m = 20001010.0;
 | 
			
		||||
    gnss_synchro3.Pseudorange_m = 24002020.0;
 | 
			
		||||
    gnss_synchro4.Pseudorange_m = 20003010.1;
 | 
			
		||||
 | 
			
		||||
    pseudoranges.insert(std::pair<int, Gnss_Synchro>(1, gnss_synchro));
 | 
			
		||||
    pseudoranges.insert(std::pair<int, Gnss_Synchro>(2, gnss_synchro2));
 | 
			
		||||
    pseudoranges.insert(std::pair<int, Gnss_Synchro>(3, gnss_synchro3));
 | 
			
		||||
    pseudoranges.insert(std::pair<int, Gnss_Synchro>(4, gnss_synchro4));
 | 
			
		||||
 | 
			
		||||
    unsigned int ref_id = 1234;
 | 
			
		||||
    unsigned int clock_steering_indicator = 0;
 | 
			
		||||
@@ -317,7 +455,7 @@ TEST(Rtcm_Test, MSM1)
 | 
			
		||||
    gps_eph.i_satellite_PRN = gnss_synchro.PRN;
 | 
			
		||||
 | 
			
		||||
    std::string MSM1 = rtcm->print_MSM_1(gps_eph,
 | 
			
		||||
            gal_eph,
 | 
			
		||||
            {}, {},
 | 
			
		||||
            obs_time,
 | 
			
		||||
            pseudoranges,
 | 
			
		||||
            ref_id,
 | 
			
		||||
@@ -329,5 +467,55 @@ TEST(Rtcm_Test, MSM1)
 | 
			
		||||
            more_messages);
 | 
			
		||||
 | 
			
		||||
    EXPECT_EQ(true, rtcm->check_CRC(MSM1));
 | 
			
		||||
 | 
			
		||||
    std::string MSM1_bin = rtcm->hex_to_bin(MSM1);
 | 
			
		||||
    unsigned int Nsat = 3;
 | 
			
		||||
    unsigned int Nsig = 2;
 | 
			
		||||
    unsigned int size_header = 14;
 | 
			
		||||
    unsigned int size_crc = 24;
 | 
			
		||||
    unsigned int size_msg_length = 10;
 | 
			
		||||
    unsigned int upper_bound = 169 + Nsat * 10 + 43 * Nsig;
 | 
			
		||||
    unsigned int data_size = MSM1_bin.length() - size_header - size_msg_length - size_crc;
 | 
			
		||||
    EXPECT_EQ(true, upper_bound >= data_size);
 | 
			
		||||
    EXPECT_EQ(0, MSM1_bin.substr(0, size_header).compare("11010011000000"));
 | 
			
		||||
    EXPECT_EQ(ref_id, rtcm->bin_to_uint( MSM1_bin.substr(size_header + size_msg_length + 12, 12)));
 | 
			
		||||
    EXPECT_EQ(0, MSM1_bin.substr(size_header + size_msg_length + 169, Nsat * Nsig).compare("101101")); // check cell mask
 | 
			
		||||
 | 
			
		||||
    double meters_to_miliseconds = GPS_C_m_s * 0.001;
 | 
			
		||||
    unsigned int rough_range_1 = static_cast<unsigned int>(std::floor(std::round(gnss_synchro.Pseudorange_m / meters_to_miliseconds / TWO_N10)) + 0.5) & 0x3FFu;
 | 
			
		||||
    unsigned int rough_range_2 = static_cast<unsigned int>(std::floor(std::round(gnss_synchro2.Pseudorange_m / meters_to_miliseconds / TWO_N10)) + 0.5) & 0x3FFu;
 | 
			
		||||
    unsigned int rough_range_4 = static_cast<unsigned int>(std::floor(std::round(gnss_synchro3.Pseudorange_m / meters_to_miliseconds / TWO_N10)) + 0.5) & 0x3FFu;
 | 
			
		||||
    unsigned int read_pseudorange_1 = rtcm->bin_to_uint( MSM1_bin.substr(size_header + size_msg_length + 169 + Nsat * Nsig , 10));
 | 
			
		||||
    unsigned int read_pseudorange_2 = rtcm->bin_to_uint( MSM1_bin.substr(size_header + size_msg_length + 169 + Nsat * Nsig + 10, 10));
 | 
			
		||||
    unsigned int read_pseudorange_4 = rtcm->bin_to_uint( MSM1_bin.substr(size_header + size_msg_length + 169 + Nsat * Nsig + 20, 10));
 | 
			
		||||
 | 
			
		||||
    EXPECT_EQ(rough_range_1, read_pseudorange_1);
 | 
			
		||||
    EXPECT_EQ(rough_range_2, read_pseudorange_2);
 | 
			
		||||
    EXPECT_EQ(rough_range_4, read_pseudorange_4);
 | 
			
		||||
 | 
			
		||||
    int psrng4_s = static_cast<int>(std::round( (gnss_synchro3.Pseudorange_m  - std::round(gnss_synchro3.Pseudorange_m / meters_to_miliseconds / TWO_N10) * meters_to_miliseconds * TWO_N10)/ meters_to_miliseconds / TWO_N24));
 | 
			
		||||
    int read_psrng4_s = rtcm->bin_to_int( MSM1_bin.substr(size_header + size_msg_length + 169 + (Nsat * Nsig) + 30 + 15 * 3, 15));
 | 
			
		||||
    EXPECT_EQ(psrng4_s, read_psrng4_s);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    std::map<int, Gnss_Synchro> pseudoranges2;
 | 
			
		||||
    pseudoranges2.insert(std::pair<int, Gnss_Synchro>(1, gnss_synchro4));
 | 
			
		||||
    pseudoranges2.insert(std::pair<int, Gnss_Synchro>(2, gnss_synchro3));
 | 
			
		||||
    pseudoranges2.insert(std::pair<int, Gnss_Synchro>(3, gnss_synchro2));
 | 
			
		||||
    pseudoranges2.insert(std::pair<int, Gnss_Synchro>(4, gnss_synchro));
 | 
			
		||||
    std::string MSM1_2 = rtcm->print_MSM_1(gps_eph,
 | 
			
		||||
            {}, {},
 | 
			
		||||
            obs_time,
 | 
			
		||||
            pseudoranges2,
 | 
			
		||||
            ref_id,
 | 
			
		||||
            clock_steering_indicator,
 | 
			
		||||
            external_clock_indicator,
 | 
			
		||||
            smooth_int,
 | 
			
		||||
            sync_flag,
 | 
			
		||||
            divergence_free,
 | 
			
		||||
            more_messages);
 | 
			
		||||
    std::string MSM1_bin2 = rtcm->hex_to_bin(MSM1_2);
 | 
			
		||||
    int read_psrng4_s_2 =  rtcm->bin_to_int( MSM1_bin2.substr(size_header + size_msg_length + 169 + (Nsat * Nsig) + 30 + 15 * 3, 15));
 | 
			
		||||
    EXPECT_EQ(psrng4_s, read_psrng4_s_2);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -73,6 +73,7 @@ DECLARE_string(log_dir);
 | 
			
		||||
#include "arithmetic/magnitude_squared_test.cc"
 | 
			
		||||
#include "arithmetic/multiply_test.cc"
 | 
			
		||||
#include "arithmetic/code_generation_test.cc"
 | 
			
		||||
#include "arithmetic/tracking_loop_filter_test.cc"
 | 
			
		||||
#include "configuration/file_configuration_test.cc"
 | 
			
		||||
#include "configuration/in_memory_configuration_test.cc"
 | 
			
		||||
#include "control_thread/control_message_factory_test.cc"
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user