sigproc: Add clipping detection on RACH and TSC input

Alert user of overdriven burst input indicated by a positive
threshold detector result. This indication serves as notification
that the receive RF gain level is too high for the configured
transceiver setup.

Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
diff --git a/Transceiver52M/Transceiver.cpp b/Transceiver52M/Transceiver.cpp
index 4885654..31eea60 100644
--- a/Transceiver52M/Transceiver.cpp
+++ b/Transceiver52M/Transceiver.cpp
@@ -615,8 +615,16 @@
   else
     success = detectRACH(state, *burst, amp, toa);
 
-  if (!success) {
-    state->mNoises.insert(avg);
+  /* Update noise average if no bust detected or alert on error */
+  if (success <= 0) {
+    if (!success) {
+      state->mNoises.insert(avg);
+    } else if (success == -SIGERR_CLIP) {
+      LOG(ALERT) << "Clipping detected on RACH input";
+    } else if (success < 0) {
+      LOG(ALERT) << "Unhandled RACH error";
+    }
+
     delete radio_burst;
     return NULL;
   }