[MERGED] osmo-trx[master]: sigProcLib: Slice SoftVector instead of signalVector for GMS...

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
Wed Mar 22 18:33:13 UTC 2017


Alexander Chemeris has submitted this change and it was merged.

Change subject: sigProcLib: Slice SoftVector instead of signalVector for GMSK demod.
......................................................................


sigProcLib: Slice SoftVector instead of signalVector for GMSK demod.

This makes it similar to 8-PSK demod and also saves a bit of lines ofcode and
should give us a tiny improvement in performance.

Ideally we need to remove vector slicing at all, because in osmo-bts-trx
we convert back to +-1.0 again (actually to +-127, but it doesn't mater).
So we should rather transmit +-1.0 values to avoid double conversion.

Change-Id: If9ed6f0f80fbe88c994b2f9c3cae91d0d57f4442
---
M Transceiver52M/sigProcLib.cpp
M Transceiver52M/sigProcLib.h
2 files changed, 22 insertions(+), 26 deletions(-)

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



diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp
index 0a1fd44..56a1a58 100644
--- a/Transceiver52M/sigProcLib.cpp
+++ b/Transceiver52M/sigProcLib.cpp
@@ -737,20 +737,6 @@
   return true;
 }
 
-bool vectorSlicer(signalVector *x)
-{
-
-  signalVector::iterator xP = x->begin();
-  signalVector::iterator xPEnd = x->end();
-  while (xP < xPEnd) {
-    *xP = (complex) (0.5*(xP->real()+1.0F));
-    if (xP->real() > 1.0) *xP = 1.0;
-    if (xP->real() < 0.0) *xP = 0.0;
-    xP++;
-  }
-  return true;
-}
-
 static signalVector *rotateBurst(const BitVector &wBurst,
                                  int guardPeriodLength, int sps)
 {
@@ -2020,6 +2006,22 @@
 }
 
 /*
+ * Convert signalVector to SoftVector by taking real part of the signal.
+ */
+static SoftVector *signalToSoftVector(signalVector *dec)
+{
+  SoftVector *bits = new SoftVector(dec->size());
+
+  SoftVector::iterator bit_itr = bits->begin();
+  signalVector::iterator burst_itr = dec->begin();
+
+  for (; burst_itr < dec->end(); burst_itr++)
+    *bit_itr++ = burst_itr->real();
+
+  return bits;
+}
+
+/*
  * Shared portion of GMSK and EDGE demodulators consisting of timing
  * recovery and single tap channel correction. For 4 SPS (if activated),
  * the output is downsampled prior to the 1 SPS modulation specific
@@ -2062,18 +2064,12 @@
 
   /* Shift up by a quarter of a frequency */
   GMSKReverseRotate(*dec, 1);
-  vectorSlicer(dec);
-
-  bits = new SoftVector(dec->size());
-
-  SoftVector::iterator bit_itr = bits->begin();
-  signalVector::iterator burst_itr = dec->begin();
-
-  for (; burst_itr < dec->end(); burst_itr++)
-    *bit_itr++ = burst_itr->real();
-
+  /* Take real part of the signal */
+  bits = signalToSoftVector(dec);
   delete dec;
 
+  vectorSlicer(bits);
+
   return bits;
 }
 
diff --git a/Transceiver52M/sigProcLib.h b/Transceiver52M/sigProcLib.h
index 7dca71f..ed72430 100644
--- a/Transceiver52M/sigProcLib.h
+++ b/Transceiver52M/sigProcLib.h
@@ -101,8 +101,8 @@
 			unsigned startIx = 0,
 			unsigned len = 0);
 
-/** Operate soft slicer on real-valued portion of vector */ 
-bool vectorSlicer(signalVector *x);
+/** Operate soft slicer on a soft-bit vector */
+bool vectorSlicer(SoftVector *x);
 
 /** GMSK modulate a GSM burst of bits */
 signalVector *modulateBurst(const BitVector &wBurst,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If9ed6f0f80fbe88c994b2f9c3cae91d0d57f4442
Gerrit-PatchSet: 3
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: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Tom Tsou <tom at tsou.cc>



More information about the gerrit-log mailing list