diff options
author | Alexander Chemeris <Alexander.Chemeris@gmail.com> | 2016-03-23 17:06:32 +0300 |
---|---|---|
committer | Tom Tsou <tom.tsou@ettus.com> | 2016-04-20 13:46:02 -0700 |
commit | 5efe05021a97606ee5f98235424eddb85628e25a (patch) | |
tree | c79b17d556a51fa3b7b2da20170605b4f863e6b8 /Transceiver52M/sigProcLib.cpp | |
parent | 78d1fc9a13f84b273facb2f22a291c3d2e6ebd33 (diff) |
transceiver: Add an option to generate random Access Bursts.
Diffstat (limited to 'Transceiver52M/sigProcLib.cpp')
-rw-r--r-- | Transceiver52M/sigProcLib.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp index 9674aa8..2182550 100644 --- a/Transceiver52M/sigProcLib.cpp +++ b/Transceiver52M/sigProcLib.cpp @@ -1005,6 +1005,39 @@ signalVector *genRandNormalBurst(int tsc, int sps, int tn) return burst; } +/* + * Generate a random GSM access burst. + */ +signalVector *genRandAccessBurst(int sps, int tn) +{ + if ((tn < 0) || (tn > 7)) + return NULL; + if ((sps != 1) && (sps != 4)) + return NULL; + + int i = 0; + BitVector *bits = new BitVector(88); + signalVector *burst; + + /* head and synch bits */ + for (int n = 0; i < 49; i++, n++) + (*bits)[i] = gRACHBurst[n]; + + /* Random bits */ + for (; i < 85; i++) + (*bits)[i] = rand() % 2; + + /* Tail bits */ + for (; i < 88; i++) + (*bits)[i] = 0; + + int guard = 68 + !(tn % 4); + burst = modulateBurst(*bits, guard, sps); + delete bits; + + return burst; +} + signalVector *generateEmptyBurst(int sps, int tn) { if ((tn < 0) || (tn > 7)) |