[MERGED] osmo-trx[master]: sigProcLib: constify signalVector arguments for detectBurst(...

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Alexander Chemeris gerrit-no-reply at lists.osmocom.org
Tue Mar 28 14:29:57 UTC 2017


Alexander Chemeris has submitted this change and it was merged.

Change subject: sigProcLib: constify signalVector arguments for detectBurst() functions.
......................................................................


sigProcLib: constify signalVector arguments for detectBurst() functions.

Change-Id: Ic033371a387353eb12b1827a0eb16c00c07da88a
---
M Transceiver52M/sigProcLib.cpp
M Transceiver52M/sigProcLib.h
2 files changed, 24 insertions(+), 23 deletions(-)

Approvals:
  Tom Tsou: Looks good to me, approved
  Harald Welte: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp
index 467a203..eaaae34 100644
--- a/Transceiver52M/sigProcLib.cpp
+++ b/Transceiver52M/sigProcLib.cpp
@@ -1707,7 +1707,7 @@
   return (amp.abs()) / rms;
 }
 
-float energyDetect(signalVector &rxBurst, unsigned windowLength)
+float energyDetect(const signalVector &rxBurst, unsigned windowLength)
 {
 
   signalVector::const_iterator windowItr = rxBurst.begin(); //+rxBurst.size()/2 - 5*windowLength/2;
@@ -1729,12 +1729,13 @@
  * For higher oversampling values, we assume the energy detector is in place
  * and we run full interpolating peak detection.
  */
-static int detectBurst(signalVector &burst,
+static int detectBurst(const signalVector &burst,
                        signalVector &corr, CorrelationSequence *sync,
                        float thresh, int sps, complex *amp, float *toa,
                        int start, int len)
 {
-  signalVector *corr_in, *dec = NULL;
+  const signalVector *corr_in;
+  signalVector *dec = NULL;
 
   if (sps == 4) {
     dec = downsampleBurst(burst);
@@ -1782,7 +1783,7 @@
   return 1;
 }
 
-static float maxAmplitude(signalVector &burst)
+static float maxAmplitude(const signalVector &burst)
 {
     float max = 0.0;
     for (size_t i = 0; i < burst.size(); i++) {
@@ -1803,13 +1804,13 @@
  *   head: Search symbols before target
  *   tail: Search symbols after target
  */
-int detectGeneralBurst(signalVector &rxBurst,
-                       float thresh,
-                       int sps,
-                       complex &amp,
-                       float &toa,
-                       int target, int head, int tail,
-                       CorrelationSequence *sync)
+static int detectGeneralBurst(const signalVector &rxBurst,
+                              float thresh,
+                              int sps,
+                              complex &amp,
+                              float &toa,
+                              int target, int head, int tail,
+                              CorrelationSequence *sync)
 {
   int rc, start, len;
   bool clipping = false;
@@ -1858,7 +1859,7 @@
  *   head: Search 8 symbols before target
  *   tail: Search 8 symbols + maximum expected delay
  */
-int detectRACHBurst(signalVector &burst,
+int detectRACHBurst(const signalVector &burst,
             float threshold,
             int sps,
             complex &amplitude,
@@ -1887,7 +1888,7 @@
  *   head: Search 6 symbols before target
  *   tail: Search 6 symbols + maximum expected delay
  */
-int analyzeTrafficBurst(signalVector &burst, unsigned tsc, float threshold,
+int analyzeTrafficBurst(const signalVector &burst, unsigned tsc, float threshold,
                         int sps, complex &amplitude, float &toa, unsigned max_toa)
 {
   int rc, target, head, tail;
@@ -1906,7 +1907,7 @@
   return rc;
 }
 
-int detectEdgeBurst(signalVector &burst, unsigned tsc, float threshold,
+int detectEdgeBurst(const signalVector &burst, unsigned tsc, float threshold,
                     int sps, complex &amplitude, float &toa, unsigned max_toa)
 {
   int rc, target, head, tail;
@@ -1925,7 +1926,7 @@
   return rc;
 }
 
-int detectAnyBurst(signalVector &burst, unsigned tsc, float threshold,
+int detectAnyBurst(const signalVector &burst, unsigned tsc, float threshold,
                    int sps, CorrType type, complex &amp, float &toa,
                    unsigned max_toa)
 {
@@ -1957,7 +1958,7 @@
   return rc;
 }
 
-signalVector *downsampleBurst(signalVector &burst)
+signalVector *downsampleBurst(const signalVector &burst)
 {
   signalVector *in, *out;
 
@@ -2085,7 +2086,7 @@
  * delay filters. Symbol rotation and after always operates at 1 SPS.
  */
 SoftVector *demodGmskBurst(signalVector &rxBurst, int sps,
-                            complex channel, float TOA)
+                           complex channel, float TOA)
 {
   SoftVector *bits;
   signalVector *dec;
diff --git a/Transceiver52M/sigProcLib.h b/Transceiver52M/sigProcLib.h
index a10d551..a67b0ca 100644
--- a/Transceiver52M/sigProcLib.h
+++ b/Transceiver52M/sigProcLib.h
@@ -201,7 +201,7 @@
         @param windowLength The number of burst samples used to compute burst energy
         @return The average power of the received burst.
 */
-float energyDetect(signalVector &rxBurst,
+float energyDetect(const signalVector &rxBurst,
                    unsigned windowLength);
 
 /**
@@ -216,7 +216,7 @@
                 negative value (-SignalError) on error,
                 zero (SIGERR_NONE) if no burst is detected
 */
-int detectRACHBurst(signalVector &burst,
+int detectRACHBurst(const signalVector &burst,
                     float threshold,
                     int sps,
                     complex &amplitude,
@@ -236,7 +236,7 @@
                 negative value (-SignalError) on error,
                 zero (SIGERR_NONE) if no burst is detected
 */
-int analyzeTrafficBurst(signalVector &burst,
+int analyzeTrafficBurst(const signalVector &burst,
                         unsigned tsc,
                         float threshold,
                         int sps,
@@ -257,7 +257,7 @@
                 negative value (-SignalError) on error,
                 zero (SIGERR_NONE) if no burst is detected
 */
-int detectEdgeBurst(signalVector &burst,
+int detectEdgeBurst(const signalVector &burst,
                     unsigned tsc,
                     float threshold,
                     int sps,
@@ -278,7 +278,7 @@
                 negative value (-SignalError) on error,
                 zero (SIGERR_NONE) if no burst is detected
 */
-int detectAnyBurst(signalVector &burst,
+int detectAnyBurst(const signalVector &burst,
                    unsigned tsc,
                    float threshold,
                    int sps,
@@ -292,7 +292,7 @@
         @param burst Input burst of at least 624 symbols
         @return Decimated signal vector of 156 symbols
 */
-signalVector *downsampleBurst(signalVector &burst);
+signalVector *downsampleBurst(const signalVector &burst);
 
 /**
         Decimate a vector.

-- 
To view, visit https://gerrit.osmocom.org/2153
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ic033371a387353eb12b1827a0eb16c00c07da88a
Gerrit-PatchSet: 2
Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Owner: Alexander Chemeris <Alexander.Chemeris at gmail.com>
Gerrit-Reviewer: Alexander Chemeris <Alexander.Chemeris at gmail.com>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Tom Tsou <tom at tsou.cc>



More information about the gerrit-log mailing list