mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-05-28 20:24:10 +00:00
minor cleaning
This commit is contained in:
parent
a10ca1a840
commit
4d072833c5
@ -87,7 +87,7 @@ pcps_acquisition_cc::pcps_acquisition_cc(
|
||||
d_input_power = 0.0;
|
||||
d_num_doppler_bins = 0;
|
||||
d_bit_transition_flag = bit_transition_flag;
|
||||
d_use_CFAR_algorithm_flag=use_CFAR_algorithm_flag;
|
||||
d_use_CFAR_algorithm_flag = use_CFAR_algorithm_flag;
|
||||
d_threshold = 0.0;
|
||||
d_doppler_step = 250;
|
||||
d_code_phase = 0;
|
||||
@ -131,6 +131,7 @@ pcps_acquisition_cc::pcps_acquisition_cc(
|
||||
d_grid_doppler_wipeoffs = 0;
|
||||
}
|
||||
|
||||
|
||||
pcps_acquisition_cc::~pcps_acquisition_cc()
|
||||
{
|
||||
if (d_num_doppler_bins > 0)
|
||||
@ -154,6 +155,7 @@ pcps_acquisition_cc::~pcps_acquisition_cc()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void pcps_acquisition_cc::set_local_code(std::complex<float> * code)
|
||||
{
|
||||
// COD
|
||||
@ -171,6 +173,7 @@ void pcps_acquisition_cc::set_local_code(std::complex<float> * code)
|
||||
volk_32fc_conjugate_32fc(d_fft_codes, d_fft_if->get_outbuf(), d_fft_size);
|
||||
}
|
||||
|
||||
|
||||
void pcps_acquisition_cc::update_local_carrier(gr_complex* carrier_vector, int correlator_length_samples, float freq)
|
||||
{
|
||||
float phase_step_rad = GPS_TWO_PI * freq / static_cast<float>(d_fs_in);
|
||||
@ -179,6 +182,7 @@ void pcps_acquisition_cc::update_local_carrier(gr_complex* carrier_vector, int c
|
||||
volk_gnsssdr_s32f_sincos_32fc(carrier_vector, - phase_step_rad, _phase, correlator_length_samples);
|
||||
}
|
||||
|
||||
|
||||
void pcps_acquisition_cc::init()
|
||||
{
|
||||
d_gnss_synchro->Flag_valid_acquisition = false;
|
||||
@ -207,9 +211,8 @@ void pcps_acquisition_cc::init()
|
||||
}
|
||||
|
||||
|
||||
|
||||
void pcps_acquisition_cc::set_state(int state)
|
||||
{
|
||||
{
|
||||
d_state = state;
|
||||
if (d_state == 1)
|
||||
{
|
||||
@ -227,7 +230,8 @@ void pcps_acquisition_cc::set_state(int state)
|
||||
{
|
||||
LOG(ERROR) << "State can only be set to 0 or 1";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int pcps_acquisition_cc::general_work(int noutput_items,
|
||||
gr_vector_int &ninput_items, gr_vector_const_void_star &input_items,
|
||||
@ -292,12 +296,12 @@ int pcps_acquisition_cc::general_work(int noutput_items,
|
||||
d_well_count++;
|
||||
|
||||
DLOG(INFO) << "Channel: " << d_channel
|
||||
<< " , doing acquisition of satellite: " << d_gnss_synchro->System << " "<< d_gnss_synchro->PRN
|
||||
<< " , doing acquisition of satellite: " << d_gnss_synchro->System << " " << d_gnss_synchro->PRN
|
||||
<< " ,sample stamp: " << d_sample_counter << ", threshold: "
|
||||
<< d_threshold << ", doppler_max: " << d_doppler_max
|
||||
<< ", doppler_step: " << d_doppler_step;
|
||||
|
||||
if (d_use_CFAR_algorithm_flag==true)
|
||||
if (d_use_CFAR_algorithm_flag == true)
|
||||
{
|
||||
// 1- (optional) Compute the input signal power estimation
|
||||
volk_32fc_magnitude_squared_32f(d_magnitude, in, d_fft_size);
|
||||
@ -305,10 +309,9 @@ int pcps_acquisition_cc::general_work(int noutput_items,
|
||||
d_input_power /= static_cast<float>(d_fft_size);
|
||||
}
|
||||
// 2- Doppler frequency search loop
|
||||
for (unsigned int doppler_index=0; doppler_index < d_num_doppler_bins; doppler_index++)
|
||||
for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++)
|
||||
{
|
||||
// doppler search steps
|
||||
|
||||
doppler = -static_cast<int>(d_doppler_max) + d_doppler_step * doppler_index;
|
||||
|
||||
volk_32fc_x2_multiply_32fc(d_fft_if->get_inbuf(), in,
|
||||
@ -332,7 +335,7 @@ int pcps_acquisition_cc::general_work(int noutput_items,
|
||||
volk_32f_index_max_16u(&indext, d_magnitude, effective_fft_size);
|
||||
magt = d_magnitude[indext];
|
||||
|
||||
if (d_use_CFAR_algorithm_flag==true)
|
||||
if (d_use_CFAR_algorithm_flag == true)
|
||||
{
|
||||
// Normalize the maximum value to correct the scale factor introduced by FFTW
|
||||
magt = d_magnitude[indext] / (fft_normalization_factor * fft_normalization_factor);
|
||||
@ -342,11 +345,11 @@ int pcps_acquisition_cc::general_work(int noutput_items,
|
||||
{
|
||||
d_mag = magt;
|
||||
|
||||
if (d_use_CFAR_algorithm_flag==false)
|
||||
if (d_use_CFAR_algorithm_flag == false)
|
||||
{
|
||||
// Search grid noise floor approximation for this doppler line
|
||||
volk_32f_accumulator_s32f(&d_input_power, d_magnitude, effective_fft_size);
|
||||
d_input_power=(d_input_power-d_mag)/(effective_fft_size-1);
|
||||
d_input_power = (d_input_power - d_mag) / (effective_fft_size - 1);
|
||||
}
|
||||
|
||||
// In case that d_bit_transition_flag = true, we compare the potentially
|
||||
|
@ -86,7 +86,7 @@ pcps_acquisition_sc::pcps_acquisition_sc(
|
||||
d_input_power = 0.0;
|
||||
d_num_doppler_bins = 0;
|
||||
d_bit_transition_flag = bit_transition_flag;
|
||||
d_use_CFAR_algorithm_flag=use_CFAR_algorithm_flag;
|
||||
d_use_CFAR_algorithm_flag = use_CFAR_algorithm_flag;
|
||||
d_threshold = 0.0;
|
||||
d_doppler_step = 250;
|
||||
d_code_phase = 0;
|
||||
@ -132,6 +132,7 @@ pcps_acquisition_sc::pcps_acquisition_sc(
|
||||
d_grid_doppler_wipeoffs = 0;
|
||||
}
|
||||
|
||||
|
||||
pcps_acquisition_sc::~pcps_acquisition_sc()
|
||||
{
|
||||
if (d_num_doppler_bins > 0)
|
||||
@ -156,6 +157,7 @@ pcps_acquisition_sc::~pcps_acquisition_sc()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void pcps_acquisition_sc::set_local_code(std::complex<float> * code)
|
||||
{
|
||||
// COD
|
||||
@ -173,6 +175,7 @@ void pcps_acquisition_sc::set_local_code(std::complex<float> * code)
|
||||
volk_32fc_conjugate_32fc(d_fft_codes, d_fft_if->get_outbuf(), d_fft_size);
|
||||
}
|
||||
|
||||
|
||||
void pcps_acquisition_sc::update_local_carrier(gr_complex* carrier_vector, int correlator_length_samples, float freq)
|
||||
{
|
||||
float phase_step_rad = GPS_TWO_PI * freq / static_cast<float>(d_fs_in);
|
||||
@ -181,6 +184,7 @@ void pcps_acquisition_sc::update_local_carrier(gr_complex* carrier_vector, int c
|
||||
volk_gnsssdr_s32f_sincos_32fc(carrier_vector, - phase_step_rad, _phase, correlator_length_samples);
|
||||
}
|
||||
|
||||
|
||||
void pcps_acquisition_sc::init()
|
||||
{
|
||||
d_gnss_synchro->Flag_valid_acquisition = false;
|
||||
@ -211,7 +215,7 @@ void pcps_acquisition_sc::init()
|
||||
|
||||
|
||||
void pcps_acquisition_sc::set_state(int state)
|
||||
{
|
||||
{
|
||||
d_state = state;
|
||||
if (d_state == 1)
|
||||
{
|
||||
@ -229,7 +233,7 @@ void pcps_acquisition_sc::set_state(int state)
|
||||
{
|
||||
LOG(ERROR) << "State can only be set to 0 or 1";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int pcps_acquisition_sc::general_work(int noutput_items,
|
||||
gr_vector_int &ninput_items, gr_vector_const_void_star &input_items,
|
||||
@ -299,7 +303,7 @@ int pcps_acquisition_sc::general_work(int noutput_items,
|
||||
<< d_threshold << ", doppler_max: " << d_doppler_max
|
||||
<< ", doppler_step: " << d_doppler_step;
|
||||
|
||||
if (d_use_CFAR_algorithm_flag==true)
|
||||
if (d_use_CFAR_algorithm_flag == true)
|
||||
{
|
||||
// 1- (optional) Compute the input signal power estimation
|
||||
volk_32fc_magnitude_squared_32f(d_magnitude, d_in_32fc, d_fft_size);
|
||||
@ -307,7 +311,7 @@ int pcps_acquisition_sc::general_work(int noutput_items,
|
||||
d_input_power /= static_cast<float>(d_fft_size);
|
||||
}
|
||||
// 2- Doppler frequency search loop
|
||||
for (unsigned int doppler_index=0; doppler_index < d_num_doppler_bins; doppler_index++)
|
||||
for (unsigned int doppler_index = 0; doppler_index < d_num_doppler_bins; doppler_index++)
|
||||
{
|
||||
// doppler search steps
|
||||
|
||||
@ -334,23 +338,22 @@ int pcps_acquisition_sc::general_work(int noutput_items,
|
||||
volk_32f_index_max_16u(&indext, d_magnitude, effective_fft_size);
|
||||
magt = d_magnitude[indext];
|
||||
|
||||
if (d_use_CFAR_algorithm_flag==true)
|
||||
if (d_use_CFAR_algorithm_flag == true)
|
||||
{
|
||||
// Normalize the maximum value to correct the scale factor introduced by FFTW
|
||||
magt = d_magnitude[indext] / (fft_normalization_factor * fft_normalization_factor);
|
||||
}
|
||||
|
||||
|
||||
// 4- record the maximum peak and the associated synchronization parameters
|
||||
if (d_mag < magt)
|
||||
{
|
||||
d_mag = magt;
|
||||
|
||||
if (d_use_CFAR_algorithm_flag==false)
|
||||
if (d_use_CFAR_algorithm_flag == false)
|
||||
{
|
||||
// Search grid noise floor approximation for this doppler line
|
||||
volk_32f_accumulator_s32f(&d_input_power, d_magnitude, effective_fft_size);
|
||||
d_input_power=(d_input_power-d_mag)/(effective_fft_size-1);
|
||||
d_input_power = (d_input_power - d_mag) / (effective_fft_size - 1);
|
||||
}
|
||||
|
||||
// In case that d_bit_transition_flag = true, we compare the potentially
|
||||
|
Loading…
x
Reference in New Issue
Block a user