From 4b670c5eca373d79aa0582f1c86b4aa76e9628e5 Mon Sep 17 00:00:00 2001 From: Marc Majoral Date: Fri, 28 Feb 2025 15:15:13 +0100 Subject: [PATCH] Fix handling of zero padding option when disabled. --- ...ileo_e1_pcps_ambiguous_acquisition_fpga.cc | 24 +++++++------- .../galileo_e5a_pcps_acquisition_fpga.cc | 24 +++++++------- .../galileo_e5b_pcps_acquisition_fpga.cc | 24 +++++++------- .../gps_l1_ca_pcps_acquisition_fpga.cc | 25 +++++++-------- .../gps_l2_m_pcps_acquisition_fpga.cc | 32 ++++++++----------- .../adapters/gps_l5i_pcps_acquisition_fpga.cc | 25 +++++++-------- 6 files changed, 74 insertions(+), 80 deletions(-) diff --git a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc index 94f4c6367..12c0426f8 100644 --- a/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/galileo_e1_pcps_ambiguous_acquisition_fpga.cc @@ -104,7 +104,7 @@ void GalileoE1PcpsAmbiguousAcquisitionFpga::generate_galileo_e1_prn_codes() // a channel is assigned) auto fft_if = gnss_fft_fwd_make_unique(nsamples_total); // Direct FFT volk_gnsssdr::vector> code(nsamples_total); // buffer for the local code - volk_gnsssdr::vector fft_codes_padded(nsamples_total); + volk_gnsssdr::vector fft_code(nsamples_total); d_all_fft_codes_ = volk_gnsssdr::vector(nsamples_total * GALILEO_E1_NUMBER_OF_CODES); // memory containing all the possible fft codes for PRN 0 to 32 float max; @@ -134,34 +134,34 @@ void GalileoE1PcpsAmbiguousAcquisitionFpga::generate_galileo_e1_prn_codes() { // Duplicate the code sequence std::copy(code.begin(), code.begin() + code_length, code.begin() + code_length); + // Fill in zero padding for the rest + std::fill(code.begin() + (acq_parameters_.enable_zero_padding ? 2 * code_length : code_length), code.end(), std::complex(0.0, 0.0)); } - // Fill in zero padding for the rest - std::fill(code.begin() + (acq_parameters_.enable_zero_padding ? 2 * code_length : code_length), code.end(), std::complex(0.0, 0.0)); - std::copy_n(code.data(), nsamples_total, fft_if->get_inbuf()); // copy to FFT buffer - fft_if->execute(); // Run the FFT of local code - volk_32fc_conjugate_32fc(fft_codes_padded.data(), fft_if->get_outbuf(), nsamples_total); // conjugate values + std::copy_n(code.data(), nsamples_total, fft_if->get_inbuf()); // copy to FFT buffer + fft_if->execute(); // Run the FFT of local code + volk_32fc_conjugate_32fc(fft_code.data(), fft_if->get_outbuf(), nsamples_total); // conjugate values // normalize the code max = 0; // initialize maximum value for (uint32_t i = 0; i < nsamples_total; i++) // search for maxima { - if (std::abs(fft_codes_padded[i].real()) > max) + if (std::abs(fft_code[i].real()) > max) { - max = std::abs(fft_codes_padded[i].real()); + max = std::abs(fft_code[i].real()); } - if (std::abs(fft_codes_padded[i].imag()) > max) + if (std::abs(fft_code[i].imag()) > max) { - max = std::abs(fft_codes_padded[i].imag()); + max = std::abs(fft_code[i].imag()); } } // map the FFT to the dynamic range of the fixed point values an copy to buffer containing all FFTs // and package codes in a format that is ready to be written to the FPGA for (uint32_t i = 0; i < nsamples_total; i++) { - tmp = static_cast(floor(fft_codes_padded[i].real() * (pow(2, QUANT_BITS_LOCAL_CODE - 1) - 1) / max)); - tmp2 = static_cast(floor(fft_codes_padded[i].imag() * (pow(2, QUANT_BITS_LOCAL_CODE - 1) - 1) / max)); + tmp = static_cast(floor(fft_code[i].real() * (pow(2, QUANT_BITS_LOCAL_CODE - 1) - 1) / max)); + tmp2 = static_cast(floor(fft_code[i].imag() * (pow(2, QUANT_BITS_LOCAL_CODE - 1) - 1) / max)); local_code = (tmp & SELECT_LSBITS) | ((tmp2 * SHL_CODE_BITS) & SELECT_MSBITS); // put together the real part and the imaginary part fft_data = local_code & SELECT_ALL_CODE_BITS; d_all_fft_codes_[i + (nsamples_total * (PRN - 1))] = fft_data; diff --git a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc index 54d5d4f5c..c43787c84 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5a_pcps_acquisition_fpga.cc @@ -103,7 +103,7 @@ void GalileoE5aPcpsAcquisitionFpga::generate_galileo_e5a_prn_codes() // a channel is assigned) auto fft_if = gnss_fft_fwd_make_unique(nsamples_total); // Direct FFT volk_gnsssdr::vector> code(nsamples_total); - volk_gnsssdr::vector> fft_codes_padded(nsamples_total); + volk_gnsssdr::vector> fft_code(nsamples_total); d_all_fft_codes_ = volk_gnsssdr::vector(nsamples_total * GALILEO_E5A_NUMBER_OF_CODES); // memory containing all the possible fft codes for PRN 0 to 32 if (acq_iq_) @@ -142,33 +142,33 @@ void GalileoE5aPcpsAcquisitionFpga::generate_galileo_e5a_prn_codes() { // Duplicate the code sequence std::copy(code.begin(), code.begin() + code_length, code.begin() + code_length); + // Fill in zero padding for the rest + std::fill(code.begin() + (acq_parameters_.enable_zero_padding ? 2 * code_length : code_length), code.end(), std::complex(0.0, 0.0)); } - // Fill in zero padding for the rest - std::fill(code.begin() + (acq_parameters_.enable_zero_padding ? 2 * code_length : code_length), code.end(), std::complex(0.0, 0.0)); - std::copy_n(code.data(), nsamples_total, fft_if->get_inbuf()); // copy to FFT buffer - fft_if->execute(); // Run the FFT of local code - volk_32fc_conjugate_32fc(fft_codes_padded.data(), fft_if->get_outbuf(), nsamples_total); // conjugate values + std::copy_n(code.data(), nsamples_total, fft_if->get_inbuf()); // copy to FFT buffer + fft_if->execute(); // Run the FFT of local code + volk_32fc_conjugate_32fc(fft_code.data(), fft_if->get_outbuf(), nsamples_total); // conjugate values max = 0; // initialize maximum value for (uint32_t i = 0; i < nsamples_total; i++) // search for maxima { - if (std::abs(fft_codes_padded[i].real()) > max) + if (std::abs(fft_code[i].real()) > max) { - max = std::abs(fft_codes_padded[i].real()); + max = std::abs(fft_code[i].real()); } - if (std::abs(fft_codes_padded[i].imag()) > max) + if (std::abs(fft_code[i].imag()) > max) { - max = std::abs(fft_codes_padded[i].imag()); + max = std::abs(fft_code[i].imag()); } } // map the FFT to the dynamic range of the fixed point values an copy to buffer containing all FFTs // and package codes in a format that is ready to be written to the FPGA for (uint32_t i = 0; i < nsamples_total; i++) { - tmp = static_cast(floor(fft_codes_padded[i].real() * (pow(2, QUANT_BITS_LOCAL_CODE - 1) - 1) / max)); - tmp2 = static_cast(floor(fft_codes_padded[i].imag() * (pow(2, QUANT_BITS_LOCAL_CODE - 1) - 1) / max)); + tmp = static_cast(floor(fft_code[i].real() * (pow(2, QUANT_BITS_LOCAL_CODE - 1) - 1) / max)); + tmp2 = static_cast(floor(fft_code[i].imag() * (pow(2, QUANT_BITS_LOCAL_CODE - 1) - 1) / max)); local_code = (tmp & SELECT_LSBITS) | ((tmp2 * SHL_CODE_BITS) & SELECT_MSBITS); // put together the real part and the imaginary part fft_data = local_code & SELECT_ALL_CODE_BITS; d_all_fft_codes_[i + (nsamples_total * (PRN - 1))] = fft_data; diff --git a/src/algorithms/acquisition/adapters/galileo_e5b_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/galileo_e5b_pcps_acquisition_fpga.cc index e099ec320..b83eb623c 100644 --- a/src/algorithms/acquisition/adapters/galileo_e5b_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/galileo_e5b_pcps_acquisition_fpga.cc @@ -103,7 +103,7 @@ void GalileoE5bPcpsAcquisitionFpga::generate_galileo_e5b_prn_codes() // a channel is assigned) auto fft_if = gnss_fft_fwd_make_unique(nsamples_total); // Direct FFT volk_gnsssdr::vector> code(nsamples_total); // Buffer for local code - volk_gnsssdr::vector> fft_codes_padded(nsamples_total); + volk_gnsssdr::vector> fft_code(nsamples_total); d_all_fft_codes_ = volk_gnsssdr::vector(nsamples_total * GALILEO_E5B_NUMBER_OF_CODES); // memory containing all the possible fft codes for PRN 0 to 32 if (acq_iq_) @@ -142,33 +142,33 @@ void GalileoE5bPcpsAcquisitionFpga::generate_galileo_e5b_prn_codes() { // Duplicate the code sequence std::copy(code.begin(), code.begin() + code_length, code.begin() + code_length); + // Fill in zero padding for the rest + std::fill(code.begin() + (acq_parameters_.enable_zero_padding ? 2 * code_length : code_length), code.end(), std::complex(0.0, 0.0)); } - // Fill in zero padding for the rest - std::fill(code.begin() + (acq_parameters_.enable_zero_padding ? 2 * code_length : code_length), code.end(), std::complex(0.0, 0.0)); - std::copy_n(code.data(), nsamples_total, fft_if->get_inbuf()); // copy to FFT buffer - fft_if->execute(); // Run the FFT of local code - volk_32fc_conjugate_32fc(fft_codes_padded.data(), fft_if->get_outbuf(), nsamples_total); // conjugate values + std::copy_n(code.data(), nsamples_total, fft_if->get_inbuf()); // copy to FFT buffer + fft_if->execute(); // Run the FFT of local code + volk_32fc_conjugate_32fc(fft_code.data(), fft_if->get_outbuf(), nsamples_total); // conjugate values max = 0; // initialize maximum value for (uint32_t i = 0; i < nsamples_total; i++) // search for maxima { - if (std::abs(fft_codes_padded[i].real()) > max) + if (std::abs(fft_code[i].real()) > max) { - max = std::abs(fft_codes_padded[i].real()); + max = std::abs(fft_code[i].real()); } - if (std::abs(fft_codes_padded[i].imag()) > max) + if (std::abs(fft_code[i].imag()) > max) { - max = std::abs(fft_codes_padded[i].imag()); + max = std::abs(fft_code[i].imag()); } } // map the FFT to the dynamic range of the fixed point values an copy to buffer containing all FFTs // and package codes in a format that is ready to be written to the FPGA for (uint32_t i = 0; i < nsamples_total; i++) { - tmp = static_cast(floor(fft_codes_padded[i].real() * (pow(2, QUANT_BITS_LOCAL_CODE - 1) - 1) / max)); - tmp2 = static_cast(floor(fft_codes_padded[i].imag() * (pow(2, QUANT_BITS_LOCAL_CODE - 1) - 1) / max)); + tmp = static_cast(floor(fft_code[i].real() * (pow(2, QUANT_BITS_LOCAL_CODE - 1) - 1) / max)); + tmp2 = static_cast(floor(fft_code[i].imag() * (pow(2, QUANT_BITS_LOCAL_CODE - 1) - 1) / max)); local_code = (tmp & SELECT_LSBITS) | ((tmp2 * SHL_CODE_BITS) & SELECT_MSBITS); // put together the real part and the imaginary part fft_data = local_code & SELECT_ALL_CODE_BITS; d_all_fft_codes_[i + (nsamples_total * (PRN - 1))] = fft_data; diff --git a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc index 7c8a24cd0..226078036 100644 --- a/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l1_ca_pcps_acquisition_fpga.cc @@ -104,7 +104,7 @@ void GpsL1CaPcpsAcquisitionFpga::generate_gps_l1_ca_prn_codes() auto fft_if = gnss_fft_fwd_make_unique(nsamples_total); // allocate memory to compute all the PRNs and compute all the possible codes volk_gnsssdr::vector> code(nsamples_total); - volk_gnsssdr::vector> fft_codes_padded(nsamples_total); + volk_gnsssdr::vector> fft_code(nsamples_total); d_all_fft_codes_ = volk_gnsssdr::vector(nsamples_total * NUM_PRNs); // memory containing all the possible fft codes for PRN 0 to 32 float max; int32_t tmp; @@ -120,33 +120,32 @@ void GpsL1CaPcpsAcquisitionFpga::generate_gps_l1_ca_prn_codes() { // Duplicate the code sequence std::copy(code.begin(), code.begin() + code_length, code.begin() + code_length); + // Fill in zero padding for the rest + std::fill(code.begin() + (acq_parameters_.enable_zero_padding ? 2 * code_length : code_length), code.end(), std::complex(0.0, 0.0)); } - // Fill in zero padding for the rest - std::fill(code.begin() + (acq_parameters_.enable_zero_padding ? 2 * code_length : code_length), code.end(), std::complex(0.0, 0.0)); - - std::copy_n(code.data(), nsamples_total, fft_if->get_inbuf()); // copy to FFT buffer - fft_if->execute(); // Run the FFT of local code - volk_32fc_conjugate_32fc(fft_codes_padded.data(), fft_if->get_outbuf(), nsamples_total); // conjugate values + std::copy_n(code.data(), nsamples_total, fft_if->get_inbuf()); // copy to FFT buffer + fft_if->execute(); // Run the FFT of local code + volk_32fc_conjugate_32fc(fft_code.data(), fft_if->get_outbuf(), nsamples_total); // conjugate values max = 0; // initialize maximum value for (uint32_t i = 0; i < nsamples_total; i++) // search for maxima { - if (std::abs(fft_codes_padded[i].real()) > max) + if (std::abs(fft_code[i].real()) > max) { - max = std::abs(fft_codes_padded[i].real()); + max = std::abs(fft_code[i].real()); } - if (std::abs(fft_codes_padded[i].imag()) > max) + if (std::abs(fft_code[i].imag()) > max) { - max = std::abs(fft_codes_padded[i].imag()); + max = std::abs(fft_code[i].imag()); } } // map the FFT to the dynamic range of the fixed point values an copy to buffer containing all FFTs // and package codes in a format that is ready to be written to the FPGA for (uint32_t i = 0; i < nsamples_total; i++) { - tmp = static_cast(floor(fft_codes_padded[i].real() * (pow(2, QUANT_BITS_LOCAL_CODE - 1) - 1) / max)); - tmp2 = static_cast(floor(fft_codes_padded[i].imag() * (pow(2, QUANT_BITS_LOCAL_CODE - 1) - 1) / max)); + tmp = static_cast(floor(fft_code[i].real() * (pow(2, QUANT_BITS_LOCAL_CODE - 1) - 1) / max)); + tmp2 = static_cast(floor(fft_code[i].imag() * (pow(2, QUANT_BITS_LOCAL_CODE - 1) - 1) / max)); local_code = (tmp & SELECT_LSBITS) | ((tmp2 * SHL_CODE_BITS) & SELECT_MSBITS); // put together the real part and the imaginary part fft_data = local_code & SELECT_ALL_CODE_BITS; d_all_fft_codes_[i + (nsamples_total * (PRN - 1))] = fft_data; diff --git a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc index d59f984bc..91c90db90 100644 --- a/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l2_m_pcps_acquisition_fpga.cc @@ -104,7 +104,7 @@ void GpsL2MPcpsAcquisitionFpga::generate_gps_l2c_m_prn_codes() auto fft_if = gnss_fft_fwd_make_unique(nsamples_total); // Direct FFT // allocate memory to compute all the PRNs and compute all the possible codes volk_gnsssdr::vector> code(nsamples_total); - volk_gnsssdr::vector> fft_codes_padded(nsamples_total); + volk_gnsssdr::vector> fft_codes(nsamples_total); d_all_fft_codes_ = volk_gnsssdr::vector(nsamples_total * NUM_PRNs); // memory containing all the possible fft codes for PRN 0 to 32 float max; @@ -121,38 +121,34 @@ void GpsL2MPcpsAcquisitionFpga::generate_gps_l2c_m_prn_codes() { // Duplicate the code sequence std::copy(code.begin(), code.begin() + code_length, code.begin() + code_length); + // Fill in zero padding for the rest + std::fill(code.begin() + (acq_parameters_.enable_zero_padding ? 2 * code_length : code_length), code.end(), std::complex(0.0, 0.0)); } - // Fill in zero padding for the rest - std::fill(code.begin() + (acq_parameters_.enable_zero_padding ? 2 * code_length : code_length), code.end(), std::complex(0.0, 0.0)); - - std::copy_n(code.data(), nsamples_total, fft_if->get_inbuf()); // copy to FFT buffer - fft_if->execute(); // Run the FFT of local code - volk_32fc_conjugate_32fc(fft_codes_padded.data(), fft_if->get_outbuf(), nsamples_total); // conjugate values - max = 0; // initialize maximum value - for (unsigned int i = 0; i < nsamples_total; i++) // search for maxima + std::copy_n(code.data(), nsamples_total, fft_if->get_inbuf()); // copy to FFT buffer + fft_if->execute(); // Run the FFT of local code + volk_32fc_conjugate_32fc(fft_codes.data(), fft_if->get_outbuf(), nsamples_total); // conjugate values + max = 0; // initialize maximum value + for (unsigned int i = 0; i < nsamples_total; i++) // search for maxima { - if (std::abs(fft_codes_padded[i].real()) > max) + if (std::abs(fft_codes[i].real()) > max) { - max = std::abs(fft_codes_padded[i].real()); + max = std::abs(fft_codes[i].real()); } - if (std::abs(fft_codes_padded[i].imag()) > max) + if (std::abs(fft_codes[i].imag()) > max) { - max = std::abs(fft_codes_padded[i].imag()); + max = std::abs(fft_codes[i].imag()); } } // map the FFT to the dynamic range of the fixed point values an copy to buffer containing all FFTs // and package codes in a format that is ready to be written to the FPGA for (uint32_t i = 0; i < nsamples_total; i++) { - tmp = static_cast(floor(fft_codes_padded[i].real() * (pow(2, QUANT_BITS_LOCAL_CODE - 1) - 1) / max)); - tmp2 = static_cast(floor(fft_codes_padded[i].imag() * (pow(2, QUANT_BITS_LOCAL_CODE - 1) - 1) / max)); + tmp = static_cast(floor(fft_codes[i].real() * (pow(2, QUANT_BITS_LOCAL_CODE - 1) - 1) / max)); + tmp2 = static_cast(floor(fft_codes[i].imag() * (pow(2, QUANT_BITS_LOCAL_CODE - 1) - 1) / max)); local_code = (tmp & SELECT_LSBITS) | ((tmp2 * SHL_CODE_BITS) & SELECT_MSBITS); // put together the real part and the imaginary part fft_data = local_code & SELECT_ALL_CODE_BITS; d_all_fft_codes_[i + (nsamples_total * (PRN - 1))] = fft_data; - - // d_all_fft_codes_[i + nsamples_total * (PRN - 1)] = lv_16sc_t(static_cast(floor(fft_codes_padded[i].real() * (pow(2, QUANT_BITS_LOCAL_CODE - 1) - 1) / max)), - // static_cast(floor(fft_codes_padded[i].imag() * (pow(2, QUANT_BITS_LOCAL_CODE - 1) - 1) / max))); } } diff --git a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc index 2a395eb51..29b1a1887 100644 --- a/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc +++ b/src/algorithms/acquisition/adapters/gps_l5i_pcps_acquisition_fpga.cc @@ -104,7 +104,7 @@ void GpsL5iPcpsAcquisitionFpga::generate_gps_l5i_prn_codes() // a channel is assigned) auto fft_if = gnss_fft_fwd_make_unique(nsamples_total); // Direct FFT volk_gnsssdr::vector> code(nsamples_total); - volk_gnsssdr::vector> fft_codes_padded(nsamples_total); + volk_gnsssdr::vector> fft_codes(nsamples_total); d_all_fft_codes_ = volk_gnsssdr::vector(nsamples_total * NUM_PRNs); // memory containing all the possible fft codes for PRN 0 to 32 float max; @@ -121,33 +121,32 @@ void GpsL5iPcpsAcquisitionFpga::generate_gps_l5i_prn_codes() { // Duplicate the code sequence std::copy(code.begin(), code.begin() + code_length, code.begin() + code_length); + // Fill in zero padding for the rest + std::fill(code.begin() + (acq_parameters_.enable_zero_padding ? 2 * code_length : code_length), code.end(), std::complex(0.0, 0.0)); } - // Fill in zero padding for the rest - std::fill(code.begin() + (acq_parameters_.enable_zero_padding ? 2 * code_length : code_length), code.end(), std::complex(0.0, 0.0)); - - std::copy_n(code.data(), nsamples_total, fft_if->get_inbuf()); // copy to FFT buffer - fft_if->execute(); // Run the FFT of local code - volk_32fc_conjugate_32fc(fft_codes_padded.data(), fft_if->get_outbuf(), nsamples_total); // conjugate values + std::copy_n(code.data(), nsamples_total, fft_if->get_inbuf()); // copy to FFT buffer + fft_if->execute(); // Run the FFT of local code + volk_32fc_conjugate_32fc(fft_codes.data(), fft_if->get_outbuf(), nsamples_total); // conjugate values max = 0; // initialize maximum value for (uint32_t i = 0; i < nsamples_total; i++) // search for maxima { - if (std::abs(fft_codes_padded[i].real()) > max) + if (std::abs(fft_codes[i].real()) > max) { - max = std::abs(fft_codes_padded[i].real()); + max = std::abs(fft_codes[i].real()); } - if (std::abs(fft_codes_padded[i].imag()) > max) + if (std::abs(fft_codes[i].imag()) > max) { - max = std::abs(fft_codes_padded[i].imag()); + max = std::abs(fft_codes[i].imag()); } } // map the FFT to the dynamic range of the fixed point values an copy to buffer containing all FFTs // and package codes in a format that is ready to be written to the FPGA for (uint32_t i = 0; i < nsamples_total; i++) { - tmp = static_cast(floor(fft_codes_padded[i].real() * (pow(2, QUANT_BITS_LOCAL_CODE - 1) - 1) / max)); - tmp2 = static_cast(floor(fft_codes_padded[i].imag() * (pow(2, QUANT_BITS_LOCAL_CODE - 1) - 1) / max)); + tmp = static_cast(floor(fft_codes[i].real() * (pow(2, QUANT_BITS_LOCAL_CODE - 1) - 1) / max)); + tmp2 = static_cast(floor(fft_codes[i].imag() * (pow(2, QUANT_BITS_LOCAL_CODE - 1) - 1) / max)); local_code = (tmp & SELECT_LSBITS) | ((tmp2 * SHL_CODE_BITS) & SELECT_MSBITS); // put together the real part and the imaginary part fft_data = local_code & SELECT_ALL_CODE_BITS; d_all_fft_codes_[i + (nsamples_total * (PRN - 1))] = fft_data;