Arianna autonomous DAQ firmware

Dependencies:   mbed SDFileSystemFilinfo AriSnProtocol NetServicesMin AriSnComm MODSERIAL PowerControlClkPatch DS1820OW

Committer:
uci1
Date:
Wed Jun 05 17:29:31 2019 +0000
Revision:
125:ce4045184366
Parent:
119:b3d7699d0eb0
Added SnRateListner proto-class, publishing this version of the code in order to enable exporting of most recent features.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
uci1 84:80b15993944e 1 #ifndef SN_SnSigProcDataTable
uci1 84:80b15993944e 2 #define SN_SnSigProcDataTable
uci1 84:80b15993944e 3
uci1 84:80b15993944e 4 #include "SnPreCompOptions.h"
uci1 84:80b15993944e 5
uci1 84:80b15993944e 6 #include <stdint.h>
uci1 84:80b15993944e 7
uci1 84:80b15993944e 8 // use template specialization to cause a compiler
uci1 84:80b15993944e 9 // error if we change the number of samples in the future
uci1 84:80b15993944e 10 // and no appropriate data table is supplied
uci1 84:80b15993944e 11 template<int NSMP>
uci1 84:80b15993944e 12 struct SnSigProcDataTable {
uci1 84:80b15993944e 13 };
uci1 84:80b15993944e 14
uci1 84:80b15993944e 15 // save RAM by not implementing data tables that won't be used
uci1 84:80b15993944e 16 // (altho I guess they will be optimized away in any case)
uci1 119:b3d7699d0eb0 17 #if (CHIPBOARD==SST4CH) || (CHIPBOARD==SST4CH_1GHz) || (CHIPBOARD==SST8CH) || (CHIPBOARD==SST8CH_1GHz)
uci1 84:80b15993944e 18 // hard code the number here because these tables are only valid for this value.
uci1 84:80b15993944e 19 // use kNsamps when instantiating it, though, so a compiler error will happen
uci1 84:80b15993944e 20 // if there's no data table for that number of samples.
uci1 84:80b15993944e 21 template<>
uci1 84:80b15993944e 22 struct SnSigProcDataTable<256> {
uci1 84:80b15993944e 23
uci1 84:80b15993944e 24 // these are the pairs: (j, m) at each step of the loop over odd
uci1 84:80b15993944e 25 // values of i in DiscreteCpxFFT
uci1 84:80b15993944e 26 typedef uint8_t DfftDivideIndicies_t; // get away with only 8 bits for 256 samples
uci1 84:80b15993944e 27 static const DfftDivideIndicies_t kDfftDivideIndicies[256];
uci1 84:80b15993944e 28
uci1 84:80b15993944e 29 // these are the twidle factors: wr, wi used in DiscreteCpxFFT
uci1 84:80b15993944e 30 typedef float DfftTwidleFactor_t;
uci1 84:80b15993944e 31 static const DfftTwidleFactor_t kDfftTwidleFactors[254];
uci1 84:80b15993944e 32
uci1 84:80b15993944e 33 typedef float RealDfftTwidleFactor_t;
uci1 84:80b15993944e 34 static const RealDfftTwidleFactor_t kRealDfftTwidleFactor[126];
uci1 84:80b15993944e 35
uci1 84:80b15993944e 36 };
uci1 84:80b15993944e 37 #endif
uci1 84:80b15993944e 38
uci1 84:80b15993944e 39 #if CHIPBOARD==ATWD4CH
uci1 84:80b15993944e 40 // hard code the number here because these tables are only valid for this value.
uci1 84:80b15993944e 41 // use kNsamps when instantiating it, though, so a compiler error will happen
uci1 84:80b15993944e 42 // if there's no data table for that number of samples.
uci1 84:80b15993944e 43 template<>
uci1 84:80b15993944e 44 struct SnSigProcDataTable<128> {
uci1 84:80b15993944e 45 // these are the pairs: (j, m) at each step of the loop over odd
uci1 84:80b15993944e 46 // values of i in DiscreteCpxFFT
uci1 84:80b15993944e 47 typedef uint8_t DfftDivideIndicies_t; // get away with only 8 bits for 256 samples
uci1 84:80b15993944e 48 static const DfftDivideIndicies_t kDfftDivideIndicies[128];
uci1 84:80b15993944e 49
uci1 84:80b15993944e 50 // these are the twidle factors: wr, wi used in DiscreteCpxFFT
uci1 84:80b15993944e 51 typedef float DfftTwidleFactor_t;
uci1 84:80b15993944e 52 static const DfftTwidleFactor_t kDfftTwidleFactors[126];
uci1 84:80b15993944e 53
uci1 84:80b15993944e 54 typedef float RealDfftTwidleFactor_t;
uci1 84:80b15993944e 55 static const RealDfftTwidleFactor_t kRealDfftTwidleFactor[62];
uci1 84:80b15993944e 56 };
uci1 84:80b15993944e 57 #endif
uci1 84:80b15993944e 58
uci1 116:8099b754fbb4 59 #if (CHIPBOARD==SST4CH512) || (CHIPBOARD==SST4CH512_1GHz)
uci1 116:8099b754fbb4 60 // hard code the number here because these tables are only valid for this value.
uci1 116:8099b754fbb4 61 // use kNsamps when instantiating it, though, so a compiler error will happen
uci1 116:8099b754fbb4 62 // if there's no data table for that number of samples.
uci1 116:8099b754fbb4 63 template<>
uci1 116:8099b754fbb4 64 struct SnSigProcDataTable<512> {
uci1 116:8099b754fbb4 65
uci1 116:8099b754fbb4 66 // these are the pairs: (j, m) at each step of the loop over odd
uci1 116:8099b754fbb4 67 // values of i in DiscreteCpxFFT
uci1 116:8099b754fbb4 68 typedef uint16_t DfftDivideIndicies_t; // need 9 bits for 512 samples (biggest value in array is 511)
uci1 116:8099b754fbb4 69 static const DfftDivideIndicies_t kDfftDivideIndicies[512];
uci1 116:8099b754fbb4 70
uci1 116:8099b754fbb4 71 // these are the twidle factors: wr, wi used in DiscreteCpxFFT
uci1 116:8099b754fbb4 72 typedef float DfftTwidleFactor_t;
uci1 116:8099b754fbb4 73 static const DfftTwidleFactor_t kDfftTwidleFactors[510];
uci1 116:8099b754fbb4 74
uci1 116:8099b754fbb4 75 typedef float RealDfftTwidleFactor_t;
uci1 116:8099b754fbb4 76 static const RealDfftTwidleFactor_t kRealDfftTwidleFactor[254];
uci1 116:8099b754fbb4 77
uci1 116:8099b754fbb4 78 };
uci1 116:8099b754fbb4 79 #endif
uci1 116:8099b754fbb4 80
uci1 84:80b15993944e 81
uci1 84:80b15993944e 82 #endif // SnSigProcDataTable