1
0
mirror of https://github.com/gnss-sdr/gnss-sdr synced 2025-09-12 07:46:03 +00:00

Fixes for pcps acquisition when using double block

This commit is contained in:
Cillian O'Driscoll
2015-12-23 18:51:30 +00:00
parent a1188d37b7
commit baf3f9b8c6
2 changed files with 5 additions and 4 deletions

View File

@@ -291,10 +291,11 @@ float GalileoE1PcpsAmbiguousAcquisition::calculate_threshold(float pfa)
DLOG(INFO) <<"Channel "<<channel_<<" Pfa = "<< pfa;
unsigned int ncells = vector_length_ * frequency_bins;
int effective_vector_length = ( bit_transition_flag_ ? vector_length_ / 2 : vector_length_ );
unsigned int ncells = effective_vector_length * frequency_bins;
double exponent = 1 / static_cast<double>(ncells);
double val = pow(1.0 - pfa,exponent);
double lambda = double(vector_length_);
double lambda = double(effective_vector_length);
boost::math::exponential_distribution<double> mydist (lambda);
float threshold = (float)quantile(mydist,val);

View File

@@ -310,12 +310,12 @@ int pcps_acquisition_cc::general_work(int noutput_items,
d_ifft->execute();
// Search maximum
size_t offset = ( d_bit_transition_flag ? effective_fft_size : 0 );
volk_32fc_magnitude_squared_32f(d_magnitude, d_ifft->get_outbuf() + offset, effective_fft_size);
volk_32f_index_max_16u(&indext, d_magnitude, effective_fft_size);
// Normalize the maximum value to correct the scale factor introduced by FFTW
magt = d_magnitude[indext] / (fft_normalization_factor * fft_normalization_factor);
magt = d_magnitude[indext] / (static_cast<float>( effective_fft_size ) *
static_cast< float >( effective_fft_size ) * fft_normalization_factor);
// 4- record the maximum peak and the associated synchronization parameters
if (d_mag < magt)