aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/sigProcLib.cpp
diff options
context:
space:
mode:
authorAlexander Chemeris <Alexander.Chemeris@gmail.com>2016-03-25 18:28:34 +0300
committerTom Tsou <tom.tsou@ettus.com>2016-06-22 15:18:13 -0700
commit37c52c79cf915fcbbf5cc932429d8a5c3a15a8d1 (patch)
treebab54961ec62df877192e0a6cbcffe841b44df9e /Transceiver52M/sigProcLib.cpp
parent58e9591f9e491335f2be7099b38b4c4b828c2ad4 (diff)
transceiver: Add an option to emulate a RACH delay in random filler mode.
Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
Diffstat (limited to 'Transceiver52M/sigProcLib.cpp')
-rw-r--r--Transceiver52M/sigProcLib.cpp18
1 files changed, 12 insertions, 6 deletions
diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp
index 434bbaf..477449f 100644
--- a/Transceiver52M/sigProcLib.cpp
+++ b/Transceiver52M/sigProcLib.cpp
@@ -1017,30 +1017,36 @@ signalVector *genRandNormalBurst(int tsc, int sps, int tn)
/*
* Generate a random GSM access burst.
*/
-signalVector *genRandAccessBurst(int sps, int tn)
+signalVector *genRandAccessBurst(int delay, int sps, int tn)
{
if ((tn < 0) || (tn > 7))
return NULL;
if ((sps != 1) && (sps != 4))
return NULL;
+ if (delay > 68)
+ return NULL;
int i = 0;
- BitVector *bits = new BitVector(88);
+ BitVector *bits = new BitVector(88+delay);
signalVector *burst;
+ /* delay */
+ for (; i < delay; i++)
+ (*bits)[i] = 0;
+
/* head and synch bits */
- for (int n = 0; i < 49; i++, n++)
+ for (int n = 0; i < 49+delay; i++, n++)
(*bits)[i] = gRACHBurst[n];
/* Random bits */
- for (; i < 85; i++)
+ for (; i < 85+delay; i++)
(*bits)[i] = rand() % 2;
/* Tail bits */
- for (; i < 88; i++)
+ for (; i < 88+delay; i++)
(*bits)[i] = 0;
- int guard = 68 + !(tn % 4);
+ int guard = 68-delay + !(tn % 4);
burst = modulateBurst(*bits, guard, sps);
delete bits;