mirror of
https://gitea.osmocom.org/cellular-infrastructure/osmo-trx.git
synced 2025-11-02 13:13:17 +00:00
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>
This commit is contained in:
@@ -391,10 +391,13 @@ bool Transceiver::detectSCH(TransceiverState *state,
|
||||
signalVector &burst,
|
||||
complex &, float &toa)
|
||||
{
|
||||
int shift;
|
||||
int shift, full;;
|
||||
float mag, threshold = 7.0;
|
||||
|
||||
if (!detectSCHBurst(burst, threshold, mSPSRx, &, &toa))
|
||||
full = (state->mode == TRX_MODE_MS_TRACK) ?
|
||||
SCH_DETECT_NARROW : SCH_DETECT_FULL;
|
||||
|
||||
if (!detectSCHBurst(burst, threshold, mSPSRx, &, &toa, full))
|
||||
return false;
|
||||
|
||||
std::cout << "SCH : Timing offset " << toa << " symbols" << std::endl;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user