aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Tsou <tom@tsou.cc>2014-04-16 23:34:21 -0400
committerThomas Tsou <tom@tsou.cc>2014-10-06 10:35:29 -0700
commit98b1af896c3e16bec418af654dd8fc2212c85fc5 (patch)
treec6e0a9eb6a34bfd9828956cba41018bcfdccf7c5
parent14bb9c923d8c967e8ce114a868923e9566be51e5 (diff)
Transceiver52M: Use multiple SCH correlation ranges
Setup two SCH detection ranges - full search and narrow search. Full search correlates the full burst length to find for SCH detection. Narrow uses a reduced search range, which is the same as that used for RACH detection. Narrow searching is enabled after the SCH is successfully decoded and the MS is locked to the frame timing. Signed-off-by: Thomas Tsou <tom@tsou.cc>
-rw-r--r--Transceiver52M/Transceiver.cpp7
-rw-r--r--Transceiver52M/sigProcLib.cpp17
-rw-r--r--Transceiver52M/sigProcLib.h7
3 files changed, 24 insertions, 7 deletions
diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index 60be8d2..05f3b16 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -391,10 +391,13 @@ bool Transceiver::detectSCH(TransceiverState *state,
signalVector &burst,
complex &amp, float &toa)
{
- int shift;
+ int shift, full;;
float mag, threshold = 7.0;
- if (!detectSCHBurst(burst, threshold, mSPSRx, &amp, &toa))
+ full = (state->mode == TRX_MODE_MS_TRACK) ?
+ SCH_DETECT_NARROW : SCH_DETECT_FULL;
+
+ if (!detectSCHBurst(burst, threshold, mSPSRx, &amp, &toa, full))
return false;
std::cout << "SCH : Timing offset " << toa << " symbols" << std::endl;
diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp
index 0db3a81..22ecf97 100644
--- a/Transceiver52M/sigProcLib.cpp
+++ b/Transceiver52M/sigProcLib.cpp
@@ -1497,7 +1497,7 @@ int detectSCHBurst(signalVector &burst,
float thresh,
int sps,
complex *amp,
- float *toa)
+ float *toa, int state)
{
int rc, start, target, head, tail, len;
float _toa;
@@ -1508,10 +1508,19 @@ int detectSCHBurst(signalVector &burst,
if ((sps != 1) && (sps != 4))
return -1;
- /* Search full length */
target = 3 + 39 + 64;
- head = target - 1;
- tail = 39 + 3 + 9;
+
+ switch (state) {
+ case SCH_DETECT_NARROW:
+ head = 4;
+ tail = 4;
+ break;
+ case SCH_DETECT_FULL:
+ default:
+ head = target - 1;
+ tail = 39 + 3 + 9;
+ break;
+ }
start = (target - head) * sps - 1;
len = (head + tail) * sps;
diff --git a/Transceiver52M/sigProcLib.h b/Transceiver52M/sigProcLib.h
index 90b6852..6cdf7b6 100644
--- a/Transceiver52M/sigProcLib.h
+++ b/Transceiver52M/sigProcLib.h
@@ -188,11 +188,16 @@ int detectRACHBurst(signalVector &rxBurst,
complex *amplitude,
float* TOA);
+enum {
+ SCH_DETECT_FULL,
+ SCH_DETECT_NARROW,
+};
+
int detectSCHBurst(signalVector &rxBurst,
float detectThreshold,
int sps,
complex *amplitude,
- float* TOA);
+ float* TOA, int state);
/**
Normal burst correlator, detector, channel estimator.