[PATCH] osmo-trx[master]: Move Transceiver::detectBurst() to sigProcLib to make it reu...

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
Fri Mar 24 21:59:58 UTC 2017


Hello Harald Welte, Jenkins Builder,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/2148

to look at the new patch set (#2).

Move Transceiver::detectBurst() to sigProcLib to make it reusable.

Change-Id: I3cbe8e6e4f39dde02c945e6c9086c040e276845c
---
M Transceiver52M/Transceiver.cpp
M Transceiver52M/Transceiver.h
M Transceiver52M/sigProcLib.cpp
M Transceiver52M/sigProcLib.h
4 files changed, 56 insertions(+), 37 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/48/2148/2

diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index c1a63fd..e37c08e 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -542,38 +542,6 @@
   }
 }
 
-int Transceiver::detectBurst(signalVector &burst,
-                             complex &amp, float &toa, CorrType type)
-{
-  int rc = 0;
-
-  switch (type) {
-  case EDGE:
-    rc = detectEdgeBurst(burst, mTSC, BURST_THRESH, mSPSRx,
-                         amp, toa, mMaxExpectedDelayNB);
-    if (rc > 0)
-      break;
-    else
-      type = TSC;
-  case TSC:
-    rc = analyzeTrafficBurst(burst, mTSC, BURST_THRESH, mSPSRx,
-                             amp, toa, mMaxExpectedDelayNB);
-    break;
-  case RACH:
-    rc = detectRACHBurst(burst, BURST_THRESH, mSPSRx, amp, toa,
-                         mMaxExpectedDelayAB);
-    break;
-  default:
-    LOG(ERR) << "Invalid correlation type";
-  }
-
-  if (rc > 0)
-    return type;
-
-  return rc;
-}
-
-
 /*
  * Demodulate GMSK by direct rotation and soft slicing.
  */
@@ -679,7 +647,8 @@
   }
 
   /* Detect normal or RACH bursts */
-  rc = detectBurst(*burst, amp, toa, type);
+  rc = detectAnyBurst(*burst, mTSC, BURST_THRESH, mSPSRx, type, amp, toa,
+                      (type==RACH)?mMaxExpectedDelayAB:mMaxExpectedDelayNB);
 
   if (rc > 0) {
     type = (CorrType) rc;
diff --git a/Transceiver52M/Transceiver.h b/Transceiver52M/Transceiver.h
index 425b004..3c70e5c 100644
--- a/Transceiver52M/Transceiver.h
+++ b/Transceiver52M/Transceiver.h
@@ -202,10 +202,6 @@
   /** send messages over the clock socket */
   void writeClockInterface(void);
 
-  /** Detectbursts */
-  int detectBurst(signalVector &burst,
-                  complex &amp, float &toa, CorrType type);
-
   /** Demodulate burst and output soft bits */
   SoftVector *demodulate(signalVector &burst,
                          complex amp, float toa, CorrType type);
diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp
index 6f50f04..2de1816 100644
--- a/Transceiver52M/sigProcLib.cpp
+++ b/Transceiver52M/sigProcLib.cpp
@@ -1925,6 +1925,38 @@
   return rc;
 }
 
+int detectAnyBurst(signalVector &burst, unsigned tsc, float threshold,
+                   int sps, CorrType type, complex &amp, float &toa,
+                   unsigned max_toa)
+{
+  int rc = 0;
+
+  switch (type) {
+  case EDGE:
+    rc = detectEdgeBurst(burst, tsc, threshold, sps,
+                         amp, toa, max_toa);
+    if (rc > 0)
+      break;
+    else
+      type = TSC;
+  case TSC:
+    rc = analyzeTrafficBurst(burst, tsc, threshold, sps,
+                             amp, toa, max_toa);
+    break;
+  case RACH:
+    rc = detectRACHBurst(burst, threshold, sps, amp, toa,
+                         max_toa);
+    break;
+  default:
+    LOG(ERR) << "Invalid correlation type";
+  }
+
+  if (rc > 0)
+    return type;
+
+  return rc;
+}
+
 signalVector *downsampleBurst(signalVector &burst)
 {
   signalVector *in, *out;
diff --git a/Transceiver52M/sigProcLib.h b/Transceiver52M/sigProcLib.h
index 7bdbde8..6413b47 100644
--- a/Transceiver52M/sigProcLib.h
+++ b/Transceiver52M/sigProcLib.h
@@ -255,6 +255,28 @@
                     unsigned max_toa);
 
 /**
+        8-PSK/GMSK/RACH burst detector
+        @param burst The received GSM burst of interest
+        @param tsc Midamble type (0..7) also known as TSC
+        @param threshold The threshold that the received burst's post-correlator SNR is compared against to determine validity.
+        @param sps The number of samples per GSM symbol.
+        @param amplitude The estimated amplitude of received TSC burst.
+        @param toa The estimate time-of-arrival of received TSC burst (in symbols).
+        @param max_toa The maximum expected time-of-arrival (in symbols).
+        @return positive value (CorrType) if threshold value is reached,
+                negative value (-SignalError) on error,
+                zero (SIGERR_NONE) if no burst is detected
+*/
+int detectAnyBurst(signalVector &burst,
+                   unsigned tsc,
+                   float threshold,
+                   int sps,
+                   CorrType type,
+                   complex &amp,
+                   float &toa,
+                   unsigned max_toa);
+
+/**
 	Downsample 4 SPS to 1 SPS using a polyphase filterbank
         @param burst Input burst of at least 624 symbols
         @return Decimated signal vector of 156 symbols

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

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I3cbe8e6e4f39dde02c945e6c9086c040e276845c
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