diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.cc index 7fd44114f..2da107fe2 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.cc @@ -78,6 +78,7 @@ pcps_acquisition_cc::pcps_acquisition_cc( d_active = false; d_state = 0; d_freq = freq; + d_old_freq = freq; d_fs_in = fs_in; d_samples_per_ms = samples_per_ms; d_samples_per_code = samples_per_code; @@ -160,6 +161,8 @@ pcps_acquisition_cc::~pcps_acquisition_cc() void pcps_acquisition_cc::set_local_code(std::complex * code) { + // reset the intermediate frequency + d_freq = d_old_freq; // This will check if it's fdma, if yes will update the intermediate frequency and the doppler grid if( is_fdma() ) { @@ -185,6 +188,7 @@ void pcps_acquisition_cc::set_local_code(std::complex * code) volk_32fc_conjugate_32fc(d_fft_codes, d_fft_if->get_outbuf(), d_fft_size); } + bool pcps_acquisition_cc::is_fdma() { // Dealing with FDMA system diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.h index 8755eddff..1769aeffb 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.h @@ -102,6 +102,7 @@ private: void send_positive_acquisition(); long d_fs_in; long d_freq; + long d_old_freq; int d_samples_per_ms; int d_samples_per_code; //unsigned int d_doppler_resolution; diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_sc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_sc.cc index 41f4fe24f..c7f287f22 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_sc.cc +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_sc.cc @@ -76,6 +76,7 @@ pcps_acquisition_sc::pcps_acquisition_sc( d_active = false; d_state = 0; d_freq = freq; + d_old_freq = freq; d_fs_in = fs_in; d_samples_per_ms = samples_per_ms; d_samples_per_code = samples_per_code; @@ -161,6 +162,8 @@ pcps_acquisition_sc::~pcps_acquisition_sc() void pcps_acquisition_sc::set_local_code(std::complex * code) { + // reset the intermediate frequency + d_freq = d_old_freq; // This will check if it's fdma, if yes will update the intermediate frequency and the doppler grid if( is_fdma() ) { diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_sc.h b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_sc.h index 10d5aefa4..3b2aeccda 100644 --- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_sc.h +++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_sc.h @@ -102,6 +102,7 @@ private: long d_fs_in; long d_freq; + long d_old_freq; int d_samples_per_ms; int d_samples_per_code; //unsigned int d_doppler_resolution;