aboutsummaryrefslogtreecommitdiffstats
path: root/Transceiver52M/sigProcLib.cpp
diff options
context:
space:
mode:
authorAlexander Chemeris <Alexander.Chemeris@gmail.com>2017-03-17 15:24:18 -0700
committerAlexander Chemeris <Alexander.Chemeris@gmail.com>2017-03-24 14:59:24 -0700
commit4e6c938024031f2dc6d891b75cdd48c5846afba8 (patch)
tree18e2e3e1176cc28cf780a61d1de2620fadc0b1da /Transceiver52M/sigProcLib.cpp
parent4aa548f0c2da2c505624807b3b027eaccf5aa98a (diff)
Move Transceiver::detectBurst() to sigProcLib to make it reusable.
Diffstat (limited to 'Transceiver52M/sigProcLib.cpp')
-rw-r--r--Transceiver52M/sigProcLib.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp
index 6f50f04..2de1816 100644
--- a/Transceiver52M/sigProcLib.cpp
+++ b/Transceiver52M/sigProcLib.cpp
@@ -1925,6 +1925,38 @@ int detectEdgeBurst(signalVector &burst, unsigned tsc, float threshold,
return rc;
}
+int detectAnyBurst(signalVector &burst, unsigned tsc, float threshold,
+ int sps, CorrType type, complex &amp, float &toa,
+ unsigned max_toa)
+{
+ int rc = 0;
+
+ switch (type) {
+ case EDGE:
+ rc = detectEdgeBurst(burst, tsc, threshold, sps,
+ amp, toa, max_toa);
+ if (rc > 0)
+ break;
+ else
+ type = TSC;
+ case TSC:
+ rc = analyzeTrafficBurst(burst, tsc, threshold, sps,
+ amp, toa, max_toa);
+ break;
+ case RACH:
+ rc = detectRACHBurst(burst, threshold, sps, amp, toa,
+ max_toa);
+ break;
+ default:
+ LOG(ERR) << "Invalid correlation type";
+ }
+
+ if (rc > 0)
+ return type;
+
+ return rc;
+}
+
signalVector *downsampleBurst(signalVector &burst)
{
signalVector *in, *out;