Vadim Yanitskiy has uploaded this change for review. (
https://gerrit.osmocom.org/11390
Change subject: sigProcLib: also detect both TS1 and TS2 RACH synch. sequences
..
sigProcLib: also detect both TS1 and TS2 RACH synch. sequences
According to 3GPP TS 05.02, section 5.2.7, there are three
synch. sequences for Access Bursts:
- TS0: GSM, GMSK (default),
- TS1: EGPRS, 8-PSK,
- TS2: EGPRS, GMSK.
Until now, we used to detect TS0 only, let's also detect both
TS1 and TS2, which are used in extended (11-bit) RACH.
Change-Id: I838c21db29c54f1924dd478c2b34b46b70aab2cd
Related: OS#3054
---
M GSM/GSMCommon.cpp
M GSM/GSMCommon.h
M Transceiver52M/radioInterface.cpp
M Transceiver52M/sigProcLib.cpp
4 files changed, 38 insertions(+), 21 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/90/11390/1
diff --git a/GSM/GSMCommon.cpp b/GSM/GSMCommon.cpp
index 8aba3be..711ca70 100644
--- a/GSM/GSMCommon.cpp
+++ b/GSM/GSMCommon.cpp
@@ -54,7 +54,10 @@
const BitVector
GSM::gDummyBurst("0001011011101101010010011101001000100010001110001011100010111000101011101001010001100110011100010010001001010101");
-const BitVector
GSM::gRACHSynchSequence("01001011000110011010101000000");
+/* 3GPP TS 05.02, section 5.2.7 "Access burst (AB)", synch. sequence bits */
+const BitVector
GSM::gRACHSynchSequenceTS0("01001011000110011010101000000"); /*
GSM, GMSK (default) */
+const BitVector
GSM::gRACHSynchSequenceTS1("01010100100011100010001001101"); /*
EGPRS, 8-PSK */
+const BitVector
GSM::gRACHSynchSequenceTS2("111000100111010101101101101110111"); /*
EGPRS, GMSK */
//
|-head-||-midamble--||--data||t|
const BitVector
GSM::gRACHBurst("0011101001001011000110011010101000000110011111001001010110011000");
diff --git a/GSM/GSMCommon.h b/GSM/GSMCommon.h
index 8b8d5e8..f703c30 100644
--- a/GSM/GSMCommon.h
+++ b/GSM/GSMCommon.h
@@ -52,7 +52,9 @@
extern const BitVector gDummyBurst;
/** Random access burst synch. sequence */
-extern const BitVector gRACHSynchSequence;
+extern const BitVector gRACHSynchSequenceTS0;
+extern const BitVector gRACHSynchSequenceTS1;
+extern const BitVector gRACHSynchSequenceTS2;
/** Random access burst synch. sequence, GSM 05.02 5.2.7 */
extern const BitVector gRACHBurst;
diff --git a/Transceiver52M/radioInterface.cpp
b/Transceiver52M/radioInterface.cpp
index 0f949d7..6245cfc 100644
--- a/Transceiver52M/radioInterface.cpp
+++ b/Transceiver52M/radioInterface.cpp
@@ -245,7 +245,7 @@
* Pre-allocate head room for the largest correlation size
* so we can later avoid a re-allocation and copy
* */
- size_t head = GSM::gRACHSynchSequence.size();
+ size_t head = GSM::gRACHSynchSequenceTS0.size();
/*
* Form receive bursts and pass up to transceiver. Use repeating
diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp
index 692fbe0..e13282f 100644
--- a/Transceiver52M/sigProcLib.cpp
+++ b/Transceiver52M/sigProcLib.cpp
@@ -132,7 +132,7 @@
static CorrelationSequence *gMidambles[] =
{NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};
static CorrelationSequence *gEdgeMidambles[] =
{NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};
-static CorrelationSequence *gRACHSequence = NULL;
+static CorrelationSequence *gRACHSequences[] = {NULL,NULL,NULL};
static PulseSequence *GSMPulse1 = NULL;
static PulseSequence *GSMPulse4 = NULL;
@@ -150,11 +150,15 @@
delayFilters[i] = NULL;
}
+ for (int i = 0; i < 3; i++) {
+delete gRACHSequences[i];
+gRACHSequences[i] = NULL;
+ }
+
delete GMSKRotation1;
delete GMSKReverseRotation1;
delete GMSKRotation4;
delete GMSKReverseRotation4;
- delete gRACHSequence;
delete GSMPulse1;
delete GSMPulse4;
delete dnsampler;
@@ -163,7 +167,6 @@
GMSKRotation4 = NULL;
GMSKReverseRotation4 = NULL;
GMSKReverseRotation1 = NULL;
- gRACHSequence = NULL;
GSMPulse1 = NULL;
GSMPulse4 = NULL;
}
@@ -1332,7 +1335,7 @@
return seq;
}
-static bool generateRACHSequence(int sps)
+static bool generateRACHSequence(CorrelationSequence **seq, const BitVector
, int sps)
{
bool status = true;
float toa;
@@ -1340,13 +1343,14 @@
signalVector *autocorr = NULL;
signalVector *seq0 = NULL, *seq1 = NULL, *_seq1 = NULL;
- delete gRACHSequence;
+ if (*seq != NULL)
+delete *seq;
- seq0 = modulateBurst(gRACHSynchSequence, 0, sps, false);
+ seq0 = modulateBurst(bv, 0, sps, false);
if (!seq0)
return false;
- seq1 = modulateBurst(gRACHSynchSequence.segment(0, 40), 0, sps, true);
+ seq1 = modulateBurst(bv.segment(0, 40), 0, sps, true);
if (!seq1) {
status = false;
goto release;
@@ -1366,19 +1370,19 @@
goto release;
}
- gRACHSequence = new CorrelationSequence;
- gRACHSequence->sequence = _seq1;
-