[hamradio-commits] [gnss-sdr] 77/80: Fix bug un pcps_acquisition_cc::set_local_code

Carles Fernandez carles_fernandez-guest at moszumanska.debian.org
Sun May 15 20:11:59 UTC 2016


This is an automated email from the git hooks/post-receive script.

carles_fernandez-guest pushed a commit to branch upstream
in repository gnss-sdr.

commit 7ea560f3f7d9434f32cc2dedeeae8c5353ffbca5
Author: Luis Esteve <luis.esteve.elfau at gmail.com>
Date:   Fri May 13 05:16:59 2016 +0200

    Fix bug un pcps_acquisition_cc::set_local_code
    
    Assign the length of the code correctly to the FFT
    
    Resolves: #25
---
 .../acquisition/gnuradio_blocks/pcps_acquisition_cc.cc       | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.cc b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.cc
index 7ba6218..8a91e52 100644
--- a/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.cc
+++ b/src/algorithms/acquisition/gnuradio_blocks/pcps_acquisition_cc.cc
@@ -162,13 +162,17 @@ void pcps_acquisition_cc::set_local_code(std::complex<float> * code)
     // Here we want to create a buffer that looks like this:
     // [ 0 0 0 ... 0 c_0 c_1 ... c_L]
     // where c_i is the local code and there are L zeros and L chips
-    int offset = 0;
     if( d_bit_transition_flag )
         {
-            std::fill_n( d_fft_if->get_inbuf(), d_samples_per_code, gr_complex( 0.0, 0.0 ) );
-            offset = d_samples_per_code;
+            int offset = d_fft_size/2;
+            std::fill_n( d_fft_if->get_inbuf(), offset, gr_complex( 0.0, 0.0 ) );
+            memcpy(d_fft_if->get_inbuf() + offset, code, sizeof(gr_complex) * offset);
+        } 
+    else 
+        {
+            memcpy(d_fft_if->get_inbuf(), code, sizeof(gr_complex) * d_fft_size);
         }
-    memcpy(d_fft_if->get_inbuf() + offset, code, sizeof(gr_complex) * d_samples_per_code);
+    
     d_fft_if->execute(); // We need the FFT of local code
     volk_32fc_conjugate_32fc(d_fft_codes, d_fft_if->get_outbuf(), d_fft_size);
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-hamradio/gnss-sdr.git



More information about the pkg-hamradio-commits mailing list