[hamradio-commits] [gnss-sdr] 23/251: making the resampler faster

Carles Fernandez carles_fernandez-guest at moszumanska.debian.org
Wed Sep 2 00:22:32 UTC 2015


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

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

commit cace34dffb34db5051dd2cb2afafaa02b8b55a2d
Author: Carles Fernandez <carles.fernandez at gmail.com>
Date:   Wed May 6 10:53:27 2015 +0200

    making the resampler faster
---
 src/algorithms/libs/gnss_signal_processing.cc | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/algorithms/libs/gnss_signal_processing.cc b/src/algorithms/libs/gnss_signal_processing.cc
index 3208c8c..ce1439b 100644
--- a/src/algorithms/libs/gnss_signal_processing.cc
+++ b/src/algorithms/libs/gnss_signal_processing.cc
@@ -35,6 +35,8 @@
 #include <gnuradio/fxpt_nco.h>
 
 
+auto auxCeil2 = [](float x){ return static_cast<int>(static_cast<long>((x)+1)); };
+
 void complex_exp_gen(std::complex<float>* _dest, double _f, double _fs, unsigned int _samps)
 {
     gr::fxpt_nco d_nco;
@@ -158,6 +160,7 @@ void resampler(std::complex<float>* _from, std::complex<float>* _dest, float _fs
         float _fs_out, unsigned int _length_in, unsigned int _length_out)
 {
     unsigned int _codeValueIndex;
+    float aux;
     //--- Find time constants --------------------------------------------------
     const float _t_in = 1 / _fs_in;  // Incoming sampling  period in sec
     const float _t_out = 1 / _fs_out;   // Out sampling period in sec
@@ -165,7 +168,10 @@ void resampler(std::complex<float>* _from, std::complex<float>* _dest, float _fs
         {
             //=== Digitizing =======================================================
             //--- compute index array to read sampled values -------------------------
-            _codeValueIndex = ceil((_t_out * ((float)i + 1)) / _t_in) - 1;
+            //_codeValueIndex = ceil((_t_out * ((float)i + 1)) / _t_in) - 1;
+            aux = (_t_out * (i + 1)) / _t_in;
+            _codeValueIndex = auxCeil2(aux) - 1;
+
             //if repeat the chip -> upsample by nearest neighborhood interpolation
             _dest[i] = _from[_codeValueIndex];
         }

-- 
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