Arianna autonomous DAQ firmware

Dependencies:   mbed SDFileSystemFilinfo AriSnProtocol NetServicesMin AriSnComm MODSERIAL PowerControlClkPatch DS1820OW

Revision:
84:80b15993944e
Child:
114:554fa3a956b4
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/SnSigProcDataTable.h	Fri Oct 30 04:49:40 2015 +0000
@@ -0,0 +1,60 @@
+#ifndef SN_SnSigProcDataTable
+#define SN_SnSigProcDataTable
+
+#include "SnPreCompOptions.h"
+
+#include <stdint.h>
+
+// use template specialization to cause a compiler
+// error if we change the number of samples in the future
+// and no appropriate data table is supplied
+template<int NSMP>
+struct SnSigProcDataTable {
+};
+
+// save RAM by not implementing data tables that won't be used
+// (altho I guess they will be optimized away in any case)
+#if CHIPBOARD==SST4CH
+// hard code the number here because these tables are only valid for this value.
+// use kNsamps when instantiating it, though, so a compiler error will happen
+// if there's no data table for that number of samples.
+template<>
+struct SnSigProcDataTable<256> {
+
+    // these are the pairs: (j, m) at each step of the loop over odd
+    // values of i in DiscreteCpxFFT
+    typedef      uint8_t                DfftDivideIndicies_t;    // get away with only 8 bits for 256 samples
+    static const DfftDivideIndicies_t   kDfftDivideIndicies[256];
+    
+    // these are the twidle factors: wr, wi used in DiscreteCpxFFT
+    typedef      float                  DfftTwidleFactor_t;
+    static const DfftTwidleFactor_t     kDfftTwidleFactors[254];
+    
+    typedef      float                  RealDfftTwidleFactor_t;
+    static const RealDfftTwidleFactor_t kRealDfftTwidleFactor[126];
+    
+};
+#endif
+
+#if CHIPBOARD==ATWD4CH
+// hard code the number here because these tables are only valid for this value.
+// use kNsamps when instantiating it, though, so a compiler error will happen
+// if there's no data table for that number of samples.
+template<>
+struct SnSigProcDataTable<128> {
+    // these are the pairs: (j, m) at each step of the loop over odd
+    // values of i in DiscreteCpxFFT
+    typedef      uint8_t                DfftDivideIndicies_t;    // get away with only 8 bits for 256 samples
+    static const DfftDivideIndicies_t   kDfftDivideIndicies[128];
+    
+    // these are the twidle factors: wr, wi used in DiscreteCpxFFT
+    typedef      float                  DfftTwidleFactor_t;
+    static const DfftTwidleFactor_t     kDfftTwidleFactors[126];
+    
+    typedef      float                  RealDfftTwidleFactor_t;
+    static const RealDfftTwidleFactor_t kRealDfftTwidleFactor[62];
+};
+#endif
+
+
+#endif // SnSigProcDataTable
\ No newline at end of file