aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/sigProcLib.cpp
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2019-07-01 17:55:01 +0200
committerPau Espin Pedrol <pespin@sysmocom.de>2019-07-02 15:05:17 +0200
commit7dc07b9425e2400c314248811f57091cb0ec7c07 (patch)
tree0313685667a05b2539506127430ff780522f15ce /Transceiver52M/sigProcLib.cpp
parent07ddce5c1f7f68157a48da3b1e7513db45375da3 (diff)
Transceiver: Get rid of SoftVector in struct trx_ul_burst_ind
Make the interface using trx_ul_burst_ind more implementation agnostic as well as easier to use. For instance, we don't care about SoftVector size one returned from pullRadioVector(); we want to use nbits instead. As a result, we no longer spend time normalizing guard periods. While at it, change vectorSLicer to return void since it always returns true. Change-Id: I726e5a98a43367a22c9a4ca5cbd9eb87e6765c7a
Diffstat (limited to 'Transceiver52M/sigProcLib.cpp')
-rw-r--r--Transceiver52M/sigProcLib.cpp22
1 files changed, 10 insertions, 12 deletions
diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp
index fcda5fa..cff7825 100644
--- a/Transceiver52M/sigProcLib.cpp
+++ b/Transceiver52M/sigProcLib.cpp
@@ -530,19 +530,17 @@ static PulseSequence *generateGSMPulse(int sps)
return pulse;
}
-bool vectorSlicer(SoftVector *x)
+/* Convert -1..+1 soft bits to 0..1 soft bits */
+void vectorSlicer(float *dest, const float *src, size_t len)
{
- SoftVector::iterator xP = x->begin();
- SoftVector::iterator xPEnd = x->end();
- while (xP < xPEnd) {
- *xP = 0.5 * (*xP + 1.0f);
- if (*xP > 1.0)
- *xP = 1.0;
- if (*xP < 0.0)
- *xP = 0.0;
- xP++;
- }
- return true;
+ size_t i;
+ for (i = 0; i < len; i++) {
+ dest[i] = 0.5 * (src[i] + 1.0f);
+ if (dest[i] > 1.0)
+ dest[i] = 1.0;
+ else if (dest[i] < 0.0)
+ dest[i] = 0.0;
+ }
}
static signalVector *rotateBurst(const BitVector &wBurst,