mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2024-12-15 04:30:33 +00:00
Update rem_carrier_phase and minor changes
This commit is contained in:
parent
2903e48e39
commit
25d04a94f2
@ -57,7 +57,7 @@ GpsL1CaDllPllTracking::GpsL1CaDllPllTracking(
|
||||
int fs_in_deprecated = configuration->property("GNSS-SDR.internal_fs_hz", 2048000);
|
||||
int fs_in = configuration->property("GNSS-SDR.internal_fs_sps", fs_in_deprecated);
|
||||
trk_param.fs_in = fs_in;
|
||||
trk_param.use_high_dynamics_resampler = configuration->property(role + ".high_dyn", false);
|
||||
trk_param.high_dyn = configuration->property(role + ".high_dyn", false);
|
||||
if (configuration->property(role + ".cp_smoother_length", 10) < 1)
|
||||
{
|
||||
trk_param.smoother_length = 1;
|
||||
|
@ -356,7 +356,7 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl
|
||||
{
|
||||
// Extra correlator for the data component
|
||||
correlator_data_cpu.init(2 * trk_parameters.vector_length, 1);
|
||||
correlator_data_cpu.set_high_dynamics_resampler(trk_parameters.use_high_dynamics_resampler);
|
||||
correlator_data_cpu.set_high_dynamics_resampler(trk_parameters.high_dyn);
|
||||
d_data_code = static_cast<float *>(volk_gnsssdr_malloc(2 * d_code_length_chips * sizeof(float), volk_gnsssdr_get_alignment()));
|
||||
}
|
||||
else
|
||||
@ -365,7 +365,7 @@ dll_pll_veml_tracking::dll_pll_veml_tracking(const Dll_Pll_Conf &conf_) : gr::bl
|
||||
}
|
||||
|
||||
// --- Initializations ---
|
||||
multicorrelator_cpu.set_high_dynamics_resampler(trk_parameters.use_high_dynamics_resampler);
|
||||
multicorrelator_cpu.set_high_dynamics_resampler(trk_parameters.high_dyn);
|
||||
// Initial code frequency basis of NCO
|
||||
d_code_freq_chips = d_code_chip_rate;
|
||||
// Residual code phase (in chips)
|
||||
@ -717,6 +717,7 @@ void dll_pll_veml_tracking::do_correlation_step(const gr_complex *input_samples)
|
||||
// ################# CARRIER WIPEOFF AND CORRELATORS ##############################
|
||||
// perform carrier wipe-off and compute Early, Prompt and Late correlation
|
||||
multicorrelator_cpu.set_input_output_vectors(d_correlator_outs, input_samples);
|
||||
float tmp_f = d_rem_carr_phase_rad;
|
||||
multicorrelator_cpu.Carrier_wipeoff_multicorrelator_resampler(
|
||||
d_rem_carr_phase_rad,
|
||||
d_carrier_phase_step_rad, d_carrier_phase_rate_step_rad,
|
||||
@ -730,7 +731,7 @@ void dll_pll_veml_tracking::do_correlation_step(const gr_complex *input_samples)
|
||||
{
|
||||
correlator_data_cpu.set_input_output_vectors(d_Prompt_Data, input_samples);
|
||||
correlator_data_cpu.Carrier_wipeoff_multicorrelator_resampler(
|
||||
d_rem_carr_phase_rad,
|
||||
tmp_f,
|
||||
d_carrier_phase_step_rad, d_carrier_phase_rate_step_rad,
|
||||
static_cast<float>(d_rem_code_phase_chips) * static_cast<float>(d_code_samples_per_chip),
|
||||
static_cast<float>(d_code_phase_step_chips) * static_cast<float>(d_code_samples_per_chip),
|
||||
@ -814,7 +815,7 @@ void dll_pll_veml_tracking::update_tracking_vars()
|
||||
cp_diff += d_carrier_phase_step_rad; // The new cp value is added to the previous in order to obtain the difference
|
||||
// carrier phase rate step (NCO phase increment rate per sample) [rads/sample^2]
|
||||
cp_diff /= static_cast<double>(d_current_prn_length_samples);
|
||||
if (trk_parameters.use_high_dynamics_resampler)
|
||||
if (trk_parameters.high_dyn)
|
||||
{
|
||||
d_cp_history.push_back(cp_diff);
|
||||
if (d_cp_history.full())
|
||||
@ -823,11 +824,14 @@ void dll_pll_veml_tracking::update_tracking_vars()
|
||||
}
|
||||
}
|
||||
|
||||
// Now the remnant carrier phase is computed in the Carrier Wipeoff function
|
||||
// remnant carrier phase to prevent overflow in the code NCO
|
||||
d_rem_carr_phase_rad += d_carrier_phase_step_rad * static_cast<double>(d_current_prn_length_samples);
|
||||
d_rem_carr_phase_rad = fmod(d_rem_carr_phase_rad, PI_2);
|
||||
//d_rem_carr_phase_rad += (d_carrier_phase_step_rad * static_cast<double>(d_current_prn_length_samples) + 0.5 * d_carrier_phase_rate_step_rad * static_cast<double>(d_current_prn_length_samples) * static_cast<double>(d_current_prn_length_samples));
|
||||
//d_rem_carr_phase_rad = fmod(d_rem_carr_phase_rad, PI_2);
|
||||
|
||||
|
||||
// carrier phase accumulator
|
||||
d_acc_carrier_phase_rad -= d_carrier_phase_step_rad * static_cast<double>(d_current_prn_length_samples);
|
||||
d_acc_carrier_phase_rad -= (d_carrier_phase_step_rad * static_cast<double>(d_current_prn_length_samples) + 0.5 * d_carrier_phase_rate_step_rad * static_cast<double>(d_current_prn_length_samples) * static_cast<double>(d_current_prn_length_samples));
|
||||
|
||||
//################### DLL COMMANDS #################################################
|
||||
// code phase step (Code resampler phase increment per sample) [chips/sample]
|
||||
@ -974,7 +978,7 @@ void dll_pll_veml_tracking::log_data(bool integrating)
|
||||
// carrier and code frequency
|
||||
tmp_float = d_carrier_doppler_hz;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));
|
||||
// carrier phase rate [Hz/s^2]
|
||||
// carrier phase rate [Hz/s]
|
||||
tmp_float = d_carrier_phase_rate_step_rad * trk_parameters.fs_in * trk_parameters.fs_in / PI_2;
|
||||
d_dump_file.write(reinterpret_cast<char *>(&tmp_float), sizeof(float));
|
||||
tmp_float = d_code_freq_chips;
|
||||
|
@ -151,7 +151,7 @@ private:
|
||||
boost::circular_buffer<double> d_cp_history;
|
||||
// remaining code phase and carrier phase between tracking loops
|
||||
double d_rem_code_phase_samples;
|
||||
double d_rem_carr_phase_rad;
|
||||
float d_rem_carr_phase_rad;
|
||||
|
||||
// PLL and DLL filter library
|
||||
Tracking_2nd_DLL_filter d_code_loop_filter;
|
||||
|
@ -127,7 +127,7 @@ void cpu_multicorrelator_real_codes::update_local_code(int correlator_length_sam
|
||||
|
||||
// Overload Carrier_wipeoff_multicorrelator_resampler to ensure back compatibility
|
||||
bool cpu_multicorrelator_real_codes::Carrier_wipeoff_multicorrelator_resampler(
|
||||
float rem_carrier_phase_in_rad,
|
||||
float& rem_carrier_phase_in_rad,
|
||||
float phase_step_rad,
|
||||
float phase_rate_step_rad,
|
||||
float rem_code_phase_chips,
|
||||
@ -148,6 +148,7 @@ bool cpu_multicorrelator_real_codes::Carrier_wipeoff_multicorrelator_resampler(
|
||||
{
|
||||
volk_gnsssdr_32fc_32f_rotator_dot_prod_32fc_xn(d_corr_out, d_sig_in, std::exp(lv_32fc_t(0.0, -phase_step_rad)), phase_offset_as_complex, const_cast<const float**>(d_local_codes_resampled), d_n_correlators, signal_length_samples);
|
||||
}
|
||||
rem_carrier_phase_in_rad = std::arg(std::conj(phase_offset_as_complex[0]));
|
||||
return true;
|
||||
}
|
||||
// Overload Carrier_wipeoff_multicorrelator_resampler to ensure back compatibility
|
||||
|
@ -53,7 +53,7 @@ public:
|
||||
bool set_input_output_vectors(std::complex<float> *corr_out, const std::complex<float> *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);
|
||||
// Overload Carrier_wipeoff_multicorrelator_resampler to ensure back compatibility
|
||||
bool Carrier_wipeoff_multicorrelator_resampler(float rem_carrier_phase_in_rad, float phase_step_rad, float phase_rate_step_rad, float rem_code_phase_chips, float code_phase_step_chips, float code_phase_rate_step_chips, int signal_length_samples);
|
||||
bool Carrier_wipeoff_multicorrelator_resampler(float &rem_carrier_phase_in_rad, float phase_step_rad, float phase_rate_step_rad, float rem_code_phase_chips, float code_phase_step_chips, float code_phase_rate_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();
|
||||
|
||||
|
@ -36,7 +36,7 @@
|
||||
Dll_Pll_Conf::Dll_Pll_Conf()
|
||||
{
|
||||
/* DLL/PLL tracking configuration */
|
||||
use_high_dynamics_resampler = true;
|
||||
high_dyn = true;
|
||||
smoother_length = 10;
|
||||
fs_in = 0.0;
|
||||
vector_length = 0U;
|
||||
|
@ -56,7 +56,7 @@ public:
|
||||
float early_late_space_narrow_chips;
|
||||
float very_early_late_space_narrow_chips;
|
||||
int32_t extend_correlation_symbols;
|
||||
bool use_high_dynamics_resampler;
|
||||
bool high_dyn;
|
||||
int32_t cn0_samples;
|
||||
int32_t carrier_lock_det_mav_samples;
|
||||
int32_t cn0_min;
|
||||
|
@ -45,6 +45,7 @@ bool tracking_dump_reader::read_binary_obs()
|
||||
d_dump_file.read(reinterpret_cast<char *>(&PRN_start_sample_count), sizeof(uint64_t));
|
||||
d_dump_file.read(reinterpret_cast<char *>(&acc_carrier_phase_rad), sizeof(float));
|
||||
d_dump_file.read(reinterpret_cast<char *>(&carrier_doppler_hz), sizeof(float));
|
||||
d_dump_file.read(reinterpret_cast<char *>(&carrier_doppler_rate_hz_s), sizeof(float));
|
||||
d_dump_file.read(reinterpret_cast<char *>(&code_freq_chips), sizeof(float));
|
||||
d_dump_file.read(reinterpret_cast<char *>(&carr_error_hz), sizeof(float));
|
||||
d_dump_file.read(reinterpret_cast<char *>(&carr_error_filt_hz), sizeof(float));
|
||||
@ -83,7 +84,7 @@ int64_t tracking_dump_reader::num_epochs()
|
||||
{
|
||||
std::ifstream::pos_type size;
|
||||
int number_of_double_vars = 1;
|
||||
int number_of_float_vars = 17;
|
||||
int number_of_float_vars = 18;
|
||||
int epoch_size_bytes = sizeof(uint64_t) + sizeof(double) * number_of_double_vars +
|
||||
sizeof(float) * number_of_float_vars + sizeof(unsigned int);
|
||||
std::ifstream tmpfile(d_dump_filename.c_str(), std::ios::binary | std::ios::ate);
|
||||
|
@ -63,6 +63,7 @@ public:
|
||||
|
||||
// carrier and code frequency
|
||||
float carrier_doppler_hz;
|
||||
float carrier_doppler_rate_hz_s;
|
||||
float code_freq_chips;
|
||||
|
||||
// PLL commands
|
||||
|
Loading…
Reference in New Issue
Block a user