From 2b0e0f73ff5b1400985318009cef9113f301de9e Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 15 Aug 2018 13:38:49 +0200 Subject: [PATCH 1/2] Add work on Doppler rate --- .../tracking/gnuradio_blocks/dll_pll_veml_tracking.cc | 3 +++ .../tracking/gnuradio_blocks/dll_pll_veml_tracking.h | 1 + .../tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.h | 2 +- .../tracking/libs/cpu_multicorrelator_real_codes.cc | 3 ++- src/algorithms/tracking/libs/cpu_multicorrelator_real_codes.h | 2 +- .../tracking/cpu_multicorrelator_real_codes_test.cc | 4 ++++ 6 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc index 1f72b6884..5b4d36581 100755 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.cc @@ -394,6 +394,7 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl d_extend_correlation_symbols_count = 0; d_code_phase_step_chips = 0.0; + d_code_phase_rate_step_chips = 0.0; d_carrier_phase_step_rad = 0.0; d_rem_code_phase_chips = 0.0; d_K_blk_samples = 0.0; @@ -707,6 +708,7 @@ void dll_pll_veml_tracking::do_correlation_step(const gr_complex *input_samples) d_carrier_phase_step_rad, static_cast(d_rem_code_phase_chips) * static_cast(d_code_samples_per_chip), static_cast(d_code_phase_step_chips) * static_cast(d_code_samples_per_chip), + static_cast(d_code_phase_rate_step_chips) * static_cast(d_code_samples_per_chip), trk_parameters.vector_length); // DATA CORRELATOR (if tracking tracks the pilot signal) @@ -718,6 +720,7 @@ void dll_pll_veml_tracking::do_correlation_step(const gr_complex *input_samples) d_carrier_phase_step_rad, static_cast(d_rem_code_phase_chips) * static_cast(d_code_samples_per_chip), static_cast(d_code_phase_step_chips) * static_cast(d_code_samples_per_chip), + static_cast(d_code_phase_rate_step_chips) * static_cast(d_code_samples_per_chip), trk_parameters.vector_length); } } diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h index 8a2fb6e80..97f0c54cc 100755 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking.h @@ -145,6 +145,7 @@ private: gr_complex *d_Prompt_Data; double d_code_phase_step_chips; + double d_code_phase_rate_step_chips; double d_carrier_phase_step_rad; // remaining code phase and carrier phase between tracking loops double d_rem_code_phase_samples; diff --git a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.h b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.h index 4c12b4c92..47090681b 100644 --- a/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.h +++ b/src/algorithms/tracking/gnuradio_blocks/dll_pll_veml_tracking_fpga.h @@ -233,7 +233,7 @@ private: int32_t d_correlation_length_samples; int32_t d_next_prn_length_samples; uint64_t d_sample_counter_next; - uint32_t d_pull_in = 0; + uint32_t d_pull_in = 0U; }; #endif //GNSS_SDR_DLL_PLL_VEML_TRACKING_FPGA_H diff --git a/src/algorithms/tracking/libs/cpu_multicorrelator_real_codes.cc b/src/algorithms/tracking/libs/cpu_multicorrelator_real_codes.cc index e54d77177..b78b1a4c5 100644 --- a/src/algorithms/tracking/libs/cpu_multicorrelator_real_codes.cc +++ b/src/algorithms/tracking/libs/cpu_multicorrelator_real_codes.cc @@ -131,9 +131,10 @@ bool cpu_multicorrelator_real_codes::Carrier_wipeoff_multicorrelator_resampler( float phase_step_rad, float rem_code_phase_chips, float code_phase_step_chips, + float code_phase_rate_step_chips, int signal_length_samples) { - update_local_code(signal_length_samples, rem_code_phase_chips, code_phase_step_chips); + update_local_code(signal_length_samples, rem_code_phase_chips, code_phase_step_chips, code_phase_rate_step_chips); // Regenerate phase at each call in order to avoid numerical issues lv_32fc_t phase_offset_as_complex[1]; phase_offset_as_complex[0] = lv_cmake(std::cos(rem_carrier_phase_in_rad), -std::sin(rem_carrier_phase_in_rad)); diff --git a/src/algorithms/tracking/libs/cpu_multicorrelator_real_codes.h b/src/algorithms/tracking/libs/cpu_multicorrelator_real_codes.h index 7d9e44aee..2edb065ce 100644 --- a/src/algorithms/tracking/libs/cpu_multicorrelator_real_codes.h +++ b/src/algorithms/tracking/libs/cpu_multicorrelator_real_codes.h @@ -52,7 +52,7 @@ public: bool set_local_code_and_taps(int code_length_chips, const float *local_code_in, float *shifts_chips); bool set_input_output_vectors(std::complex *corr_out, const std::complex *sig_in); void update_local_code(int correlator_length_samples, float rem_code_phase_chips, float code_phase_step_chips, float code_phase_rate_step_chips = 0.0); - bool Carrier_wipeoff_multicorrelator_resampler(float rem_carrier_phase_in_rad, float phase_step_rad, float rem_code_phase_chips, float code_phase_step_chips, int signal_length_samples); + bool Carrier_wipeoff_multicorrelator_resampler(float rem_carrier_phase_in_rad, float phase_step_rad, float rem_code_phase_chips, float code_phase_step_chips, float code_phase_rate_step_chips, int signal_length_samples); bool free(); private: diff --git a/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc index 1be7bbe49..3b0c24883 100644 --- a/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc +++ b/src/tests/unit-tests/signal-processing-blocks/tracking/cpu_multicorrelator_real_codes_test.cc @@ -49,6 +49,7 @@ void run_correlator_cpu_real_codes(cpu_multicorrelator_real_codes* correlator, float d_rem_carrier_phase_rad, float d_carrier_phase_step_rad, float d_code_phase_step_chips, + float d_code_phase_rate_step_chips, float d_rem_code_phase_chips, int correlation_size) { @@ -58,6 +59,7 @@ void run_correlator_cpu_real_codes(cpu_multicorrelator_real_codes* correlator, d_carrier_phase_step_rad, d_code_phase_step_chips, d_rem_code_phase_chips, + d_code_phase_rate_step_chips, correlation_size); } } @@ -125,6 +127,7 @@ TEST(CpuMulticorrelatorRealCodesTest, MeasureExecutionTime) float d_rem_carrier_phase_rad = 0.0; float d_carrier_phase_step_rad = 0.1; float d_code_phase_step_chips = 0.3; + float d_code_phase_rate_step_chips = 0.00001; float d_rem_code_phase_chips = 0.4; EXPECT_NO_THROW( @@ -141,6 +144,7 @@ TEST(CpuMulticorrelatorRealCodesTest, MeasureExecutionTime) d_rem_carrier_phase_rad, d_carrier_phase_step_rad, d_code_phase_step_chips, + d_code_phase_rate_step_chips, d_rem_code_phase_chips, correlation_sizes[correlation_sizes_idx])); } From fe36e8f558d193d82cd9d0a29eefef5e76949807 Mon Sep 17 00:00:00 2001 From: Carles Fernandez Date: Wed, 22 Aug 2018 17:44:52 +0200 Subject: [PATCH 2/2] Add doppler rate variable, still not used --- .../tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc | 2 ++ .../tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h | 1 + 2 files changed, 3 insertions(+) diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc index 740a11e84..f277bf216 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.cc @@ -182,6 +182,7 @@ Gps_L1_Ca_Kf_Tracking_cc::Gps_L1_Ca_Kf_Tracking_cc( d_code_phase_samples = 0.0; d_rem_code_phase_chips = 0.0; d_code_phase_step_chips = 0.0; + d_code_phase_rate_step_chips = 0.0; d_carrier_phase_step_rad = 0.0; code_error_chips = 0.0; code_error_filt_chips = 0.0; @@ -732,6 +733,7 @@ int Gps_L1_Ca_Kf_Tracking_cc::general_work(int noutput_items __attribute__((unus d_carrier_phase_step_rad, d_rem_code_phase_chips, d_code_phase_step_chips, + d_code_phase_rate_step_chips, d_current_prn_length_samples); // ################## Kalman Carrier Tracking ###################################### diff --git a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h index 64f22ee26..da293dc47 100644 --- a/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h +++ b/src/algorithms/tracking/gnuradio_blocks/gps_l1_ca_kf_tracking_cc.h @@ -179,6 +179,7 @@ private: // tracking vars double d_code_freq_chips; double d_code_phase_step_chips; + double d_code_phase_rate_step_chips; double d_carrier_doppler_hz; double d_carrier_dopplerrate_hz2; double d_carrier_phase_step_rad;