Transceiver52M: Setup sinc() call directly with table lookup

On Beagle Board the call into the sinc() function is generating a lot of
load on the peak interpolation. Simplify the sinc() function with a
dedicated table lookup. Eventually, this table may be removed in favour
of using a precomputed filterbank for fractional delay determination.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
diff --git a/Transceiver52M/sigProcLib.cpp b/Transceiver52M/sigProcLib.cpp
index efa8f5d..d0dcde5 100644
--- a/Transceiver52M/sigProcLib.cpp
+++ b/Transceiver52M/sigProcLib.cpp
@@ -43,6 +43,7 @@
 /** Lookup tables for trigonometric approximation */
 float cosTable[TABLESIZE+1]; // add 1 element for wrap around
 float sinTable[TABLESIZE+1];
+float sincTable[TABLESIZE+1];
 
 /** Constants */
 static const float M_PI_F = (float)M_PI;
@@ -821,10 +822,29 @@
     return modulateBurstBasic(wBurst, guardPeriodLength, sps);
 }
 
+void generateSincTable()
+{
+  float x;
+
+  for (int i = 0; i < TABLESIZE; i++) {
+    x = (float) i / TABLESIZE * 8 * M_PI;
+    if (fabs(x) < 0.01) {
+      sincTable[i] = 1.0f;
+      continue;
+    }
+
+    sincTable[i] = sinf(x) / x;
+  }
+}
+
 float sinc(float x)
 {
-  if ((x >= 0.01F) || (x <= -0.01F)) return (sinLookup(x)/x);
-  return 1.0F;
+  if (fabs(x) >= 8 * M_PI)
+    return 0.0;
+
+  int index = (int) floorf(fabs(x) / (8 * M_PI) * TABLESIZE);
+
+  return sincTable[index];
 }
 
 /*
@@ -1685,6 +1705,7 @@
     return false;
 
   initTrigTables();
+  generateSincTable();
   initGMSKRotationTables(sps);
 
   GSMPulse1 = generateGSMPulse(1, 2);