[hamradio-commits] [gnss-sdr] 71/126: reverting wrong change

Carles Fernandez carles_fernandez-guest at moszumanska.debian.org
Sat Dec 26 18:38:03 UTC 2015


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

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

commit df6996f3b14d0b98eda31a7bb9b5a5da379d3d90
Author: Carles Fernandez <carles.fernandez at gmail.com>
Date:   Fri Nov 27 14:06:30 2015 +0100

    reverting wrong change
---
 src/algorithms/tracking/libs/lock_detectors.cc | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/src/algorithms/tracking/libs/lock_detectors.cc b/src/algorithms/tracking/libs/lock_detectors.cc
index dc738c9..b3d6e9c 100644
--- a/src/algorithms/tracking/libs/lock_detectors.cc
+++ b/src/algorithms/tracking/libs/lock_detectors.cc
@@ -73,20 +73,16 @@ float cn0_svn_estimator(gr_complex* Prompt_buffer, int length, long fs_in, doubl
     float SNR_dB_Hz = 0;
     float Psig = 0;
     float Ptot = 0;
-    float Psig2, Ptot2, SNR_dB_Hz2; Psig2=0; Ptot2=0;
     for (int i=0; i<length; i++)
         {
-            Psig += Prompt_buffer[i].real() * Prompt_buffer[i].real(); //std::abs(Prompt_buffer[i].real());
-            Psig2 += std::abs(Prompt_buffer[i].real());
+            Psig += std::abs(Prompt_buffer[i].real());
             Ptot += Prompt_buffer[i].imag() * Prompt_buffer[i].imag() + Prompt_buffer[i].real() * Prompt_buffer[i].real();
         }
-    Psig2 = Psig2 / (float)length;//
-    Psig2 = Psig2 * Psig2;//
-    Ptot2 = Ptot / (float)length;//
+    Psig = Psig / (float)length;
+    Psig = Psig * Psig;
+    Ptot = Ptot / (float)length;
     SNR = Psig / (Ptot - Psig);
-    SNR_dB_Hz = 10 * log10(Psig2 / (Ptot2 - Psig2)) + 10 * log10(fs_in/2) - 10 * log10((float)code_length  * 1023000 /fs_in ); // 10 * log10(SNR) + 10 * log10(fs_in/2) - 10 * log10((float)code_length);
-    SNR_dB_Hz2 = 10 * log10(Psig2 / (Ptot2 - Psig2)) + 10 * log10(fs_in/2) - 10 * log10((float)code_length);
-    //std::cout << "CNO = " << SNR_dB_Hz << "  old: " << SNR_dB_Hz2 << "  code_length: " << code_length << std::endl;
+    SNR_dB_Hz = 10 * log10(SNR) + 10 * log10(fs_in/2) - 10 * log10((float)code_length);
     return SNR_dB_Hz;
 }
 

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