aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M
diff options
context:
space:
mode:
authorVadim Yanitskiy <axilirator@gmail.com>2018-10-17 11:01:58 +0200
committerVadim Yanitskiy <axilirator@gmail.com>2018-10-24 19:28:47 +0000
commita79bc70737c3d8aadb983e926bf6467a12aed8ae (patch)
tree39cbb1040cd13650bb7ccd88ef9dd62bfa3dcb3e /Transceiver52M
parenta439fed1662ce92c008e440b6a2ca1b2d95ce4cb (diff)
sigProcLib: introduce 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. Let's prepare everythyng to be able to detect all TS0-3 synch. sequences, but keep detection of both TS1 and TS2 disabled until the corresponding VTY option is introduced. Change-Id: I838c21db29c54f1924dd478c2b34b46b70aab2cd Related: OS#3054
Diffstat (limited to 'Transceiver52M')
-rw-r--r--Transceiver52M/radioInterface.cpp2
-rw-r--r--Transceiver52M/sigProcLib.cpp39
2 files changed, 24 insertions, 17 deletions
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 @@ int RadioInterface::driveReceiveRadio()
* 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..072fb3b 100644
--- a/Transceiver52M/sigProcLib.cpp
+++ b/Transceiver52M/sigProcLib.cpp
@@ -132,7 +132,7 @@ struct PulseSequence {
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 @@ void sigProcLibDestroy()
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 @@ void sigProcLibDestroy()
GMSKRotation4 = NULL;
GMSKReverseRotation4 = NULL;
GMSKReverseRotation1 = NULL;
- gRACHSequence = NULL;
GSMPulse1 = NULL;
GSMPulse4 = NULL;
}
@@ -1332,7 +1335,7 @@ static CorrelationSequence *generateEdgeMidamble(int tsc)
return seq;
}
-static bool generateRACHSequence(int sps)
+static bool generateRACHSequence(CorrelationSequence **seq, const BitVector &bv, int sps)
{
bool status = true;
float toa;
@@ -1340,13 +1343,14 @@ static bool generateRACHSequence(int sps)
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 @@ static bool generateRACHSequence(int sps)
goto release;
}
- gRACHSequence = new CorrelationSequence;
- gRACHSequence->sequence = _seq1;
- gRACHSequence->buffer = data;
- gRACHSequence->gain = peakDetect(*autocorr, &toa, NULL);
+ *seq = new CorrelationSequence;
+ (*seq)->sequence = _seq1;
+ (*seq)->buffer = data;
+ (*seq)->gain = peakDetect(*autocorr, &toa, NULL);
/* For 1 sps only
* (Half of correlation length - 1) + midpoint of pulse shaping filer
* 20.5 = (40 / 2 - 1) + 1.5
*/
if (sps == 1)
- gRACHSequence->toa = toa - 20.5;
+ (*seq)->toa = toa - 20.5;
else
- gRACHSequence->toa = 0.0;
+ (*seq)->toa = 0.0;
release:
delete autocorr;
@@ -1388,7 +1392,7 @@ release:
if (!status) {
delete _seq1;
free(data);
- gRACHSequence = NULL;
+ *seq = NULL;
}
return status;
@@ -1606,7 +1610,7 @@ static int detectRACHBurst(const signalVector &burst, float threshold, int sps,
target = 8 + 40;
head = 8;
tail = 8 + max_toa;
- sync = gRACHSequence;
+ sync = gRACHSequences[0];
rc = detectGeneralBurst(burst, threshold, sps, amplitude, toa,
target, head, tail, sync);
@@ -1858,7 +1862,10 @@ bool sigProcLibSetup()
GSMPulse1 = generateGSMPulse(1);
GSMPulse4 = generateGSMPulse(4);
- generateRACHSequence(1);
+ generateRACHSequence(&gRACHSequences[0], gRACHSynchSequenceTS0, 1);
+ generateRACHSequence(&gRACHSequences[1], gRACHSynchSequenceTS1, 1);
+ generateRACHSequence(&gRACHSequences[2], gRACHSynchSequenceTS2, 1);
+
for (int tsc = 0; tsc < 8; tsc++) {
generateMidamble(1, tsc);
gEdgeMidambles[tsc] = generateEdgeMidamble(tsc);